From 6d695a6375e2922751d0e88297e85616313caf17 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 23 Jun 2026 03:22:57 +0000 Subject: [PATCH] Configurations: 'specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/OpenShiftClusters/tspconfig.yaml', API Version: 2025-07-25, and CommitSHA: 'c30e9d0376fb34c59c3207b09b4e933eee295e50' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6468067 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 | 2 +- .../CHANGELOG.md | 198 ++- .../README.md | 14 +- .../SAMPLE.md | 657 ++------- .../pom.xml | 22 +- .../RedHatOpenShiftManager.java | 129 +- .../fluent/MachinePoolsClient.java | 190 --- .../fluent/OpenShiftClustersClient.java | 154 +- .../fluent/OpenShiftVersionsClient.java | 46 +- .../fluent/OperationsClient.java | 10 +- ...rkloadIdentityRoleSetOperationsClient.java | 57 + ...latformWorkloadIdentityRoleSetsClient.java | 49 + ...a => RedHatOpenShiftManagementClient.java} | 56 +- .../redhatopenshift/fluent/SecretsClient.java | 190 --- .../fluent/SyncIdentityProvidersClient.java | 190 --- .../fluent/SyncSetsClient.java | 190 --- .../fluent/models/MachinePoolInner.java | 177 --- .../fluent/models/MachinePoolProperties.java | 93 -- .../OpenShiftClusterAdminKubeconfigInner.java | 27 +- .../OpenShiftClusterCredentialsInner.java | 38 +- .../fluent/models/OpenShiftClusterInner.java | 91 +- .../models/OpenShiftClusterProperties.java | 68 +- .../fluent/models/OpenShiftVersionInner.java | 57 +- .../models/OpenShiftVersionProperties.java | 27 +- .../fluent/models/OperationInner.java | 53 +- ...PlatformWorkloadIdentityRoleSetInner.java} | 109 +- ...formWorkloadIdentityRoleSetProperties.java | 100 ++ .../fluent/models/SecretInner.java | 177 --- .../fluent/models/SecretProperties.java | 93 -- .../SyncIdentityProviderProperties.java | 94 -- .../fluent/models/SyncSetInner.java | 177 --- .../fluent/models/SyncSetProperties.java | 93 -- .../fluent/models/package-info.java | 4 +- .../redhatopenshift/fluent/package-info.java | 4 +- .../implementation/MachinePoolImpl.java | 146 -- .../MachinePoolsClientImpl.java | 942 ------------ .../implementation/MachinePoolsImpl.java | 157 -- .../OpenShiftClusterAdminKubeconfigImpl.java | 2 +- .../OpenShiftClusterCredentialsImpl.java | 2 +- .../implementation/OpenShiftClusterImpl.java | 35 +- .../OpenShiftClustersClientImpl.java | 1268 +++++++---------- .../implementation/OpenShiftClustersImpl.java | 68 +- .../implementation/OpenShiftVersionImpl.java | 2 +- .../OpenShiftVersionsClientImpl.java | 282 ++-- .../implementation/OpenShiftVersionsImpl.java | 20 +- .../implementation/OperationImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 153 +- .../implementation/OperationsImpl.java | 2 +- .../PlatformWorkloadIdentityRoleSetImpl.java | 61 + ...adIdentityRoleSetOperationsClientImpl.java | 175 +++ ...WorkloadIdentityRoleSetOperationsImpl.java | 53 + ...ormWorkloadIdentityRoleSetsClientImpl.java | 285 ++++ .../PlatformWorkloadIdentityRoleSetsImpl.java | 47 + ...dHatOpenShiftManagementClientBuilder.java} | 62 +- ... RedHatOpenShiftManagementClientImpl.java} | 162 +-- .../implementation/ResourceManagerUtils.java | 2 +- .../implementation/SecretImpl.java | 146 -- .../implementation/SecretsClientImpl.java | 935 ------------ .../implementation/SecretsImpl.java | 157 -- .../SyncIdentityProviderImpl.java | 148 -- .../SyncIdentityProvidersClientImpl.java | 947 ------------ .../SyncIdentityProvidersImpl.java | 158 -- .../implementation/SyncSetImpl.java | 146 -- .../implementation/SyncSetsClientImpl.java | 944 ------------ .../implementation/SyncSetsImpl.java | 157 -- .../models/OpenShiftClusterList.java | 52 +- .../models/OpenShiftVersionList.java | 52 +- .../models/OperationList.java | 52 +- .../PlatformWorkloadIdentityRoleSetList.java | 98 ++ .../implementation/package-info.java | 4 +- .../models/ApiServerProfile.java | 10 +- .../models/ClusterProfile.java | 16 +- .../models/ConsoleProfile.java | 10 +- .../redhatopenshift/models/Display.java | 60 +- .../models/EffectiveOutboundIp.java | 27 +- .../models/EncryptionAtHost.java | 6 +- .../models/FipsValidatedModules.java | 6 +- .../models/IngressProfile.java | 10 +- .../models/LoadBalancerProfile.java | 16 +- .../redhatopenshift/models/MachinePool.java | 189 --- .../models/MachinePoolList.java | 127 -- .../models/MachinePoolUpdate.java | 126 -- .../redhatopenshift/models/MachinePools.java | 167 --- .../models/ManagedOutboundIPs.java | 10 +- .../models/ManagedServiceIdentity.java | 154 ++ .../models/ManagedServiceIdentityType.java | 62 + .../redhatopenshift/models/MasterProfile.java | 10 +- .../models/NetworkProfile.java | 13 +- .../models/OpenShiftCluster.java | 82 +- .../OpenShiftClusterAdminKubeconfig.java | 2 +- .../models/OpenShiftClusterCredentials.java | 2 +- .../models/OpenShiftClusterUpdate.java | 66 +- .../models/OpenShiftClusters.java | 102 +- .../models/OpenShiftVersion.java | 2 +- .../models/OpenShiftVersions.java | 44 +- .../redhatopenshift/models/Operation.java | 2 +- .../redhatopenshift/models/Operations.java | 10 +- .../redhatopenshift/models/OutboundType.java | 6 +- .../models/PlatformWorkloadIdentity.java | 117 ++ .../PlatformWorkloadIdentityProfile.java | 121 ++ .../models/PlatformWorkloadIdentityRole.java | 109 ++ .../PlatformWorkloadIdentityRoleSet.java | 65 + ...formWorkloadIdentityRoleSetOperations.java | 51 + .../PlatformWorkloadIdentityRoleSets.java | 44 + .../models/PreconfiguredNsg.java | 6 +- .../models/ProvisioningState.java | 16 +- .../redhatopenshift/models/Secret.java | 189 --- .../redhatopenshift/models/SecretList.java | 127 -- .../redhatopenshift/models/SecretUpdate.java | 126 -- .../redhatopenshift/models/Secrets.java | 167 --- .../models/ServicePrincipalProfile.java | 10 +- .../models/SyncIdentityProvider.java | 189 --- .../models/SyncIdentityProviderList.java | 128 -- .../models/SyncIdentityProviderUpdate.java | 127 -- .../models/SyncIdentityProviders.java | 167 --- .../redhatopenshift/models/SyncSet.java | 189 --- .../redhatopenshift/models/SyncSetList.java | 127 -- .../redhatopenshift/models/SyncSetUpdate.java | 126 -- .../redhatopenshift/models/SyncSets.java | 167 --- .../models/UserAssignedIdentity.java | 89 ++ .../redhatopenshift/models/Visibility.java | 6 +- .../redhatopenshift/models/WorkerProfile.java | 10 +- .../redhatopenshift/models/package-info.java | 4 +- .../redhatopenshift/package-info.java | 4 +- .../src/main/java/module-info.java | 3 +- ...ourcemanager-redhatopenshift_metadata.json | 1 + .../proxy-config.json | 2 +- ...resourcemanager-redhatopenshift.properties | 1 + .../MachinePoolsCreateOrUpdateSamples.java | 30 - .../generated/MachinePoolsDeleteSamples.java | 26 - .../generated/MachinePoolsGetSamples.java | 26 - .../generated/MachinePoolsListSamples.java | 25 - .../generated/MachinePoolsUpdateSamples.java | 33 - ...penShiftClustersCreateOrUpdateSamples.java | 22 +- .../OpenShiftClustersDeleteSamples.java | 6 +- ...hiftClustersGetByResourceGroupSamples.java | 6 +- ...ftClustersListAdminCredentialsSamples.java | 6 +- ...iftClustersListByResourceGroupSamples.java | 6 +- ...enShiftClustersListCredentialsSamples.java | 6 +- .../OpenShiftClustersListSamples.java | 6 +- .../OpenShiftClustersUpdateSamples.java | 27 +- .../OpenShiftVersionsGetSamples.java | 23 + .../OpenShiftVersionsListSamples.java | 6 +- .../generated/OperationsListSamples.java | 6 +- ...oadIdentityRoleSetOperationGetSamples.java | 26 + ...rmWorkloadIdentityRoleSetsListSamples.java | 25 + .../SecretsCreateOrUpdateSamples.java | 28 - .../generated/SecretsDeleteSamples.java | 26 - .../generated/SecretsGetSamples.java | 26 - .../generated/SecretsListSamples.java | 25 - .../generated/SecretsUpdateSamples.java | 30 - ...dentityProvidersCreateOrUpdateSamples.java | 31 - .../SyncIdentityProvidersDeleteSamples.java | 26 - .../SyncIdentityProvidersGetSamples.java | 26 - .../SyncIdentityProvidersListSamples.java | 25 - .../SyncIdentityProvidersUpdateSamples.java | 33 - .../SyncSetsCreateOrUpdateSamples.java | 30 - .../generated/SyncSetsDeleteSamples.java | 26 - .../generated/SyncSetsGetSamples.java | 26 - .../generated/SyncSetsListSamples.java | 25 - .../generated/SyncSetsUpdateSamples.java | 33 - .../generated/ApiServerProfileTests.java | 4 +- .../generated/ConsoleProfileTests.java | 4 +- .../generated/DisplayTests.java | 15 +- .../generated/EffectiveOutboundIpTests.java | 13 +- .../generated/IngressProfileTests.java | 14 +- .../generated/LoadBalancerProfileTests.java | 10 +- .../generated/MachinePoolInnerTests.java | 26 - .../generated/MachinePoolListTests.java | 34 - .../generated/MachinePoolPropertiesTests.java | 25 - .../generated/MachinePoolUpdateTests.java | 25 - ...lsCreateOrUpdateWithResponseMockTests.java | 41 - ...chinePoolsDeleteWithResponseMockTests.java | 34 - .../generated/MachinePoolsListMockTests.java | 39 - .../generated/ManagedOutboundIPsTests.java | 10 +- .../ManagedServiceIdentityTests.java | 45 + .../generated/MasterProfileTests.java | 28 +- .../generated/NetworkProfileTests.java | 34 +- ...ShiftClusterAdminKubeconfigInnerTests.java | 14 +- ...AdminCredentialsWithResponseMockTests.java | 12 +- .../generated/OpenShiftVersionInnerTests.java | 13 +- .../generated/OpenShiftVersionListTests.java | 25 +- .../OpenShiftVersionPropertiesTests.java | 13 +- ...hiftVersionsGetWithResponseMockTests.java} | 19 +- .../OpenShiftVersionsListMockTests.java | 12 +- .../generated/OperationInnerTests.java | 20 +- .../generated/OperationListTests.java | 55 +- .../generated/OperationsListMockTests.java | 20 +- .../PlatformWorkloadIdentityProfileTests.java | 45 + ...formWorkloadIdentityRoleSetInnerTests.java | 22 + ...tformWorkloadIdentityRoleSetListTests.java | 26 + ...SetOperationsGetWithResponseMockTests.java | 42 + ...orkloadIdentityRoleSetPropertiesTests.java | 22 + ...WorkloadIdentityRoleSetsListMockTests.java | 45 + .../PlatformWorkloadIdentityRoleTests.java | 21 + .../PlatformWorkloadIdentityTests.java | 26 + .../SecretsDeleteWithResponseMockTests.java | 34 - .../SyncIdentityProviderInnerTests.java | 26 - .../SyncIdentityProviderListTests.java | 32 - .../SyncIdentityProviderPropertiesTests.java | 25 - .../SyncIdentityProviderUpdateTests.java | 25 - ...rsCreateOrUpdateWithResponseMockTests.java | 41 - ...yProvidersDeleteWithResponseMockTests.java | 33 - ...tityProvidersGetWithResponseMockTests.java | 39 - .../SyncIdentityProvidersListMockTests.java | 39 - .../generated/SyncSetInnerTests.java | 26 - .../generated/SyncSetListTests.java | 31 - .../generated/SyncSetPropertiesTests.java | 25 - .../generated/SyncSetUpdateTests.java | 25 - ...tsCreateOrUpdateWithResponseMockTests.java | 41 - .../SyncSetsDeleteWithResponseMockTests.java | 34 - .../SyncSetsGetWithResponseMockTests.java | 39 - .../generated/SyncSetsListMockTests.java | 39 - .../generated/UserAssignedIdentityTests.java | 22 + .../generated/WorkerProfileTests.java | 40 +- .../tsp-location.yaml | 4 + 216 files changed, 4269 insertions(+), 13316 deletions(-) delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/MachinePoolsClient.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetOperationsClient.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetsClient.java rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/{AzureRedHatOpenShiftClient.java => RedHatOpenShiftManagementClient.java} (60%) delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SecretsClient.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncIdentityProvidersClient.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncSetsClient.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolInner.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolProperties.java rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/{SyncIdentityProviderInner.java => PlatformWorkloadIdentityRoleSetInner.java} (51%) create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetProperties.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretInner.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretProperties.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderProperties.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetInner.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetProperties.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsClientImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsImpl.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetImpl.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsClientImpl.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsImpl.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsClientImpl.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsImpl.java rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/{AzureRedHatOpenShiftClientBuilder.java => RedHatOpenShiftManagementClientBuilder.java} (63%) rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/{AzureRedHatOpenShiftClientImpl.java => RedHatOpenShiftManagementClientImpl.java} (74%) delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsClientImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProviderImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersClientImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsClientImpl.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsImpl.java rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/{ => implementation}/models/OpenShiftClusterList.java (66%) rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/{ => implementation}/models/OpenShiftVersionList.java (67%) rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/{ => implementation}/models/OperationList.java (65%) create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/PlatformWorkloadIdentityRoleSetList.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePool.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolList.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolUpdate.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePools.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentity.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentityType.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentity.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityProfile.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRole.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSet.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSetOperations.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSets.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secret.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretList.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretUpdate.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secrets.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProvider.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderList.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderUpdate.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviders.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSet.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetList.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetUpdate.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSets.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/UserAssignedIdentity.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/azure-resourcemanager-redhatopenshift_metadata.json create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/azure-resourcemanager-redhatopenshift.properties delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsUpdateSamples.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetSamples.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationGetSamples.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsCreateOrUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsGetSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsListSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsUpdateSamples.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolInnerTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolListTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolPropertiesTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolUpdateTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListMockTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedServiceIdentityTests.java rename sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/{MachinePoolsGetWithResponseMockTests.java => OpenShiftVersionsGetWithResponseMockTests.java} (62%) create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityProfileTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetInnerTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetListTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationsGetWithResponseMockTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetPropertiesTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListMockTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderInnerTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderListTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderPropertiesTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderUpdateTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetInnerTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetListTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetPropertiesTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetUpdateTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetWithResponseMockTests.java delete mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListMockTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/UserAssignedIdentityTests.java create mode 100644 sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/tsp-location.yaml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a6fc6182a515..7f4b09d35838 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -475,7 +475,7 @@ com.azure.resourcemanager:azure-resourcemanager-mongocluster;1.1.0;1.2.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-computefleet;1.0.0;1.1.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-servicefabricmanagedclusters;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-healthdataaiservices;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-redhatopenshift;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-redhatopenshift;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-fabric;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-computeschedule;1.1.0;1.2.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-trustedsigning;1.0.0-beta.2;1.0.0-beta.3 diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/CHANGELOG.md b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/CHANGELOG.md index 9c37b9e9819f..4941bfaaa0d5 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/CHANGELOG.md +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/CHANGELOG.md @@ -1,14 +1,204 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0 (2026-06-23) -### Features Added +- Azure Resource Manager RedHatOpenShift client library for Java. This package contains Microsoft Azure SDK for RedHatOpenShift Management SDK. Rest API for Azure Red Hat OpenShift 4. Package api-version 2025-07-25. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.SyncIdentityProviders` was removed + +#### `models.SyncSet$Update` was removed + +#### `models.MachinePoolList` was removed + +#### `models.MachinePools` was removed + +#### `models.SyncIdentityProvider$DefinitionStages` was removed + +#### `models.Secret$UpdateStages` was removed + +#### `models.SyncSet$UpdateStages` was removed + +#### `models.SyncIdentityProviderUpdate` was removed + +#### `models.MachinePool$Update` was removed + +#### `models.SyncSet` was removed + +#### `models.SyncSetList` was removed + +#### `models.MachinePool$UpdateStages` was removed + +#### `models.Secret` was removed + +#### `models.OperationList` was removed + +#### `models.SecretList` was removed + +#### `models.SyncIdentityProviderList` was removed + +#### `models.Secrets` was removed + +#### `models.OpenShiftClusterList` was removed + +#### `models.SyncIdentityProvider$UpdateStages` was removed + +#### `models.SyncSets` was removed + +#### `models.MachinePool$Definition` was removed + +#### `models.Secret$Update` was removed + +#### `models.Secret$DefinitionStages` was removed + +#### `models.SyncIdentityProvider$Update` was removed + +#### `models.SyncSetUpdate` was removed + +#### `models.OpenShiftVersionList` was removed + +#### `models.SyncSet$DefinitionStages` was removed + +#### `models.MachinePool` was removed + +#### `models.MachinePoolUpdate` was removed + +#### `models.Secret$Definition` was removed + +#### `models.SecretUpdate` was removed + +#### `models.SyncSet$Definition` was removed + +#### `models.MachinePool$DefinitionStages` was removed + +#### `models.SyncIdentityProvider$Definition` was removed + +#### `models.SyncIdentityProvider` was removed + +#### `models.WorkerProfile` was modified + +* `validate()` was removed + +#### `models.MasterProfile` was modified + +* `validate()` was removed + +#### `models.NetworkProfile` was modified + +* `validate()` was removed + +#### `models.ServicePrincipalProfile` was modified + +* `validate()` was removed + +#### `models.ManagedOutboundIPs` was modified + +* `validate()` was removed + +#### `models.EffectiveOutboundIp` was modified + +* `EffectiveOutboundIp()` was changed to private access +* `validate()` was removed +* `withId(java.lang.String)` was removed + +#### `models.ApiServerProfile` was modified + +* `validate()` was removed + +#### `models.IngressProfile` was modified + +* `validate()` was removed + +#### `RedHatOpenShiftManager` was modified + +* `fluent.AzureRedHatOpenShiftClient serviceClient()` -> `fluent.RedHatOpenShiftManagementClient serviceClient()` +* `syncSets()` was removed +* `syncIdentityProviders()` was removed +* `machinePools()` was removed +* `secrets()` was removed + +#### `models.ClusterProfile` was modified + +* `validate()` was removed + +#### `models.OpenShiftClusterUpdate` was modified + +* `validate()` was removed +* `systemData()` was removed + +#### `models.LoadBalancerProfile` was modified + +* `validate()` was removed + +#### `models.Display` was modified + +* `Display()` was changed to private access +* `validate()` was removed +* `withOperation(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed + +#### `models.ConsoleProfile` was modified + +* `validate()` was removed + +### Features Added + +* `models.PlatformWorkloadIdentityRoleSetOperations` was added + +* `models.PlatformWorkloadIdentityProfile` was added + +* `models.PlatformWorkloadIdentityRoleSets` was added + +* `models.UserAssignedIdentity` was added + +* `models.PlatformWorkloadIdentityRole` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.PlatformWorkloadIdentity` was added + +* `models.ManagedServiceIdentity` was added + +* `models.PlatformWorkloadIdentityRoleSet` was added + +#### `models.OpenShiftCluster$Definition` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withPlatformWorkloadIdentityProfile(models.PlatformWorkloadIdentityProfile)` was added + +#### `models.OpenShiftCluster$Update` was modified + +* `withPlatformWorkloadIdentityProfile(models.PlatformWorkloadIdentityProfile)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.OpenShiftVersions` was modified + +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `get(java.lang.String,java.lang.String)` was added + +#### `models.OpenShiftCluster` was modified + +* `identity()` was added +* `platformWorkloadIdentityProfile()` was added + +#### `RedHatOpenShiftManager` was modified + +* `platformWorkloadIdentityRoleSets()` was added +* `platformWorkloadIdentityRoleSetOperations()` was added + +#### `models.ClusterProfile` was modified + +* `oidcIssuer()` was added + +#### `models.OpenShiftClusterUpdate` was modified -### Other Changes +* `withPlatformWorkloadIdentityProfile(models.PlatformWorkloadIdentityProfile)` was added +* `platformWorkloadIdentityProfile()` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `identity()` was added ## 1.0.0-beta.1 (2024-08-21) diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/README.md b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/README.md index 709fa11c38de..6bd888dbf6d8 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/README.md +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager Red Hat Open Shift client library for Java +# Azure Resource Manager RedHatOpenShift client library for Java -Azure Resource Manager Red Hat Open Shift client library for Java. +Azure Resource Manager RedHatOpenShift client library for Java. -This package contains Microsoft Azure SDK for Red Hat Open Shift Management SDK. Rest API for Azure Red Hat OpenShift 4. Package tag package-2023-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for RedHatOpenShift Management SDK. Rest API for Azure Red Hat OpenShift 4. Package api-version 2025-07-25. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-redhatopenshift - 1.0.0-beta.2 + 1.0.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ RedHatOpenShiftManager manager = RedHatOpenShiftManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/SAMPLE.md b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/SAMPLE.md index 94921946c93e..78b227486631 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/SAMPLE.md +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/SAMPLE.md @@ -1,14 +1,6 @@ # Code snippets and samples -## MachinePools - -- [CreateOrUpdate](#machinepools_createorupdate) -- [Delete](#machinepools_delete) -- [Get](#machinepools_get) -- [List](#machinepools_list) -- [Update](#machinepools_update) - ## OpenShiftClusters - [CreateOrUpdate](#openshiftclusters_createorupdate) @@ -22,170 +14,20 @@ ## OpenShiftVersions +- [Get](#openshiftversions_get) - [List](#openshiftversions_list) ## Operations - [List](#operations_list) -## Secrets - -- [CreateOrUpdate](#secrets_createorupdate) -- [Delete](#secrets_delete) -- [Get](#secrets_get) -- [List](#secrets_list) -- [Update](#secrets_update) - -## SyncIdentityProviders - -- [CreateOrUpdate](#syncidentityproviders_createorupdate) -- [Delete](#syncidentityproviders_delete) -- [Get](#syncidentityproviders_get) -- [List](#syncidentityproviders_list) -- [Update](#syncidentityproviders_update) - -## SyncSets - -- [CreateOrUpdate](#syncsets_createorupdate) -- [Delete](#syncsets_delete) -- [Get](#syncsets_get) -- [List](#syncsets_list) -- [Update](#syncsets_update) -### MachinePools_CreateOrUpdate - -```java -/** - * Samples for MachinePools CreateOrUpdate. - */ -public final class MachinePoolsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K") - .create(); - } -} -``` - -### MachinePools_Delete - -```java -/** - * Samples for MachinePools Delete. - */ -public final class MachinePoolsDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_Delete.json - */ - /** - * Sample code: Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### MachinePools_Get - -```java -/** - * Samples for MachinePools Get. - */ -public final class MachinePoolsGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_Get.json - */ - /** - * Sample code: Gets a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} -``` +## PlatformWorkloadIdentityRoleSetOperation -### MachinePools_List +- [Get](#platformworkloadidentityrolesetoperation_get) -```java -/** - * Samples for MachinePools List. - */ -public final class MachinePoolsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_List.json - */ - /** - * Sample code: Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsMachinePoolsThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### MachinePools_Update - -```java -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; - -/** - * Samples for MachinePools Update. - */ -public final class MachinePoolsUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_Update.json - */ - /** - * Sample code: Updates a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - MachinePool resource = manager.machinePools() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K") - .apply(); - } -} -``` +## PlatformWorkloadIdentityRoleSets +- [List](#platformworkloadidentityrolesets_list) ### OpenShiftClusters_CreateOrUpdate ```java @@ -197,10 +39,15 @@ import com.azure.resourcemanager.redhatopenshift.models.FipsValidatedModules; import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; import com.azure.resourcemanager.redhatopenshift.models.LoadBalancerProfile; import com.azure.resourcemanager.redhatopenshift.models.ManagedOutboundIPs; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.PreconfiguredNsg; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; +import com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity; import com.azure.resourcemanager.redhatopenshift.models.Visibility; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; import java.util.Arrays; @@ -212,9 +59,7 @@ import java.util.Map; */ public final class OpenShiftClustersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_CreateOrUpdate.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_CreateOrUpdate.json */ /** * Sample code: Creates or updates a OpenShift cluster with the specified subscription, resource group and resource @@ -229,13 +74,18 @@ public final class OpenShiftClustersCreateOrUpdateSamples { .withRegion("location") .withExistingResourceGroup("resourceGroup") .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("", new UserAssignedIdentity()))) .withClusterProfile(new ClusterProfile().withPullSecret("fakeTokenPlaceholder") .withDomain("cluster.location.aroapp.io") - .withResourceGroupId("/subscriptions/subscriptionId/resourceGroups/clusterResourceGroup") + .withResourceGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clusterResourceGroup") .withFipsValidatedModules(FipsValidatedModules.ENABLED)) .withConsoleProfile(new ConsoleProfile()) .withServicePrincipalProfile( new ServicePrincipalProfile().withClientId("clientId").withClientSecret("fakeTokenPlaceholder")) + .withPlatformWorkloadIdentityProfile(new PlatformWorkloadIdentityProfile() + .withPlatformWorkloadIdentities(mapOf("", new PlatformWorkloadIdentity()))) .withNetworkProfile(new NetworkProfile().withPodCidr("10.128.0.0/14") .withServiceCidr("172.30.0.0/16") .withLoadBalancerProfile( @@ -243,13 +93,13 @@ public final class OpenShiftClustersCreateOrUpdateSamples { .withPreconfiguredNsg(PreconfiguredNsg.DISABLED)) .withMasterProfile(new MasterProfile().withVmSize("Standard_D8s_v3") .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") .withEncryptionAtHost(EncryptionAtHost.ENABLED)) .withWorkerProfiles(Arrays.asList(new WorkerProfile().withName("worker") .withVmSize("Standard_D2s_v3") .withDiskSizeGB(128) .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") .withCount(3))) .withApiserverProfile(new ApiServerProfile().withVisibility(Visibility.PUBLIC)) .withIngressProfiles( @@ -279,9 +129,7 @@ public final class OpenShiftClustersCreateOrUpdateSamples { */ public final class OpenShiftClustersDeleteSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_Delete.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_Delete.json */ /** * Sample code: Deletes a OpenShift cluster with the specified subscription, resource group and resource name. @@ -303,9 +151,7 @@ public final class OpenShiftClustersDeleteSamples { */ public final class OpenShiftClustersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_Get.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_Get.json */ /** * Sample code: Gets a OpenShift cluster with the specified subscription, resource group and resource name. @@ -328,9 +174,7 @@ public final class OpenShiftClustersGetByResourceGroupSamples { */ public final class OpenShiftClustersListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_List.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_List.json */ /** * Sample code: Lists OpenShift clusters in the specified subscription. @@ -352,9 +196,7 @@ public final class OpenShiftClustersListSamples { */ public final class OpenShiftClustersListAdminCredentialsSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_ListAdminCredentials.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_ListAdminCredentials.json */ /** * Sample code: Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group and @@ -378,9 +220,7 @@ public final class OpenShiftClustersListAdminCredentialsSamples { */ public final class OpenShiftClustersListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_ListByResourceGroup.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_ListByResourceGroup.json */ /** * Sample code: Lists OpenShift clusters in the specified subscription and resource group. @@ -402,9 +242,7 @@ public final class OpenShiftClustersListByResourceGroupSamples { */ public final class OpenShiftClustersListCredentialsSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_ListCredentials.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_ListCredentials.json */ /** * Sample code: Lists credentials of an OpenShift cluster with the specified subscription, resource group and @@ -431,11 +269,16 @@ import com.azure.resourcemanager.redhatopenshift.models.FipsValidatedModules; import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; import com.azure.resourcemanager.redhatopenshift.models.LoadBalancerProfile; import com.azure.resourcemanager.redhatopenshift.models.ManagedOutboundIPs; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftCluster; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.PreconfiguredNsg; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; +import com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity; import com.azure.resourcemanager.redhatopenshift.models.Visibility; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; import java.util.Arrays; @@ -447,29 +290,33 @@ import java.util.Map; */ public final class OpenShiftClustersUpdateSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_Update.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_Update.json */ /** - * Sample code: Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Sample code: Creates or updates a OpenShift cluster with the specified subscription, resource group and resource + * name. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void updatesAOpenShiftClusterWithTheSpecifiedSubscriptionResourceGroupAndResourceName( + public static void createsOrUpdatesAOpenShiftClusterWithTheSpecifiedSubscriptionResourceGroupAndResourceName( com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { OpenShiftCluster resource = manager.openShiftClusters() .getByResourceGroupWithResponse("resourceGroup", "resourceName", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("", new UserAssignedIdentity()))) .withClusterProfile(new ClusterProfile().withPullSecret("fakeTokenPlaceholder") .withDomain("cluster.location.aroapp.io") - .withResourceGroupId("/subscriptions/subscriptionId/resourceGroups/clusterResourceGroup") + .withResourceGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clusterResourceGroup") .withFipsValidatedModules(FipsValidatedModules.ENABLED)) .withConsoleProfile(new ConsoleProfile()) .withServicePrincipalProfile( new ServicePrincipalProfile().withClientId("clientId").withClientSecret("fakeTokenPlaceholder")) + .withPlatformWorkloadIdentityProfile(new PlatformWorkloadIdentityProfile() + .withPlatformWorkloadIdentities(mapOf("", new PlatformWorkloadIdentity()))) .withNetworkProfile(new NetworkProfile().withPodCidr("10.128.0.0/14") .withServiceCidr("172.30.0.0/16") .withLoadBalancerProfile( @@ -477,13 +324,13 @@ public final class OpenShiftClustersUpdateSamples { .withPreconfiguredNsg(PreconfiguredNsg.DISABLED)) .withMasterProfile(new MasterProfile().withVmSize("Standard_D8s_v3") .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") .withEncryptionAtHost(EncryptionAtHost.ENABLED)) .withWorkerProfiles(Arrays.asList(new WorkerProfile().withName("worker") .withVmSize("Standard_D2s_v3") .withDiskSizeGB(128) .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") .withCount(3))) .withApiserverProfile(new ApiServerProfile().withVisibility(Visibility.PUBLIC)) .withIngressProfiles( @@ -505,451 +352,117 @@ public final class OpenShiftClustersUpdateSamples { } ``` -### OpenShiftVersions_List - -```java -/** - * Samples for OpenShiftVersions List. - */ -public final class OpenShiftVersionsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftVersions_List.json - */ - /** - * Sample code: Lists all OpenShift versions available to install in the specified location. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsAllOpenShiftVersionsAvailableToInstallInTheSpecifiedLocation( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.openShiftVersions().list("location", com.azure.core.util.Context.NONE); - } -} -``` - -### Operations_List - -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Operations_List.json - */ - /** - * Sample code: Lists all of the available RP operations. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void - listsAllOfTheAvailableRPOperations(com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### Secrets_CreateOrUpdate +### OpenShiftVersions_Get ```java /** - * Samples for Secrets CreateOrUpdate. + * Samples for OpenShiftVersions Get. */ -public final class SecretsCreateOrUpdateSamples { +public final class OpenShiftVersionsGetSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_CreateOrUpdate.json + * x-ms-original-file: 2025-07-25/OpenShiftVersions_Get.json */ /** - * Sample code: Creates or updates a Secret with the specified subscription, resource group and resource name. + * Sample code: Gets an available OpenShift version to install in the specified location. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void createsOrUpdatesASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( + public static void getsAnAvailableOpenShiftVersionToInstallInTheSpecifiedLocation( com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .create(); + manager.openShiftVersions().getWithResponse("location", "4.14.40", com.azure.core.util.Context.NONE); } } ``` -### Secrets_Delete - -```java -/** - * Samples for Secrets Delete. - */ -public final class SecretsDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_Delete.json - */ - /** - * Sample code: Deletes a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### Secrets_Get - -```java -/** - * Samples for Secrets Get. - */ -public final class SecretsGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_Get.json - */ - /** - * Sample code: Gets a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### Secrets_List - -```java -/** - * Samples for Secrets List. - */ -public final class SecretsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_List.json - */ - /** - * Sample code: Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsSecretsThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### Secrets_Update - -```java -import com.azure.resourcemanager.redhatopenshift.models.Secret; - -/** - * Samples for Secrets Update. - */ -public final class SecretsUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_Update.json - */ - /** - * Sample code: Updates a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - Secret resource = manager.secrets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); - } -} -``` - -### SyncIdentityProviders_CreateOrUpdate - -```java -/** - * Samples for SyncIdentityProviders CreateOrUpdate. - */ -public final class SyncIdentityProvidersCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a SyncIdentityProvider with the specified subscription, resource group and - * resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==") - .create(); - } -} -``` - -### SyncIdentityProviders_Delete - -```java -/** - * Samples for SyncIdentityProviders Delete. - */ -public final class SyncIdentityProvidersDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_Delete.json - */ - /** - * Sample code: Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### SyncIdentityProviders_Get - -```java -/** - * Samples for SyncIdentityProviders Get. - */ -public final class SyncIdentityProvidersGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_Get.json - */ - /** - * Sample code: Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### SyncIdentityProviders_List - -```java -/** - * Samples for SyncIdentityProviders List. - */ -public final class SyncIdentityProvidersListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_List.json - */ - /** - * Sample code: Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsSyncIdentityProvidersThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} -``` - -### SyncIdentityProviders_Update - -```java -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; - -/** - * Samples for SyncIdentityProviders Update. - */ -public final class SyncIdentityProvidersUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_Update.json - */ - /** - * Sample code: Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - SyncIdentityProvider resource = manager.syncIdentityProviders() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==") - .apply(); - } -} -``` - -### SyncSets_CreateOrUpdate - -```java -/** - * Samples for SyncSets CreateOrUpdate. - */ -public final class SyncSetsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .withResources( - "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=") - .create(); - } -} -``` - -### SyncSets_Delete +### OpenShiftVersions_List ```java /** - * Samples for SyncSets Delete. + * Samples for OpenShiftVersions List. */ -public final class SyncSetsDeleteSamples { +public final class OpenShiftVersionsListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_Delete.json + * x-ms-original-file: 2025-07-25/OpenShiftVersions_List.json */ /** - * Sample code: Deletes a SyncSet with the specified subscription, resource group and resource name. + * Sample code: Lists all OpenShift versions available to install in the specified location. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void deletesASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( + public static void listsAllOpenShiftVersionsAvailableToInstallInTheSpecifiedLocation( com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); + manager.openShiftVersions().list("location", com.azure.core.util.Context.NONE); } } ``` -### SyncSets_Get +### Operations_List ```java /** - * Samples for SyncSets Get. + * Samples for Operations List. */ -public final class SyncSetsGetSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_Get.json + * x-ms-original-file: 2025-07-25/Operations_List.json */ /** - * Sample code: Gets a SyncSet with the specified subscription, resource group and resource name. + * Sample code: Lists all of the available RP operations. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void getsASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); + public static void + listsAllOfTheAvailableRPOperations(com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### SyncSets_List +### PlatformWorkloadIdentityRoleSetOperation_Get ```java /** - * Samples for SyncSets List. + * Samples for PlatformWorkloadIdentityRoleSetOperation Get. */ -public final class SyncSetsListSamples { +public final class PlatformWorkloadIdentityRoleSetOperationGetSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_List.json + * x-ms-original-file: 2025-07-25/PlatformWorkloadIdentityRoleSet_Get.json */ /** - * Sample code: Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. + * Sample code: Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void listsSyncSetsThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); + public static void + getsAMappingOfAnOpenShiftVersionToIdentityRequirementsWhichIncludesOperatorNameRoleDefinitionNameRoleDefinitionIdAndServiceAccounts( + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { + manager.platformWorkloadIdentityRoleSetOperations() + .getWithResponse("location", "4.14", com.azure.core.util.Context.NONE); } } ``` -### SyncSets_Update +### PlatformWorkloadIdentityRoleSets_List ```java -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; - /** - * Samples for SyncSets Update. + * Samples for PlatformWorkloadIdentityRoleSets List. */ -public final class SyncSetsUpdateSamples { +public final class PlatformWorkloadIdentityRoleSetsListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_Update.json + * x-ms-original-file: 2025-07-25/PlatformWorkloadIdentityRoleSets_List.json */ /** - * Sample code: Updates a SyncSet with the specified subscription, resource group and resource name. + * Sample code: Lists a mapping of OpenShift versions to identity requirements, which include operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void updatesASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - SyncSet resource = manager.syncSets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withResources( - "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=") - .apply(); + public static void + listsAMappingOfOpenShiftVersionsToIdentityRequirementsWhichIncludeOperatorNameRoleDefinitionNameRoleDefinitionIdAndServiceAccounts( + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { + manager.platformWorkloadIdentityRoleSets().list("location", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/pom.xml b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/pom.xml index ae7139e05e8d..2efcfa715d7e 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/pom.xml +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-redhatopenshift - 1.0.0-beta.2 + 1.0.0 jar - Microsoft Azure SDK for Red Hat Open Shift Management - This package contains Microsoft Azure SDK for Red Hat Open Shift Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Rest API for Azure Red Hat OpenShift 4. Package tag package-2023-11. + Microsoft Azure SDK for RedHatOpenShift Management + This package contains Microsoft Azure SDK for RedHatOpenShift Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Rest API for Azure Red Hat OpenShift 4. Package api-version 2025-07-25. https://github.com/Azure/azure-sdk-for-java @@ -45,14 +45,9 @@ UTF-8 0 0 - true + false - - com.azure - azure-json - 1.5.1 - com.azure azure-core @@ -75,5 +70,10 @@ 1.18.4 test + + com.azure + azure-json + 1.5.1 + diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/RedHatOpenShiftManager.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/RedHatOpenShiftManager.java index 0b157918c43c..fd6c5578e795 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/RedHatOpenShiftManager.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/RedHatOpenShiftManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift; @@ -11,38 +11,36 @@ 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.HttpLoggingPolicy; +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.http.policy.ArmChallengeAuthenticationPolicy; 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.redhatopenshift.fluent.AzureRedHatOpenShiftClient; -import com.azure.resourcemanager.redhatopenshift.implementation.AzureRedHatOpenShiftClientBuilder; -import com.azure.resourcemanager.redhatopenshift.implementation.MachinePoolsImpl; +import com.azure.resourcemanager.redhatopenshift.fluent.RedHatOpenShiftManagementClient; import com.azure.resourcemanager.redhatopenshift.implementation.OpenShiftClustersImpl; import com.azure.resourcemanager.redhatopenshift.implementation.OpenShiftVersionsImpl; import com.azure.resourcemanager.redhatopenshift.implementation.OperationsImpl; -import com.azure.resourcemanager.redhatopenshift.implementation.SecretsImpl; -import com.azure.resourcemanager.redhatopenshift.implementation.SyncIdentityProvidersImpl; -import com.azure.resourcemanager.redhatopenshift.implementation.SyncSetsImpl; -import com.azure.resourcemanager.redhatopenshift.models.MachinePools; +import com.azure.resourcemanager.redhatopenshift.implementation.PlatformWorkloadIdentityRoleSetOperationsImpl; +import com.azure.resourcemanager.redhatopenshift.implementation.PlatformWorkloadIdentityRoleSetsImpl; +import com.azure.resourcemanager.redhatopenshift.implementation.RedHatOpenShiftManagementClientBuilder; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusters; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftVersions; import com.azure.resourcemanager.redhatopenshift.models.Operations; -import com.azure.resourcemanager.redhatopenshift.models.Secrets; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviders; -import com.azure.resourcemanager.redhatopenshift.models.SyncSets; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSetOperations; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSets; 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; @@ -55,22 +53,18 @@ public final class RedHatOpenShiftManager { private OpenShiftVersions openShiftVersions; - private OpenShiftClusters openShiftClusters; - - private MachinePools machinePools; + private PlatformWorkloadIdentityRoleSets platformWorkloadIdentityRoleSets; - private Secrets secrets; - - private SyncIdentityProviders syncIdentityProviders; + private OpenShiftClusters openShiftClusters; - private SyncSets syncSets; + private PlatformWorkloadIdentityRoleSetOperations platformWorkloadIdentityRoleSetOperations; - private final AzureRedHatOpenShiftClient clientObject; + private final RedHatOpenShiftManagementClient clientObject; private RedHatOpenShiftManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new AzureRedHatOpenShiftClientBuilder().pipeline(httpPipeline) + this.clientObject = new RedHatOpenShiftManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -78,11 +72,11 @@ private RedHatOpenShiftManager(HttpPipeline httpPipeline, AzureProfile profile, } /** - * Creates an instance of Red Hat Open Shift service API entry point. + * Creates an instance of RedHatOpenShift service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Red Hat Open Shift service API instance. + * @return the RedHatOpenShift service API instance. */ public static RedHatOpenShiftManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -91,11 +85,11 @@ public static RedHatOpenShiftManager authenticate(TokenCredential credential, Az } /** - * Creates an instance of Red Hat Open Shift service API entry point. + * Creates an instance of RedHatOpenShift 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 Open Shift service API instance. + * @return the RedHatOpenShift service API instance. */ public static RedHatOpenShiftManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -117,6 +111,9 @@ public static Configurable configure() { */ 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-redhatopenshift.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -214,22 +211,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of Red Hat Open Shift service API entry point. + * Creates an instance of RedHatOpenShift service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Red Hat Open Shift service API instance. + * @return the RedHatOpenShift service API instance. */ public RedHatOpenShiftManager 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.redhatopenshift") .append("/") - .append("1.0.0-beta.1"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -262,7 +261,7 @@ public RedHatOpenShiftManager authenticate(TokenCredential credential, AzureProf HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + 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())); @@ -300,72 +299,50 @@ public OpenShiftVersions openShiftVersions() { } /** - * Gets the resource collection API of OpenShiftClusters. It manages OpenShiftCluster. + * Gets the resource collection API of PlatformWorkloadIdentityRoleSets. * - * @return Resource collection API of OpenShiftClusters. + * @return Resource collection API of PlatformWorkloadIdentityRoleSets. */ - public OpenShiftClusters openShiftClusters() { - if (this.openShiftClusters == null) { - this.openShiftClusters = new OpenShiftClustersImpl(clientObject.getOpenShiftClusters(), this); + public PlatformWorkloadIdentityRoleSets platformWorkloadIdentityRoleSets() { + if (this.platformWorkloadIdentityRoleSets == null) { + this.platformWorkloadIdentityRoleSets + = new PlatformWorkloadIdentityRoleSetsImpl(clientObject.getPlatformWorkloadIdentityRoleSets(), this); } - return openShiftClusters; + return platformWorkloadIdentityRoleSets; } /** - * Gets the resource collection API of MachinePools. It manages MachinePool. - * - * @return Resource collection API of MachinePools. - */ - public MachinePools machinePools() { - if (this.machinePools == null) { - this.machinePools = new MachinePoolsImpl(clientObject.getMachinePools(), this); - } - return machinePools; - } - - /** - * Gets the resource collection API of Secrets. It manages Secret. - * - * @return Resource collection API of Secrets. - */ - public Secrets secrets() { - if (this.secrets == null) { - this.secrets = new SecretsImpl(clientObject.getSecrets(), this); - } - return secrets; - } - - /** - * Gets the resource collection API of SyncIdentityProviders. It manages SyncIdentityProvider. + * Gets the resource collection API of OpenShiftClusters. It manages OpenShiftCluster. * - * @return Resource collection API of SyncIdentityProviders. + * @return Resource collection API of OpenShiftClusters. */ - public SyncIdentityProviders syncIdentityProviders() { - if (this.syncIdentityProviders == null) { - this.syncIdentityProviders = new SyncIdentityProvidersImpl(clientObject.getSyncIdentityProviders(), this); + public OpenShiftClusters openShiftClusters() { + if (this.openShiftClusters == null) { + this.openShiftClusters = new OpenShiftClustersImpl(clientObject.getOpenShiftClusters(), this); } - return syncIdentityProviders; + return openShiftClusters; } /** - * Gets the resource collection API of SyncSets. It manages SyncSet. + * Gets the resource collection API of PlatformWorkloadIdentityRoleSetOperations. * - * @return Resource collection API of SyncSets. + * @return Resource collection API of PlatformWorkloadIdentityRoleSetOperations. */ - public SyncSets syncSets() { - if (this.syncSets == null) { - this.syncSets = new SyncSetsImpl(clientObject.getSyncSets(), this); + public PlatformWorkloadIdentityRoleSetOperations platformWorkloadIdentityRoleSetOperations() { + if (this.platformWorkloadIdentityRoleSetOperations == null) { + this.platformWorkloadIdentityRoleSetOperations = new PlatformWorkloadIdentityRoleSetOperationsImpl( + clientObject.getPlatformWorkloadIdentityRoleSetOperations(), this); } - return syncSets; + return platformWorkloadIdentityRoleSetOperations; } /** - * Gets wrapped service client AzureRedHatOpenShiftClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets wrapped service client RedHatOpenShiftManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. * - * @return Wrapped service client AzureRedHatOpenShiftClient. + * @return Wrapped service client RedHatOpenShiftManagementClient. */ - public AzureRedHatOpenShiftClient serviceClient() { + public RedHatOpenShiftManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/MachinePoolsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/MachinePoolsClient.java deleted file mode 100644 index b3f1f048467d..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/MachinePoolsClient.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.models.MachinePoolInner; -import com.azure.resourcemanager.redhatopenshift.models.MachinePoolUpdate; - -/** - * An instance of this class provides access to all the operations defined in MachinePoolsClient. - */ -public interface MachinePoolsClient { - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 machinePoolList represents a list of MachinePools as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @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 machinePool represents a MachinePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachinePoolInner get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolInner parameters, Context context); - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @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 machinePool represents a MachinePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachinePoolInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - MachinePoolInner parameters); - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @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 resourceName, String childResourceName); - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolUpdate parameters, Context context); - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @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 machinePool represents a MachinePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachinePoolInner update(String resourceGroupName, String resourceName, String childResourceName, - MachinePoolUpdate parameters); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftClustersClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftClustersClient.java index da859d7e1d9d..ad18b2e752ff 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftClustersClient.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftClustersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent; @@ -21,95 +21,110 @@ */ public interface OpenShiftClustersClient { /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftClusterInner getByResourceGroup(String resourceGroupName, String resourceName); /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OpenShiftClusterInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, OpenShiftClusterInner parameters); /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OpenShiftClusterInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, OpenShiftClusterInner parameters, Context context); /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. + * @param parameters The OpenShift cluster resource. * @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 openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); + OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters); /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftClusterInner getByResourceGroup(String resourceGroupName, String resourceName); + OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters, Context context); /** * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. @@ -125,8 +140,8 @@ Response getByResourceGroupWithResponse(String resourceGr * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OpenShiftClusterInner> beginCreateOrUpdate(String resourceGroupName, - String resourceName, OpenShiftClusterInner parameters); + SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, + String resourceName, OpenShiftClusterUpdate parameters); /** * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. @@ -143,8 +158,8 @@ SyncPoller, OpenShiftClusterInner> beginCreate * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OpenShiftClusterInner> beginCreateOrUpdate(String resourceGroupName, - String resourceName, OpenShiftClusterInner parameters, Context context); + SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, + String resourceName, OpenShiftClusterUpdate parameters, Context context); /** * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. @@ -160,8 +175,7 @@ SyncPoller, OpenShiftClusterInner> beginCreate * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, - OpenShiftClusterInner parameters); + OpenShiftClusterInner update(String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters); /** * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. @@ -178,8 +192,8 @@ OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceNa * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, - OpenShiftClusterInner parameters, Context context); + OpenShiftClusterInner update(String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters, + Context context); /** * Deletes a OpenShift cluster with the specified subscription, resource group and resource name. @@ -242,73 +256,63 @@ OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceNa void delete(String resourceGroupName, String resourceName, Context context); /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @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 openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, - String resourceName, OpenShiftClusterUpdate parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, - String resourceName, OpenShiftClusterUpdate parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. - * @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 openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftClusterInner update(String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - OpenShiftClusterInner update(String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group and resource name. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftVersionsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftVersionsClient.java index 1ce7ebd3bfed..f8172a2ae6bb 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftVersionsClient.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftVersionsClient.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.models.OpenShiftVersionInner; @@ -14,12 +15,47 @@ * An instance of this class provides access to all the operations defined in OpenShiftVersionsClient. */ public interface OpenShiftVersionsClient { + /** + * Gets an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + * + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String openShiftVersion, Context context); + + /** + * Gets an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + * + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. + * @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 an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftVersionInner get(String location, String openShiftVersion); + /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. @@ -32,9 +68,9 @@ public interface OpenShiftVersionsClient { /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OperationsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OperationsClient.java index be0d943e28eb..bed963d5f602 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OperationsClient.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent; @@ -15,9 +15,7 @@ */ public interface OperationsClient { /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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. @@ -27,9 +25,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetOperationsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetOperationsClient.java new file mode 100644 index 000000000000..a17f061cb9ce --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetOperationsClient.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.redhatopenshift.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; + +/** + * An instance of this class provides access to all the operations defined in + * PlatformWorkloadIdentityRoleSetOperationsClient. + */ +public interface PlatformWorkloadIdentityRoleSetOperationsClient { + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String openShiftMinorVersion, + Context context); + + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @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 mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PlatformWorkloadIdentityRoleSetInner get(String location, String openShiftMinorVersion); +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetsClient.java new file mode 100644 index 000000000000..0cbf2ee0d23b --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; + +/** + * An instance of this class provides access to all the operations defined in PlatformWorkloadIdentityRoleSetsClient. + */ +public interface PlatformWorkloadIdentityRoleSetsClient { + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/AzureRedHatOpenShiftClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/RedHatOpenShiftManagementClient.java similarity index 60% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/AzureRedHatOpenShiftClient.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/RedHatOpenShiftManagementClient.java index 52656f612456..285d2c80a002 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/AzureRedHatOpenShiftClient.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/RedHatOpenShiftManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for AzureRedHatOpenShiftClient class. + * The interface for RedHatOpenShiftManagementClient class. */ -public interface AzureRedHatOpenShiftClient { +public interface RedHatOpenShiftManagementClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -61,37 +61,23 @@ public interface AzureRedHatOpenShiftClient { OpenShiftVersionsClient getOpenShiftVersions(); /** - * Gets the OpenShiftClustersClient object to access its operations. - * - * @return the OpenShiftClustersClient object. - */ - OpenShiftClustersClient getOpenShiftClusters(); - - /** - * Gets the MachinePoolsClient object to access its operations. + * Gets the PlatformWorkloadIdentityRoleSetsClient object to access its operations. * - * @return the MachinePoolsClient object. + * @return the PlatformWorkloadIdentityRoleSetsClient object. */ - MachinePoolsClient getMachinePools(); + PlatformWorkloadIdentityRoleSetsClient getPlatformWorkloadIdentityRoleSets(); /** - * Gets the SecretsClient object to access its operations. - * - * @return the SecretsClient object. - */ - SecretsClient getSecrets(); - - /** - * Gets the SyncIdentityProvidersClient object to access its operations. + * Gets the OpenShiftClustersClient object to access its operations. * - * @return the SyncIdentityProvidersClient object. + * @return the OpenShiftClustersClient object. */ - SyncIdentityProvidersClient getSyncIdentityProviders(); + OpenShiftClustersClient getOpenShiftClusters(); /** - * Gets the SyncSetsClient object to access its operations. + * Gets the PlatformWorkloadIdentityRoleSetOperationsClient object to access its operations. * - * @return the SyncSetsClient object. + * @return the PlatformWorkloadIdentityRoleSetOperationsClient object. */ - SyncSetsClient getSyncSets(); + PlatformWorkloadIdentityRoleSetOperationsClient getPlatformWorkloadIdentityRoleSetOperations(); } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SecretsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SecretsClient.java deleted file mode 100644 index a02faff85e30..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SecretsClient.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.models.SecretInner; -import com.azure.resourcemanager.redhatopenshift.models.SecretUpdate; - -/** - * An instance of this class provides access to all the operations defined in SecretsClient. - */ -public interface SecretsClient { - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 secretList represents a list of Secrets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @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 secret represents a secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SecretInner parameters, Context context); - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @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 secret represents a secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - SecretInner parameters); - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @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 resourceName, String childResourceName); - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String resourceName, String childResourceName, - SecretUpdate parameters, Context context); - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @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 secret represents a secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner update(String resourceGroupName, String resourceName, String childResourceName, - SecretUpdate parameters); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncIdentityProvidersClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncIdentityProvidersClient.java deleted file mode 100644 index 22aa74c7bbc3..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncIdentityProvidersClient.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviderUpdate; - -/** - * An instance of this class provides access to all the operations defined in SyncIdentityProvidersClient. - */ -public interface SyncIdentityProvidersClient { - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context); - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @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 syncIdentityProvider represents a SyncIdentityProvider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncIdentityProviderInner get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderInner parameters, Context context); - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @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 syncIdentityProvider represents a SyncIdentityProvider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncIdentityProviderInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - SyncIdentityProviderInner parameters); - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @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 resourceName, String childResourceName); - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderUpdate parameters, Context context); - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @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 syncIdentityProvider represents a SyncIdentityProvider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncIdentityProviderInner update(String resourceGroupName, String resourceName, String childResourceName, - SyncIdentityProviderUpdate parameters); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncSetsClient.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncSetsClient.java deleted file mode 100644 index 5c41ea4125fd..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/SyncSetsClient.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.models.SyncSetInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncSetUpdate; - -/** - * An instance of this class provides access to all the operations defined in SyncSetsClient. - */ -public interface SyncSetsClient { - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @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 syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncSetInner get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncSetInner parameters, Context context); - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @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 syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncSetInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - SyncSetInner parameters); - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @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 resourceName, String childResourceName); - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String resourceName, String childResourceName, - SyncSetUpdate parameters, Context context); - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @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 syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncSetInner update(String resourceGroupName, String resourceName, String childResourceName, - SyncSetUpdate parameters); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolInner.java deleted file mode 100644 index 9c091665e840..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolInner.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 java.io.IOException; - -/** - * MachinePool represents a MachinePool. - */ -@Fluent -public final class MachinePoolInner extends ProxyResource { - /* - * The MachinePool Properties - */ - private MachinePoolProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /* - * The name of the resource. - */ - private String name; - - /* - * The type of the resource. - */ - private String type; - - /** - * Creates an instance of MachinePoolInner class. - */ - public MachinePoolInner() { - } - - /** - * Get the innerProperties property: The MachinePool Properties. - * - * @return the innerProperties value. - */ - private MachinePoolProperties innerProperties() { - return this.innerProperties; - } - - /** - * 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 id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public String resources() { - return this.innerProperties() == null ? null : this.innerProperties().resources(); - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the MachinePoolInner object itself. - */ - public MachinePoolInner withResources(String resources) { - if (this.innerProperties() == null) { - this.innerProperties = new MachinePoolProperties(); - } - this.innerProperties().withResources(resources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MachinePoolInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachinePoolInner 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 MachinePoolInner. - */ - public static MachinePoolInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachinePoolInner deserializedMachinePoolInner = new MachinePoolInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedMachinePoolInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedMachinePoolInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedMachinePoolInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedMachinePoolInner.innerProperties = MachinePoolProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedMachinePoolInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMachinePoolInner; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolProperties.java deleted file mode 100644 index 8ce031b9c1e0..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/MachinePoolProperties.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.fluent.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; - -/** - * MachinePoolProperties represents the properties of a MachinePool. - */ -@Fluent -public final class MachinePoolProperties implements JsonSerializable { - /* - * The resources property. - */ - private String resources; - - /** - * Creates an instance of MachinePoolProperties class. - */ - public MachinePoolProperties() { - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public String resources() { - return this.resources; - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the MachinePoolProperties object itself. - */ - public MachinePoolProperties withResources(String resources) { - this.resources = resources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resources", this.resources); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MachinePoolProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachinePoolProperties 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 MachinePoolProperties. - */ - public static MachinePoolProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachinePoolProperties deserializedMachinePoolProperties = new MachinePoolProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resources".equals(fieldName)) { - deserializedMachinePoolProperties.resources = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMachinePoolProperties; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterAdminKubeconfigInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterAdminKubeconfigInner.java index 9cf6c307f432..9848e0b6a16d 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterAdminKubeconfigInner.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterAdminKubeconfigInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * OpenShiftClusterAdminKubeconfig represents an OpenShift cluster's admin kubeconfig. */ -@Fluent +@Immutable public final class OpenShiftClusterAdminKubeconfigInner implements JsonSerializable { /* @@ -25,7 +25,7 @@ public final class OpenShiftClusterAdminKubeconfigInner /** * Creates an instance of OpenShiftClusterAdminKubeconfigInner class. */ - public OpenShiftClusterAdminKubeconfigInner() { + private OpenShiftClusterAdminKubeconfigInner() { } /** @@ -37,25 +37,6 @@ public String kubeconfig() { return this.kubeconfig; } - /** - * Set the kubeconfig property: The base64-encoded kubeconfig file. - * - * @param kubeconfig the kubeconfig value to set. - * @return the OpenShiftClusterAdminKubeconfigInner object itself. - */ - public OpenShiftClusterAdminKubeconfigInner withKubeconfig(String kubeconfig) { - this.kubeconfig = kubeconfig; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterCredentialsInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterCredentialsInner.java index 51bba368347c..b3b78cc721dd 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterCredentialsInner.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterCredentialsInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * OpenShiftClusterCredentials represents an OpenShift cluster's credentials. */ -@Fluent +@Immutable public final class OpenShiftClusterCredentialsInner implements JsonSerializable { /* * The username for the kubeadmin user. @@ -29,7 +29,7 @@ public final class OpenShiftClusterCredentialsInner implements JsonSerializable< /** * Creates an instance of OpenShiftClusterCredentialsInner class. */ - public OpenShiftClusterCredentialsInner() { + private OpenShiftClusterCredentialsInner() { } /** @@ -41,17 +41,6 @@ public String kubeadminUsername() { return this.kubeadminUsername; } - /** - * Set the kubeadminUsername property: The username for the kubeadmin user. - * - * @param kubeadminUsername the kubeadminUsername value to set. - * @return the OpenShiftClusterCredentialsInner object itself. - */ - public OpenShiftClusterCredentialsInner withKubeadminUsername(String kubeadminUsername) { - this.kubeadminUsername = kubeadminUsername; - return this; - } - /** * Get the kubeadminPassword property: The password for the kubeadmin user. * @@ -61,25 +50,6 @@ public String kubeadminPassword() { return this.kubeadminPassword; } - /** - * Set the kubeadminPassword property: The password for the kubeadmin user. - * - * @param kubeadminPassword the kubeadminPassword value to set. - * @return the OpenShiftClusterCredentialsInner object itself. - */ - public OpenShiftClusterCredentialsInner withKubeadminPassword(String kubeadminPassword) { - this.kubeadminPassword = kubeadminPassword; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterInner.java index c8806de9843b..2511cd9396d7 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterInner.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; @@ -14,8 +14,10 @@ import com.azure.resourcemanager.redhatopenshift.models.ClusterProfile; import com.azure.resourcemanager.redhatopenshift.models.ConsoleProfile; import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.ProvisioningState; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; @@ -33,15 +35,20 @@ public final class OpenShiftClusterInner extends Resource { */ private OpenShiftClusterProperties innerProperties; + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -49,9 +56,9 @@ public final class OpenShiftClusterInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of OpenShiftClusterInner class. @@ -68,6 +75,26 @@ private OpenShiftClusterProperties innerProperties() { return this.innerProperties; } + /** + * 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 OpenShiftClusterInner object itself. + */ + public OpenShiftClusterInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -78,13 +105,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -98,13 +125,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -217,6 +244,30 @@ public OpenShiftClusterInner withServicePrincipalProfile(ServicePrincipalProfile return this; } + /** + * Get the platformWorkloadIdentityProfile property: The workload identity profile. + * + * @return the platformWorkloadIdentityProfile value. + */ + public PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().platformWorkloadIdentityProfile(); + } + + /** + * Set the platformWorkloadIdentityProfile property: The workload identity profile. + * + * @param platformWorkloadIdentityProfile the platformWorkloadIdentityProfile value to set. + * @return the OpenShiftClusterInner object itself. + */ + public OpenShiftClusterInner + withPlatformWorkloadIdentityProfile(PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftClusterProperties(); + } + this.innerProperties().withPlatformWorkloadIdentityProfile(platformWorkloadIdentityProfile); + return this; + } + /** * Get the networkProfile property: The cluster network profile. * @@ -341,17 +392,6 @@ public OpenShiftClusterInner withIngressProfiles(List ingressPro return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -361,6 +401,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -393,6 +434,8 @@ public static OpenShiftClusterInner fromJson(JsonReader jsonReader) throws IOExc deserializedOpenShiftClusterInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedOpenShiftClusterInner.innerProperties = OpenShiftClusterProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedOpenShiftClusterInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedOpenShiftClusterInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterProperties.java index 788c641a4259..4ce0850c8f2d 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterProperties.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; @@ -15,6 +15,7 @@ import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.ProvisioningState; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; @@ -46,6 +47,11 @@ public final class OpenShiftClusterProperties implements JsonSerializable ingre return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (clusterProfile() != null) { - clusterProfile().validate(); - } - if (consoleProfile() != null) { - consoleProfile().validate(); - } - if (servicePrincipalProfile() != null) { - servicePrincipalProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (masterProfile() != null) { - masterProfile().validate(); - } - if (workerProfiles() != null) { - workerProfiles().forEach(e -> e.validate()); - } - if (workerProfilesStatus() != null) { - workerProfilesStatus().forEach(e -> e.validate()); - } - if (apiserverProfile() != null) { - apiserverProfile().validate(); - } - if (ingressProfiles() != null) { - ingressProfiles().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -317,6 +309,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("clusterProfile", this.clusterProfile); jsonWriter.writeJsonField("consoleProfile", this.consoleProfile); jsonWriter.writeJsonField("servicePrincipalProfile", this.servicePrincipalProfile); + jsonWriter.writeJsonField("platformWorkloadIdentityProfile", this.platformWorkloadIdentityProfile); jsonWriter.writeJsonField("networkProfile", this.networkProfile); jsonWriter.writeJsonField("masterProfile", this.masterProfile); jsonWriter.writeArrayField("workerProfiles", this.workerProfiles, @@ -352,6 +345,9 @@ public static OpenShiftClusterProperties fromJson(JsonReader jsonReader) throws } else if ("servicePrincipalProfile".equals(fieldName)) { deserializedOpenShiftClusterProperties.servicePrincipalProfile = ServicePrincipalProfile.fromJson(reader); + } else if ("platformWorkloadIdentityProfile".equals(fieldName)) { + deserializedOpenShiftClusterProperties.platformWorkloadIdentityProfile + = PlatformWorkloadIdentityProfile.fromJson(reader); } else if ("networkProfile".equals(fieldName)) { deserializedOpenShiftClusterProperties.networkProfile = NetworkProfile.fromJson(reader); } else if ("masterProfile".equals(fieldName)) { diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionInner.java index b72ec43067e9..ab2610a12475 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionInner.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -15,7 +15,7 @@ /** * OpenShiftVersion represents an OpenShift version that can be installed. */ -@Fluent +@Immutable public final class OpenShiftVersionInner extends ProxyResource { /* * The properties for the OpenShiftVersion resource. @@ -28,9 +28,9 @@ public final class OpenShiftVersionInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -38,14 +38,14 @@ public final class OpenShiftVersionInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of OpenShiftVersionInner class. */ - public OpenShiftVersionInner() { + private OpenShiftVersionInner() { } /** @@ -67,13 +67,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -87,13 +87,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -105,31 +105,6 @@ public String version() { return this.innerProperties() == null ? null : this.innerProperties().version(); } - /** - * Set the version property: Version represents the version to create the cluster at. - * - * @param version the version value to set. - * @return the OpenShiftVersionInner object itself. - */ - public OpenShiftVersionInner withVersion(String version) { - if (this.innerProperties() == null) { - this.innerProperties = new OpenShiftVersionProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionProperties.java index 5469cdd9fcc6..e5cf9fd019ca 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionProperties.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * OpenShiftVersionProperties represents the properties of an OpenShiftVersion. */ -@Fluent +@Immutable public final class OpenShiftVersionProperties implements JsonSerializable { /* * Version represents the version to create the cluster at. @@ -24,7 +24,7 @@ public final class OpenShiftVersionProperties implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation}. @@ -35,7 +35,7 @@ public final class OperationInner implements JsonSerializable { /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -47,17 +47,6 @@ public String name() { return this.name; } - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - /** * Get the display property: The object that describes the operation. * @@ -67,17 +56,6 @@ public Display display() { return this.display; } - /** - * Set the display property: The object that describes the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(Display display) { - this.display = display; - return this; - } - /** * Get the origin property: Sources of requests to this operation. Comma separated list with valid values user or * system, e.g. "user,system". @@ -88,29 +66,6 @@ public String origin() { return this.origin; } - /** - * Set the origin property: Sources of requests to this operation. Comma separated list with valid values user or - * system, e.g. "user,system". - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetInner.java similarity index 51% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderInner.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetInner.java index 90f69af53116..71046beea460 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderInner.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetInner.java @@ -1,26 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.fluent.models; -import com.azure.core.annotation.Fluent; +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.redhatopenshift.models.PlatformWorkloadIdentityRole; import java.io.IOException; +import java.util.List; /** - * SyncIdentityProvider represents a SyncIdentityProvider. + * PlatformWorkloadIdentityRoleSet represents a mapping from the names of OCP operators to the built-in roles that + * should be assigned to those operator's corresponding managed identities for a particular OCP version. */ -@Fluent -public final class SyncIdentityProviderInner extends ProxyResource { +@Immutable +public final class PlatformWorkloadIdentityRoleSetInner extends ProxyResource { /* - * The SyncIdentityProvider Properties + * The properties for the PlatformWorkloadIdentityRoleSet resource. */ - private SyncIdentityProviderProperties innerProperties; + private PlatformWorkloadIdentityRoleSetProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -28,9 +31,9 @@ public final class SyncIdentityProviderInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -38,22 +41,22 @@ public final class SyncIdentityProviderInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** - * Creates an instance of SyncIdentityProviderInner class. + * Creates an instance of PlatformWorkloadIdentityRoleSetInner class. */ - public SyncIdentityProviderInner() { + private PlatformWorkloadIdentityRoleSetInner() { } /** - * Get the innerProperties property: The SyncIdentityProvider Properties. + * Get the innerProperties property: The properties for the PlatformWorkloadIdentityRoleSet resource. * * @return the innerProperties value. */ - private SyncIdentityProviderProperties innerProperties() { + private PlatformWorkloadIdentityRoleSetProperties innerProperties() { return this.innerProperties; } @@ -67,13 +70,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -87,47 +90,32 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public String resources() { - return this.innerProperties() == null ? null : this.innerProperties().resources(); + public String id() { + return this.id; } /** - * Set the resources property: The resources property. + * Get the openShiftVersion property: OpenShiftVersion represents the version associated with this set of roles. * - * @param resources the resources value to set. - * @return the SyncIdentityProviderInner object itself. + * @return the openShiftVersion value. */ - public SyncIdentityProviderInner withResources(String resources) { - if (this.innerProperties() == null) { - this.innerProperties = new SyncIdentityProviderProperties(); - } - this.innerProperties().withResources(resources); - return this; + public String openShiftVersion() { + return this.innerProperties() == null ? null : this.innerProperties().openShiftVersion(); } /** - * Validates the instance. + * Get the platformWorkloadIdentityRoles property: PlatformWorkloadIdentityRoles represents the set of roles + * associated with this version. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the platformWorkloadIdentityRoles value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public List platformWorkloadIdentityRoles() { + return this.innerProperties() == null ? null : this.innerProperties().platformWorkloadIdentityRoles(); } /** @@ -141,38 +129,39 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of SyncIdentityProviderInner from the JsonReader. + * Reads an instance of PlatformWorkloadIdentityRoleSetInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of SyncIdentityProviderInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. + * @return An instance of PlatformWorkloadIdentityRoleSetInner 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 SyncIdentityProviderInner. + * @throws IOException If an error occurs while reading the PlatformWorkloadIdentityRoleSetInner. */ - public static SyncIdentityProviderInner fromJson(JsonReader jsonReader) throws IOException { + public static PlatformWorkloadIdentityRoleSetInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - SyncIdentityProviderInner deserializedSyncIdentityProviderInner = new SyncIdentityProviderInner(); + PlatformWorkloadIdentityRoleSetInner deserializedPlatformWorkloadIdentityRoleSetInner + = new PlatformWorkloadIdentityRoleSetInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedSyncIdentityProviderInner.id = reader.getString(); + deserializedPlatformWorkloadIdentityRoleSetInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedSyncIdentityProviderInner.name = reader.getString(); + deserializedPlatformWorkloadIdentityRoleSetInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedSyncIdentityProviderInner.type = reader.getString(); + deserializedPlatformWorkloadIdentityRoleSetInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedSyncIdentityProviderInner.innerProperties - = SyncIdentityProviderProperties.fromJson(reader); + deserializedPlatformWorkloadIdentityRoleSetInner.innerProperties + = PlatformWorkloadIdentityRoleSetProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedSyncIdentityProviderInner.systemData = SystemData.fromJson(reader); + deserializedPlatformWorkloadIdentityRoleSetInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedSyncIdentityProviderInner; + return deserializedPlatformWorkloadIdentityRoleSetInner; }); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetProperties.java new file mode 100644 index 000000000000..477234d653a6 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.models.PlatformWorkloadIdentityRole; +import java.io.IOException; +import java.util.List; + +/** + * PlatformWorkloadIdentityRoleSetProperties represents the properties of a PlatformWorkloadIdentityRoleSet resource. + */ +@Immutable +public final class PlatformWorkloadIdentityRoleSetProperties + implements JsonSerializable { + /* + * OpenShiftVersion represents the version associated with this set of roles. + */ + private String openShiftVersion; + + /* + * PlatformWorkloadIdentityRoles represents the set of roles associated with this version. + */ + private List platformWorkloadIdentityRoles; + + /** + * Creates an instance of PlatformWorkloadIdentityRoleSetProperties class. + */ + private PlatformWorkloadIdentityRoleSetProperties() { + } + + /** + * Get the openShiftVersion property: OpenShiftVersion represents the version associated with this set of roles. + * + * @return the openShiftVersion value. + */ + public String openShiftVersion() { + return this.openShiftVersion; + } + + /** + * Get the platformWorkloadIdentityRoles property: PlatformWorkloadIdentityRoles represents the set of roles + * associated with this version. + * + * @return the platformWorkloadIdentityRoles value. + */ + public List platformWorkloadIdentityRoles() { + return this.platformWorkloadIdentityRoles; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("openShiftVersion", this.openShiftVersion); + jsonWriter.writeArrayField("platformWorkloadIdentityRoles", this.platformWorkloadIdentityRoles, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformWorkloadIdentityRoleSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformWorkloadIdentityRoleSetProperties 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 PlatformWorkloadIdentityRoleSetProperties. + */ + public static PlatformWorkloadIdentityRoleSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformWorkloadIdentityRoleSetProperties deserializedPlatformWorkloadIdentityRoleSetProperties + = new PlatformWorkloadIdentityRoleSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("openShiftVersion".equals(fieldName)) { + deserializedPlatformWorkloadIdentityRoleSetProperties.openShiftVersion = reader.getString(); + } else if ("platformWorkloadIdentityRoles".equals(fieldName)) { + List platformWorkloadIdentityRoles + = reader.readArray(reader1 -> PlatformWorkloadIdentityRole.fromJson(reader1)); + deserializedPlatformWorkloadIdentityRoleSetProperties.platformWorkloadIdentityRoles + = platformWorkloadIdentityRoles; + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformWorkloadIdentityRoleSetProperties; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretInner.java deleted file mode 100644 index 734405bd0c41..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretInner.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 java.io.IOException; - -/** - * Secret represents a secret. - */ -@Fluent -public final class SecretInner extends ProxyResource { - /* - * The Secret Properties - */ - private SecretProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /* - * The name of the resource. - */ - private String name; - - /* - * The type of the resource. - */ - private String type; - - /** - * Creates an instance of SecretInner class. - */ - public SecretInner() { - } - - /** - * Get the innerProperties property: The Secret Properties. - * - * @return the innerProperties value. - */ - private SecretProperties innerProperties() { - return this.innerProperties; - } - - /** - * 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 id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the secretResources property: The Secrets Resources. - * - * @return the secretResources value. - */ - public String secretResources() { - return this.innerProperties() == null ? null : this.innerProperties().secretResources(); - } - - /** - * Set the secretResources property: The Secrets Resources. - * - * @param secretResources the secretResources value to set. - * @return the SecretInner object itself. - */ - public SecretInner withSecretResources(String secretResources) { - if (this.innerProperties() == null) { - this.innerProperties = new SecretProperties(); - } - this.innerProperties().withSecretResources(secretResources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecretInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecretInner 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 SecretInner. - */ - public static SecretInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecretInner deserializedSecretInner = new SecretInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecretInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecretInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecretInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecretInner.innerProperties = SecretProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecretInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecretInner; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretProperties.java deleted file mode 100644 index d231f41aeadf..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SecretProperties.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.fluent.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; - -/** - * SecretProperties represents the properties of a Secret. - */ -@Fluent -public final class SecretProperties implements JsonSerializable { - /* - * The Secrets Resources. - */ - private String secretResources; - - /** - * Creates an instance of SecretProperties class. - */ - public SecretProperties() { - } - - /** - * Get the secretResources property: The Secrets Resources. - * - * @return the secretResources value. - */ - public String secretResources() { - return this.secretResources; - } - - /** - * Set the secretResources property: The Secrets Resources. - * - * @param secretResources the secretResources value to set. - * @return the SecretProperties object itself. - */ - public SecretProperties withSecretResources(String secretResources) { - this.secretResources = secretResources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("secretResources", this.secretResources); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecretProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecretProperties 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 SecretProperties. - */ - public static SecretProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecretProperties deserializedSecretProperties = new SecretProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("secretResources".equals(fieldName)) { - deserializedSecretProperties.secretResources = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecretProperties; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderProperties.java deleted file mode 100644 index 3c5cb1346806..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncIdentityProviderProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.fluent.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; - -/** - * SyncSetProperties represents the properties of a SyncSet. - */ -@Fluent -public final class SyncIdentityProviderProperties implements JsonSerializable { - /* - * The resources property. - */ - private String resources; - - /** - * Creates an instance of SyncIdentityProviderProperties class. - */ - public SyncIdentityProviderProperties() { - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public String resources() { - return this.resources; - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the SyncIdentityProviderProperties object itself. - */ - public SyncIdentityProviderProperties withResources(String resources) { - this.resources = resources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resources", this.resources); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SyncIdentityProviderProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncIdentityProviderProperties 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 SyncIdentityProviderProperties. - */ - public static SyncIdentityProviderProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncIdentityProviderProperties deserializedSyncIdentityProviderProperties - = new SyncIdentityProviderProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resources".equals(fieldName)) { - deserializedSyncIdentityProviderProperties.resources = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncIdentityProviderProperties; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetInner.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetInner.java deleted file mode 100644 index 01677bcfae9b..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetInner.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 java.io.IOException; - -/** - * SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ -@Fluent -public final class SyncSetInner extends ProxyResource { - /* - * The Syncsets properties - */ - private SyncSetProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /* - * The name of the resource. - */ - private String name; - - /* - * The type of the resource. - */ - private String type; - - /** - * Creates an instance of SyncSetInner class. - */ - public SyncSetInner() { - } - - /** - * Get the innerProperties property: The Syncsets properties. - * - * @return the innerProperties value. - */ - private SyncSetProperties innerProperties() { - return this.innerProperties; - } - - /** - * 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 id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the resources property: Resources represents the SyncSets configuration. - * - * @return the resources value. - */ - public String resources() { - return this.innerProperties() == null ? null : this.innerProperties().resources(); - } - - /** - * Set the resources property: Resources represents the SyncSets configuration. - * - * @param resources the resources value to set. - * @return the SyncSetInner object itself. - */ - public SyncSetInner withResources(String resources) { - if (this.innerProperties() == null) { - this.innerProperties = new SyncSetProperties(); - } - this.innerProperties().withResources(resources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SyncSetInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncSetInner 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 SyncSetInner. - */ - public static SyncSetInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncSetInner deserializedSyncSetInner = new SyncSetInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSyncSetInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSyncSetInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSyncSetInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSyncSetInner.innerProperties = SyncSetProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSyncSetInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncSetInner; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetProperties.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetProperties.java deleted file mode 100644 index eea844f8c996..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/SyncSetProperties.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.fluent.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; - -/** - * SyncSetProperties represents the properties of a SyncSet. - */ -@Fluent -public final class SyncSetProperties implements JsonSerializable { - /* - * Resources represents the SyncSets configuration. - */ - private String resources; - - /** - * Creates an instance of SyncSetProperties class. - */ - public SyncSetProperties() { - } - - /** - * Get the resources property: Resources represents the SyncSets configuration. - * - * @return the resources value. - */ - public String resources() { - return this.resources; - } - - /** - * Set the resources property: Resources represents the SyncSets configuration. - * - * @param resources the resources value to set. - * @return the SyncSetProperties object itself. - */ - public SyncSetProperties withResources(String resources) { - this.resources = resources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resources", this.resources); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SyncSetProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncSetProperties 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 SyncSetProperties. - */ - public static SyncSetProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncSetProperties deserializedSyncSetProperties = new SyncSetProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resources".equals(fieldName)) { - deserializedSyncSetProperties.resources = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncSetProperties; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/package-info.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/package-info.java index 49e8e4952273..8e2aa007459e 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/package-info.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for AzureRedHatOpenShiftClient. + * Package containing the inner data models for RedHatOpenShift. * Rest API for Azure Red Hat OpenShift 4. */ package com.azure.resourcemanager.redhatopenshift.fluent.models; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/package-info.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/package-info.java index 6d8f04725466..db3dd99e1366 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/package-info.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for AzureRedHatOpenShiftClient. + * Package containing the service clients for RedHatOpenShift. * Rest API for Azure Red Hat OpenShift 4. */ package com.azure.resourcemanager.redhatopenshift.fluent; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolImpl.java deleted file mode 100644 index 96b6b3dc4bd7..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; -import com.azure.resourcemanager.redhatopenshift.models.MachinePoolUpdate; - -public final class MachinePoolImpl implements MachinePool, MachinePool.Definition, MachinePool.Update { - private MachinePoolInner innerObject; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resources() { - return this.innerModel().resources(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public MachinePoolInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String childResourceName; - - private MachinePoolUpdate updateParameters; - - public MachinePoolImpl withExistingOpenshiftcluster(String resourceGroupName, String resourceName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - return this; - } - - public MachinePool create() { - this.innerObject = serviceManager.serviceClient() - .getMachinePools() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public MachinePool create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getMachinePools() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), context) - .getValue(); - return this; - } - - MachinePoolImpl(String name, com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = new MachinePoolInner(); - this.serviceManager = serviceManager; - this.childResourceName = name; - } - - public MachinePoolImpl update() { - this.updateParameters = new MachinePoolUpdate(); - return this; - } - - public MachinePool apply() { - this.innerObject = serviceManager.serviceClient() - .getMachinePools() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, Context.NONE) - .getValue(); - return this; - } - - public MachinePool apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getMachinePools() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, context) - .getValue(); - return this; - } - - MachinePoolImpl(MachinePoolInner innerObject, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "openshiftclusters"); - this.childResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "machinePool"); - } - - public MachinePool refresh() { - this.innerObject = serviceManager.serviceClient() - .getMachinePools() - .getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE) - .getValue(); - return this; - } - - public MachinePool refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getMachinePools() - .getWithResponse(resourceGroupName, resourceName, childResourceName, context) - .getValue(); - return this; - } - - public MachinePoolImpl withResources(String resources) { - if (isInCreateMode()) { - this.innerModel().withResources(resources); - return this; - } else { - this.updateParameters.withResources(resources); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsClientImpl.java deleted file mode 100644 index e29614d6e420..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsClientImpl.java +++ /dev/null @@ -1,942 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.redhatopenshift.fluent.MachinePoolsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; -import com.azure.resourcemanager.redhatopenshift.models.MachinePoolList; -import com.azure.resourcemanager.redhatopenshift.models.MachinePoolUpdate; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in MachinePoolsClient. - */ -public final class MachinePoolsClientImpl implements MachinePoolsClient { - /** - * The proxy service used to perform REST calls. - */ - private final MachinePoolsService service; - - /** - * The service client containing this operation class. - */ - private final AzureRedHatOpenShiftClientImpl client; - - /** - * Initializes an instance of MachinePoolsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MachinePoolsClientImpl(AzureRedHatOpenShiftClientImpl client) { - this.service - = RestProxy.create(MachinePoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureRedHatOpenShiftClientMachinePools to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") - public interface MachinePoolsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/machinePools") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") MachinePoolInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") MachinePoolUpdate parameters, @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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); - } - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachinePoolInner get(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE).getValue(); - } - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, MachinePoolInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, MachinePoolInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context); - } - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context) - .block(); - } - - /** - * Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachinePoolInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - MachinePoolInner parameters) { - return createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, Context.NONE) - .getValue(); - } - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String childResourceName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, parameters, accept, context); - } - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, String childResourceName, - MachinePoolUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, MachinePoolUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context).block(); - } - - /** - * Updates a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param parameters The MachinePool resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachinePoolInner update(String resourceGroupName, String resourceName, String childResourceName, - MachinePoolUpdate parameters) { - return updateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, 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 machinePoolList represents a list of MachinePools along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - 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. - * @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 machinePoolList represents a list of MachinePools along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsImpl.java deleted file mode 100644 index d27d56e98965..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/MachinePoolsImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.MachinePoolsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; -import com.azure.resourcemanager.redhatopenshift.models.MachinePools; - -public final class MachinePoolsImpl implements MachinePools { - private static final ClientLogger LOGGER = new ClientLogger(MachinePoolsImpl.class); - - private final MachinePoolsClient innerClient; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public MachinePoolsImpl(MachinePoolsClient innerClient, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MachinePoolImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MachinePoolImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, childResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MachinePoolImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MachinePool get(String resourceGroupName, String resourceName, String childResourceName) { - MachinePoolInner inner = this.serviceClient().get(resourceGroupName, resourceName, childResourceName); - if (inner != null) { - return new MachinePoolImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - this.serviceClient().delete(resourceGroupName, resourceName, childResourceName); - } - - public MachinePool 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "machinePool"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'machinePool'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "machinePool"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'machinePool'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "machinePool"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'machinePool'.", id))); - } - this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - public Response 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "machinePool"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'machinePool'.", id))); - } - return this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - private MachinePoolsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - public MachinePoolImpl define(String name) { - return new MachinePoolImpl(name, this.manager()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterAdminKubeconfigImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterAdminKubeconfigImpl.java index 9ee1529b870f..6a1b07b4ceab 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterAdminKubeconfigImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterAdminKubeconfigImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterCredentialsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterCredentialsImpl.java index 27b3ff48154f..de21cd62663e 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterCredentialsImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterCredentialsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterImpl.java index 9ce59684e085..b30e511b8539 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -13,12 +13,14 @@ import com.azure.resourcemanager.redhatopenshift.models.ClusterProfile; import com.azure.resourcemanager.redhatopenshift.models.ConsoleProfile; import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftCluster; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterAdminKubeconfig; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterCredentials; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterUpdate; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.ProvisioningState; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; @@ -57,6 +59,10 @@ public Map tags() { } } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -77,6 +83,10 @@ public ServicePrincipalProfile servicePrincipalProfile() { return this.innerModel().servicePrincipalProfile(); } + public PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile() { + return this.innerModel().platformWorkloadIdentityProfile(); + } + public NetworkProfile networkProfile() { return this.innerModel().networkProfile(); } @@ -247,6 +257,16 @@ public OpenShiftClusterImpl withTags(Map tags) { } } + public OpenShiftClusterImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + public OpenShiftClusterImpl withProvisioningState(ProvisioningState provisioningState) { if (isInCreateMode()) { this.innerModel().withProvisioningState(provisioningState); @@ -287,6 +307,17 @@ public OpenShiftClusterImpl withServicePrincipalProfile(ServicePrincipalProfile } } + public OpenShiftClusterImpl + withPlatformWorkloadIdentityProfile(PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile) { + if (isInCreateMode()) { + this.innerModel().withPlatformWorkloadIdentityProfile(platformWorkloadIdentityProfile); + return this; + } else { + this.updateParameters.withPlatformWorkloadIdentityProfile(platformWorkloadIdentityProfile); + return this; + } + } + public OpenShiftClusterImpl withNetworkProfile(NetworkProfile networkProfile) { if (isInCreateMode()) { this.innerModel().withNetworkProfile(networkProfile); @@ -338,6 +369,6 @@ public OpenShiftClusterImpl withIngressProfiles(List ingressProf } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersClientImpl.java index ea47e5bebc65..edd24c8e1cf1 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersClientImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -29,6 +29,7 @@ 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; @@ -37,7 +38,7 @@ import com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterAdminKubeconfigInner; import com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterCredentialsInner; import com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterInner; -import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterList; +import com.azure.resourcemanager.redhatopenshift.implementation.models.OpenShiftClusterList; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -55,86 +56,147 @@ public final class OpenShiftClustersClientImpl implements OpenShiftClustersClien /** * The service client containing this operation class. */ - private final AzureRedHatOpenShiftClientImpl client; + private final RedHatOpenShiftManagementClientImpl client; /** * Initializes an instance of OpenShiftClustersClientImpl. * * @param client the instance of the service client containing this operation class. */ - OpenShiftClustersClientImpl(AzureRedHatOpenShiftClientImpl client) { + OpenShiftClustersClientImpl(RedHatOpenShiftManagementClientImpl client) { this.service = RestProxy.create(OpenShiftClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureRedHatOpenShiftClientOpenShiftClusters to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for RedHatOpenShiftManagementClientOpenShiftClusters to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftManagementClientOpenShiftClusters") public interface OpenShiftClustersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/openShiftClusters") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OpenShiftClusterInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OpenShiftClusterInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OpenShiftClusterUpdate parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OpenShiftClusterUpdate parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") + @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("resourceName") String resourceName, - @BodyParam("application/json") OpenShiftClusterInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters") + @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/openShiftClusters") + @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/openShiftClusters") + @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" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/openShiftClusters") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + 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/openShiftClusters/{resourceName}/listAdminCredentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAdminCredentials( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") OpenShiftClusterUpdate parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listAdminCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAdminCredentials(@HostParam("$host") String endpoint, + Response listAdminCredentialsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @@ -143,424 +205,334 @@ Mono> listAdminCredentials(@HostP @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listCredentials(@HostParam("$host") String endpoint, + Mono> listCredentials(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Response listCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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); } /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String resourceName) { 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)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists OpenShift clusters in the specified subscription. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. - * - * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedFlux}. + * The operation returns properties of a OpenShift cluster on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists OpenShift clusters in the specified subscription. - * - * The operation returns properties of each OpenShift cluster. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. * - * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * The operation returns properties of a OpenShift cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); } /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, OpenShiftClusterInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists OpenShift clusters in the specified subscription and resource group. - * - * The operation returns properties of each OpenShift cluster. - * - * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + Context.NONE); } /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists OpenShift clusters in the specified subscription and resource group. - * - * The operation returns properties of each OpenShift cluster. - * - * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters, 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, resourceName, contentType, accept, parameters, context); } /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OpenShiftClusterInner> + beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, OpenShiftClusterInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OpenShiftClusterInner.class, OpenShiftClusterInner.class, + this.client.getContext()); } /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OpenShiftClusterInner> + beginCreateOrUpdate(String resourceGroupName, String resourceName, OpenShiftClusterInner parameters) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, + OpenShiftClusterInner.class, OpenShiftClusterInner.class, Context.NONE); } /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OpenShiftClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, OpenShiftClusterInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, + OpenShiftClusterInner.class, OpenShiftClusterInner.class, context); } /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return openShiftCluster represents an Azure Red Hat OpenShift cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. + * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + public OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, parameters).getFinalResult(); } /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. * * The operation returns properties of a OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param parameters The OpenShift cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + public OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, + OpenShiftClusterInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, parameters, context).getFinalResult(); } /** @@ -578,32 +550,12 @@ public OpenShiftClusterInner getByResourceGroup(String resourceGroupName, String * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, OpenShiftClusterInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, + OpenShiftClusterUpdate parameters) { + 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, resourceName, parameters, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -615,40 +567,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. * @param parameters The OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response} on successful - * completion of {@link Mono}. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, OpenShiftClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response updateWithResponse(String resourceGroupName, String resourceName, + OpenShiftClusterUpdate parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + Context.NONE); } /** @@ -659,19 +590,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. * @param parameters The OpenShift cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OpenShiftClusterInner> - beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, OpenShiftClusterInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OpenShiftClusterInner.class, OpenShiftClusterInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String resourceName, + OpenShiftClusterUpdate parameters, 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, resourceName, contentType, accept, parameters, context); } /** @@ -682,20 +613,18 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. * @param parameters The OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OpenShiftClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftClusterInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); + private PollerFlux, OpenShiftClusterInner> + beginUpdateAsync(String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, parameters); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OpenShiftClusterInner.class, OpenShiftClusterInner.class, context); + this.client.getHttpPipeline(), OpenShiftClusterInner.class, OpenShiftClusterInner.class, + this.client.getContext()); } /** @@ -712,9 +641,11 @@ private PollerFlux, OpenShiftClusterInner> beg * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OpenShiftClusterInner> - beginCreateOrUpdate(String resourceGroupName, String resourceName, OpenShiftClusterInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + public SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, + String resourceName, OpenShiftClusterUpdate parameters) { + Response response = updateWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, + OpenShiftClusterInner.class, OpenShiftClusterInner.class, Context.NONE); } /** @@ -732,29 +663,11 @@ private PollerFlux, OpenShiftClusterInner> beg * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OpenShiftClusterInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, OpenShiftClusterInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a OpenShift cluster with the specified subscription, resource group and resource name. - * - * The operation returns properties of a OpenShift cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - OpenShiftClusterInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, + String resourceName, OpenShiftClusterUpdate parameters, Context context) { + Response response = updateWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, + OpenShiftClusterInner.class, OpenShiftClusterInner.class, context); } /** @@ -765,16 +678,15 @@ private Mono createOrUpdateAsync(String resourceGroupName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. * @param parameters The OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return openShiftCluster represents an Azure Red Hat OpenShift cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - OpenShiftClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).last() + private Mono updateAsync(String resourceGroupName, String resourceName, + OpenShiftClusterUpdate parameters) { + return beginUpdateAsync(resourceGroupName, resourceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -792,9 +704,9 @@ private Mono createOrUpdateAsync(String resourceGroupName * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, - OpenShiftClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + public OpenShiftClusterInner update(String resourceGroupName, String resourceName, + OpenShiftClusterUpdate parameters) { + return beginUpdate(resourceGroupName, resourceName, parameters).getFinalResult(); } /** @@ -812,9 +724,9 @@ public OpenShiftClusterInner createOrUpdate(String resourceGroupName, String res * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftClusterInner createOrUpdate(String resourceGroupName, String resourceName, - OpenShiftClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); + public OpenShiftClusterInner update(String resourceGroupName, String resourceName, + OpenShiftClusterUpdate parameters, Context context) { + return beginUpdate(resourceGroupName, resourceName, parameters, context).getFinalResult(); } /** @@ -831,25 +743,9 @@ public OpenShiftClusterInner createOrUpdate(String resourceGroupName, String res */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -860,34 +756,15 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String resourceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); } /** @@ -897,16 +774,16 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); } /** @@ -916,19 +793,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -945,7 +819,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - return this.beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -964,7 +839,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -991,16 +867,13 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String resourceName) { + beginDelete(resourceGroupName, resourceName).getFinalResult(); } /** @@ -1010,283 +883,240 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, Co * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the OpenShift cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName) { - deleteAsync(resourceGroupName, resourceName).block(); + public void delete(String resourceGroupName, String resourceName, Context context) { + beginDelete(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * Lists OpenShift clusters in the specified subscription and resource group. + * + * The operation returns properties of each OpenShift cluster. + * + * @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 openShiftClusterList represents a list of OpenShift clusters 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())); } /** - * Deletes a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns nothing. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response} on successful - * completion of {@link Mono}. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - OpenShiftClusterUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + 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); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response} on successful - * completion of {@link Mono}. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - OpenShiftClusterUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, parameters, accept, context); + 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); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OpenShiftClusterInner> - beginUpdateAsync(String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OpenShiftClusterInner.class, OpenShiftClusterInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OpenShiftClusterInner> beginUpdateAsync( - String resourceGroupName, String resourceName, OpenShiftClusterUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OpenShiftClusterInner.class, OpenShiftClusterInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, - String resourceName, OpenShiftClusterUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + @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())); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OpenShiftClusterInner> beginUpdate(String resourceGroupName, - String resourceName, OpenShiftClusterUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster on successful completion of {@link Mono}. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - OpenShiftClusterUpdate parameters) { - return beginUpdateAsync(resourceGroupName, resourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + 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); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster on successful completion of {@link Mono}. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - OpenShiftClusterUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, resourceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + 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); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftClusterInner update(String resourceGroupName, String resourceName, - OpenShiftClusterUpdate parameters) { - return updateAsync(resourceGroupName, resourceName, parameters).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param parameters The OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OpenShiftClusterInner update(String resourceGroupName, String resourceName, - OpenShiftClusterUpdate parameters, Context context) { - return updateAsync(resourceGroupName, resourceName, parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1305,21 +1135,6 @@ public OpenShiftClusterInner update(String resourceGroupName, String resourceNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAdminCredentialsWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1327,44 +1142,6 @@ public OpenShiftClusterInner update(String resourceGroupName, String resourceNam .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group and resource name. - * - * The operation returns the admin kubeconfig. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterAdminKubeconfig represents an OpenShift cluster's admin kubeconfig along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAdminCredentialsWithResponseAsync(String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - /** * Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group and resource name. * @@ -1402,7 +1179,9 @@ private Mono listAdminCredentialsAsync(Str @ServiceMethod(returns = ReturnType.SINGLE) public Response listAdminCredentialsWithResponse(String resourceGroupName, String resourceName, Context context) { - return listAdminCredentialsWithResponseAsync(resourceGroupName, resourceName, context).block(); + final String accept = "application/json"; + return service.listAdminCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); } /** @@ -1438,21 +1217,6 @@ public OpenShiftClusterAdminKubeconfigInner listAdminCredentials(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listCredentialsWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1460,44 +1224,6 @@ private Mono> listCredentialsWithResp .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists credentials of an OpenShift cluster with the specified subscription, resource group and resource name. - * - * The operation returns the credentials. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterCredentials represents an OpenShift cluster's credentials along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCredentialsWithResponseAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - /** * Lists credentials of an OpenShift cluster with the specified subscription, resource group and resource name. * @@ -1533,7 +1259,9 @@ private Mono listCredentialsAsync(String resou @ServiceMethod(returns = ReturnType.SINGLE) public Response listCredentialsWithResponse(String resourceGroupName, String resourceName, Context context) { - return listCredentialsWithResponseAsync(resourceGroupName, resourceName, context).block(); + final String accept = "application/json"; + return service.listCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); } /** @@ -1554,6 +1282,8 @@ public OpenShiftClusterCredentialsInner listCredentials(String resourceGroupName } /** + * Lists OpenShift clusters in the specified subscription and resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1564,22 +1294,39 @@ public OpenShiftClusterCredentialsInner listCredentials(String resourceGroupName * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + 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())); } /** + * Lists OpenShift clusters in the specified subscription and resource group. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openShiftClusterList represents a list of OpenShift clusters 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); + } + + /** + * Lists OpenShift clusters in the specified subscription and resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1587,26 +1334,20 @@ private Mono> listNextSinglePageAsync(Strin * @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 openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** + * Lists OpenShift clusters in the specified subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1617,24 +1358,37 @@ private Mono> listNextSinglePageAsync(Strin * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * Lists OpenShift clusters in the specified subscription. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openShiftClusterList represents a list of OpenShift clusters 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); + } + + /** + * Lists OpenShift clusters in the specified subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1642,23 +1396,13 @@ private Mono> listByResourceGroupNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return openShiftClusterList represents a list of OpenShift clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.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/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersImpl.java index 851e0cf20a07..3996969677a1 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -31,37 +31,12 @@ public OpenShiftClustersImpl(OpenShiftClustersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OpenShiftClusterImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OpenShiftClusterImpl(inner.getValue(), this.manager())); } public OpenShiftCluster getByResourceGroup(String resourceGroupName, String resourceName) { @@ -81,16 +56,33 @@ public void delete(String resourceGroupName, String resourceName, Context contex this.serviceClient().delete(resourceGroupName, resourceName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftClusterImpl(inner1, this.manager())); + } + public Response listAdminCredentialsWithResponse(String resourceGroupName, String resourceName, Context context) { Response inner = this.serviceClient().listAdminCredentialsWithResponse(resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OpenShiftClusterAdminKubeconfigImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OpenShiftClusterAdminKubeconfigImpl(inner.getValue(), this.manager())); } public OpenShiftClusterAdminKubeconfig listAdminCredentials(String resourceGroupName, String resourceName) { @@ -107,12 +99,8 @@ public Response listCredentialsWithResponse(String String resourceName, Context context) { Response inner = this.serviceClient().listCredentialsWithResponse(resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OpenShiftClusterCredentialsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OpenShiftClusterCredentialsImpl(inner.getValue(), this.manager())); } public OpenShiftClusterCredentials listCredentials(String resourceGroupName, String resourceName) { diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionImpl.java index 72a18bbdb925..dc90c4e32ed8 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsClientImpl.java index 84622d0f4d0a..1424f95a8694 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsClientImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftVersionsClient; import com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftVersionInner; -import com.azure.resourcemanager.redhatopenshift.models.OpenShiftVersionList; +import com.azure.resourcemanager.redhatopenshift.implementation.models.OpenShiftVersionList; import reactor.core.publisher.Mono; /** @@ -42,31 +42,57 @@ public final class OpenShiftVersionsClientImpl implements OpenShiftVersionsClien /** * The service client containing this operation class. */ - private final AzureRedHatOpenShiftClientImpl client; + private final RedHatOpenShiftManagementClientImpl client; /** * Initializes an instance of OpenShiftVersionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OpenShiftVersionsClientImpl(AzureRedHatOpenShiftClientImpl client) { + OpenShiftVersionsClientImpl(RedHatOpenShiftManagementClientImpl client) { this.service = RestProxy.create(OpenShiftVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureRedHatOpenShiftClientOpenShiftVersions to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for RedHatOpenShiftManagementClientOpenShiftVersions to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftManagementClientOpenShiftVersions") public interface OpenShiftVersionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/openshiftversions") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/openShiftVersions/{openShiftVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("openShiftVersion") String openShiftVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/openShiftVersions/{openShiftVersion}") + @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("openShiftVersion") String openShiftVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/openShiftVersions") + @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}/openShiftVersions") + @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); @@ -75,84 +101,129 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all OpenShift versions available to install in the specified location. + * Gets an available OpenShift version to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * This operation returns installable OpenShift version as a string. * - * @param location The name of Azure region. + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftVersionList represents a List of available versions along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String location, String openShiftVersion) { 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, openShiftVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all OpenShift versions available to install in the specified location. + * Gets an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + * + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String openShiftVersion) { + return getWithResponseAsync(location, openShiftVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an available OpenShift version to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * This operation returns installable OpenShift version as a string. * - * @param location The name of Azure region. + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String openShiftVersion, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, openShiftVersion, accept, context); + } + + /** + * Gets an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + * + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftVersionInner get(String location, String openShiftVersion) { + return getWithResponse(location, openShiftVersion, Context.NONE).getValue(); + } + + /** + * Lists all OpenShift versions available to install in the specified location. + * + * The operation returns the installable OpenShift versions as a string. + * + * @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 openShiftVersionList represents a List of available versions along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + private Mono> listSinglePageAsync(String location) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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())); } /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. @@ -167,28 +238,50 @@ private PagedFlux listAsync(String location) { /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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 openShiftVersionList represents a List of available versions 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); + } + + /** + * Lists all OpenShift versions available to install in the specified location. + * + * The operation returns the installable OpenShift versions as a string. + * + * @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 openShiftVersionList represents a List of available versions as paginated response with - * {@link PagedFlux}. + * @return openShiftVersionList represents a List of available versions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @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); } /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. @@ -197,15 +290,15 @@ private PagedFlux listAsync(String location, Context cont */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); } /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. @@ -215,10 +308,13 @@ public PagedIterable list(String location) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** + * Lists all OpenShift versions available to install in the specified location. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -230,13 +326,6 @@ public PagedIterable list(String location, Context contex */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -245,6 +334,28 @@ private Mono> listNextSinglePageAsync(Strin } /** + * Lists all OpenShift versions available to install in the specified location. + * + * 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 openShiftVersionList represents a List of available versions 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); + } + + /** + * Lists all OpenShift versions available to install in the specified location. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -252,22 +363,13 @@ private Mono> listNextSinglePageAsync(Strin * @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 openShiftVersionList represents a List of available versions along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return openShiftVersionList represents a List of available versions along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsImpl.java index d48225b05b2c..a735eb80065d 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsImpl.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.OpenShiftVersionsClient; @@ -25,6 +27,22 @@ public OpenShiftVersionsImpl(OpenShiftVersionsClient innerClient, this.serviceManager = serviceManager; } + public Response getWithResponse(String location, String openShiftVersion, Context context) { + Response inner + = this.serviceClient().getWithResponse(location, openShiftVersion, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OpenShiftVersionImpl(inner.getValue(), this.manager())); + } + + public OpenShiftVersion get(String location, String openShiftVersion) { + OpenShiftVersionInner inner = this.serviceClient().get(location, openShiftVersion); + if (inner != null) { + return new OpenShiftVersionImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list(String location) { PagedIterable inner = this.serviceClient().list(location); return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenShiftVersionImpl(inner1, this.manager())); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationImpl.java index 23c7e8818a76..609a4688c00a 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsClientImpl.java index ca028ca507b2..8fd0672ada37 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsClientImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.redhatopenshift.fluent.OperationsClient; import com.azure.resourcemanager.redhatopenshift.fluent.models.OperationInner; -import com.azure.resourcemanager.redhatopenshift.models.OperationList; +import com.azure.resourcemanager.redhatopenshift.implementation.models.OperationList; import reactor.core.publisher.Mono; /** @@ -42,31 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final AzureRedHatOpenShiftClientImpl client; + private final RedHatOpenShiftManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(AzureRedHatOpenShiftClientImpl client) { + OperationsClientImpl(RedHatOpenShiftManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureRedHatOpenShiftClientOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for RedHatOpenShiftManagementClientOperations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.RedHatOpenShift/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.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" }) @@ -74,13 +81,18 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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. @@ -89,10 +101,6 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -103,65 +111,53 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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 operationList represents an RP operation list along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return operationList represents an RP operation list as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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 operationList represents an RP operation list as paginated response with {@link PagedFlux}. + * @return operationList represents an RP operation list along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @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); } /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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 operationList represents an RP operation list as paginated response with {@link PagedFlux}. + * @return operationList represents an RP operation list along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @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); } /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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. @@ -169,13 +165,11 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -185,7 +179,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -200,13 +194,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } 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(), @@ -214,6 +201,23 @@ private Mono> listNextSinglePageAsync(String nextL .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 operationList represents an RP operation list 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. * @@ -222,22 +226,13 @@ private Mono> listNextSinglePageAsync(String nextL * @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 operationList represents an RP operation list along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return operationList represents an RP operation list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsImpl.java index 3ccd0803f83c..d2f19bda7b1a 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetImpl.java new file mode 100644 index 000000000000..789a6e817c03 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRole; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSet; +import java.util.Collections; +import java.util.List; + +public final class PlatformWorkloadIdentityRoleSetImpl implements PlatformWorkloadIdentityRoleSet { + private PlatformWorkloadIdentityRoleSetInner innerObject; + + private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; + + PlatformWorkloadIdentityRoleSetImpl(PlatformWorkloadIdentityRoleSetInner innerObject, + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String openShiftVersion() { + return this.innerModel().openShiftVersion(); + } + + public List platformWorkloadIdentityRoles() { + List inner = this.innerModel().platformWorkloadIdentityRoles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PlatformWorkloadIdentityRoleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsClientImpl.java new file mode 100644 index 000000000000..20260241cc23 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsClientImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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.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.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetOperationsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * PlatformWorkloadIdentityRoleSetOperationsClient. + */ +public final class PlatformWorkloadIdentityRoleSetOperationsClientImpl + implements PlatformWorkloadIdentityRoleSetOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PlatformWorkloadIdentityRoleSetOperationsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftManagementClientImpl client; + + /** + * Initializes an instance of PlatformWorkloadIdentityRoleSetOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PlatformWorkloadIdentityRoleSetOperationsClientImpl(RedHatOpenShiftManagementClientImpl client) { + this.service = RestProxy.create(PlatformWorkloadIdentityRoleSetOperationsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RedHatOpenShiftManagementClientPlatformWorkloadIdentityRoleSetOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftManagementClientPlatformWorkloadIdentityRoleSetOperations") + public interface PlatformWorkloadIdentityRoleSetOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/platformWorkloadIdentityRoleSets/{openShiftMinorVersion}") + @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("openShiftMinorVersion") String openShiftMinorVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/platformWorkloadIdentityRoleSets/{openShiftMinorVersion}") + @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("openShiftMinorVersion") String openShiftMinorVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, + String openShiftMinorVersion) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, openShiftMinorVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String openShiftMinorVersion) { + return getWithResponseAsync(location, openShiftMinorVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String openShiftMinorVersion, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, openShiftMinorVersion, accept, context); + } + + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PlatformWorkloadIdentityRoleSetInner get(String location, String openShiftMinorVersion) { + return getWithResponse(location, openShiftMinorVersion, Context.NONE).getValue(); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsImpl.java new file mode 100644 index 000000000000..ab5a51770e9d --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.implementation; + +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.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetOperationsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSet; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSetOperations; + +public final class PlatformWorkloadIdentityRoleSetOperationsImpl implements PlatformWorkloadIdentityRoleSetOperations { + private static final ClientLogger LOGGER = new ClientLogger(PlatformWorkloadIdentityRoleSetOperationsImpl.class); + + private final PlatformWorkloadIdentityRoleSetOperationsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; + + public PlatformWorkloadIdentityRoleSetOperationsImpl(PlatformWorkloadIdentityRoleSetOperationsClient innerClient, + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String openShiftMinorVersion, + Context context) { + Response inner + = this.serviceClient().getWithResponse(location, openShiftMinorVersion, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PlatformWorkloadIdentityRoleSetImpl(inner.getValue(), this.manager())); + } + + public PlatformWorkloadIdentityRoleSet get(String location, String openShiftMinorVersion) { + PlatformWorkloadIdentityRoleSetInner inner = this.serviceClient().get(location, openShiftMinorVersion); + if (inner != null) { + return new PlatformWorkloadIdentityRoleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + private PlatformWorkloadIdentityRoleSetOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsClientImpl.java new file mode 100644 index 000000000000..7c9c81639770 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsClientImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshift.implementation.models.PlatformWorkloadIdentityRoleSetList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PlatformWorkloadIdentityRoleSetsClient. + */ +public final class PlatformWorkloadIdentityRoleSetsClientImpl implements PlatformWorkloadIdentityRoleSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PlatformWorkloadIdentityRoleSetsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftManagementClientImpl client; + + /** + * Initializes an instance of PlatformWorkloadIdentityRoleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PlatformWorkloadIdentityRoleSetsClientImpl(RedHatOpenShiftManagementClientImpl client) { + this.service = RestProxy.create(PlatformWorkloadIdentityRoleSetsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedHatOpenShiftManagementClientPlatformWorkloadIdentityRoleSets to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftManagementClientPlatformWorkloadIdentityRoleSets") + public interface PlatformWorkloadIdentityRoleSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/platformWorkloadIdentityRoleSets") + @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}/platformWorkloadIdentityRoleSets") + @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); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets 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())); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets 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); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets 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); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets 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)); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * 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 platformWorkloadIdentityRoleSetList represents a List of role sets 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())); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * 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 platformWorkloadIdentityRoleSetList represents a List of role sets 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); + } + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * 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 platformWorkloadIdentityRoleSetList represents a List of role sets 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/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsImpl.java new file mode 100644 index 000000000000..6d9e62873917 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsImpl.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.redhatopenshift.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.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSet; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSets; + +public final class PlatformWorkloadIdentityRoleSetsImpl implements PlatformWorkloadIdentityRoleSets { + private static final ClientLogger LOGGER = new ClientLogger(PlatformWorkloadIdentityRoleSetsImpl.class); + + private final PlatformWorkloadIdentityRoleSetsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; + + public PlatformWorkloadIdentityRoleSetsImpl(PlatformWorkloadIdentityRoleSetsClient innerClient, + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PlatformWorkloadIdentityRoleSetImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PlatformWorkloadIdentityRoleSetImpl(inner1, this.manager())); + } + + private PlatformWorkloadIdentityRoleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/AzureRedHatOpenShiftClientBuilder.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientBuilder.java similarity index 63% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/AzureRedHatOpenShiftClientBuilder.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientBuilder.java index 1a60a660226a..9568700a0d9f 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/AzureRedHatOpenShiftClientBuilder.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the AzureRedHatOpenShiftClientImpl type. + * A builder for creating a new instance of the RedHatOpenShiftManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { AzureRedHatOpenShiftClientImpl.class }) -public final class AzureRedHatOpenShiftClientBuilder { +@ServiceClientBuilder(serviceClients = { RedHatOpenShiftManagementClientImpl.class }) +public final class RedHatOpenShiftManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the AzureRedHatOpenShiftClientBuilder. + * @param endpoint the endpoint value. + * @return the RedHatOpenShiftManagementClientBuilder. */ - public AzureRedHatOpenShiftClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public RedHatOpenShiftManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the AzureRedHatOpenShiftClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the RedHatOpenShiftManagementClientBuilder. */ - public AzureRedHatOpenShiftClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public RedHatOpenShiftManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public AzureRedHatOpenShiftClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the AzureRedHatOpenShiftClientBuilder. + * @return the RedHatOpenShiftManagementClientBuilder. */ - public AzureRedHatOpenShiftClientBuilder environment(AzureEnvironment environment) { + public RedHatOpenShiftManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public AzureRedHatOpenShiftClientBuilder environment(AzureEnvironment environmen * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the AzureRedHatOpenShiftClientBuilder. + * @return the RedHatOpenShiftManagementClientBuilder. */ - public AzureRedHatOpenShiftClientBuilder pipeline(HttpPipeline pipeline) { + public RedHatOpenShiftManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public AzureRedHatOpenShiftClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureRedHatOpenShiftClientBuilder. + * @return the RedHatOpenShiftManagementClientBuilder. */ - public AzureRedHatOpenShiftClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public RedHatOpenShiftManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public AzureRedHatOpenShiftClientBuilder defaultPollInterval(Duration defaultPol * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the AzureRedHatOpenShiftClientBuilder. + * @return the RedHatOpenShiftManagementClientBuilder. */ - public AzureRedHatOpenShiftClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public RedHatOpenShiftManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of AzureRedHatOpenShiftClientImpl with the provided parameters. + * Builds an instance of RedHatOpenShiftManagementClientImpl with the provided parameters. * - * @return an instance of AzureRedHatOpenShiftClientImpl. + * @return an instance of RedHatOpenShiftManagementClientImpl. */ - public AzureRedHatOpenShiftClientImpl buildClient() { + public RedHatOpenShiftManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public AzureRedHatOpenShiftClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureRedHatOpenShiftClientImpl client = new AzureRedHatOpenShiftClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + RedHatOpenShiftManagementClientImpl client = new RedHatOpenShiftManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/AzureRedHatOpenShiftClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientImpl.java similarity index 74% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/AzureRedHatOpenShiftClientImpl.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientImpl.java index f1ac3af74f59..ad9c69d4270f 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/AzureRedHatOpenShiftClientImpl.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; @@ -13,24 +13,25 @@ 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.PollerFactory; 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.redhatopenshift.fluent.AzureRedHatOpenShiftClient; -import com.azure.resourcemanager.redhatopenshift.fluent.MachinePoolsClient; import com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient; import com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftVersionsClient; import com.azure.resourcemanager.redhatopenshift.fluent.OperationsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.SecretsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.SyncIdentityProvidersClient; -import com.azure.resourcemanager.redhatopenshift.fluent.SyncSetsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetOperationsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetsClient; +import com.azure.resourcemanager.redhatopenshift.fluent.RedHatOpenShiftManagementClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -41,31 +42,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the AzureRedHatOpenShiftClientImpl type. + * Initializes a new instance of the RedHatOpenShiftManagementClientImpl type. */ -@ServiceClient(builder = AzureRedHatOpenShiftClientBuilder.class) -public final class AzureRedHatOpenShiftClientImpl implements AzureRedHatOpenShiftClient { +@ServiceClient(builder = RedHatOpenShiftManagementClientBuilder.class) +public final class RedHatOpenShiftManagementClientImpl implements RedHatOpenShiftManagementClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,12 +61,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -87,6 +74,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -158,100 +159,70 @@ public OpenShiftVersionsClient getOpenShiftVersions() { } /** - * The OpenShiftClustersClient object to access its operations. - */ - private final OpenShiftClustersClient openShiftClusters; - - /** - * Gets the OpenShiftClustersClient object to access its operations. - * - * @return the OpenShiftClustersClient object. - */ - public OpenShiftClustersClient getOpenShiftClusters() { - return this.openShiftClusters; - } - - /** - * The MachinePoolsClient object to access its operations. + * The PlatformWorkloadIdentityRoleSetsClient object to access its operations. */ - private final MachinePoolsClient machinePools; + private final PlatformWorkloadIdentityRoleSetsClient platformWorkloadIdentityRoleSets; /** - * Gets the MachinePoolsClient object to access its operations. + * Gets the PlatformWorkloadIdentityRoleSetsClient object to access its operations. * - * @return the MachinePoolsClient object. + * @return the PlatformWorkloadIdentityRoleSetsClient object. */ - public MachinePoolsClient getMachinePools() { - return this.machinePools; + public PlatformWorkloadIdentityRoleSetsClient getPlatformWorkloadIdentityRoleSets() { + return this.platformWorkloadIdentityRoleSets; } /** - * The SecretsClient object to access its operations. - */ - private final SecretsClient secrets; - - /** - * Gets the SecretsClient object to access its operations. - * - * @return the SecretsClient object. - */ - public SecretsClient getSecrets() { - return this.secrets; - } - - /** - * The SyncIdentityProvidersClient object to access its operations. + * The OpenShiftClustersClient object to access its operations. */ - private final SyncIdentityProvidersClient syncIdentityProviders; + private final OpenShiftClustersClient openShiftClusters; /** - * Gets the SyncIdentityProvidersClient object to access its operations. + * Gets the OpenShiftClustersClient object to access its operations. * - * @return the SyncIdentityProvidersClient object. + * @return the OpenShiftClustersClient object. */ - public SyncIdentityProvidersClient getSyncIdentityProviders() { - return this.syncIdentityProviders; + public OpenShiftClustersClient getOpenShiftClusters() { + return this.openShiftClusters; } /** - * The SyncSetsClient object to access its operations. + * The PlatformWorkloadIdentityRoleSetOperationsClient object to access its operations. */ - private final SyncSetsClient syncSets; + private final PlatformWorkloadIdentityRoleSetOperationsClient platformWorkloadIdentityRoleSetOperations; /** - * Gets the SyncSetsClient object to access its operations. + * Gets the PlatformWorkloadIdentityRoleSetOperationsClient object to access its operations. * - * @return the SyncSetsClient object. + * @return the PlatformWorkloadIdentityRoleSetOperationsClient object. */ - public SyncSetsClient getSyncSets() { - return this.syncSets; + public PlatformWorkloadIdentityRoleSetOperationsClient getPlatformWorkloadIdentityRoleSetOperations() { + return this.platformWorkloadIdentityRoleSetOperations; } /** - * Initializes an instance of AzureRedHatOpenShiftClient client. + * Initializes an instance of RedHatOpenShiftManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - AzureRedHatOpenShiftClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + RedHatOpenShiftManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-11-22"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-07-25"; this.operations = new OperationsClientImpl(this); this.openShiftVersions = new OpenShiftVersionsClientImpl(this); + this.platformWorkloadIdentityRoleSets = new PlatformWorkloadIdentityRoleSetsClientImpl(this); this.openShiftClusters = new OpenShiftClustersClientImpl(this); - this.machinePools = new MachinePoolsClientImpl(this); - this.secrets = new SecretsClientImpl(this); - this.syncIdentityProviders = new SyncIdentityProvidersClientImpl(this); - this.syncSets = new SyncSetsClientImpl(this); + this.platformWorkloadIdentityRoleSetOperations = new PlatformWorkloadIdentityRoleSetOperationsClientImpl(this); } /** @@ -291,6 +262,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -348,7 +336,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -380,5 +368,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(AzureRedHatOpenShiftClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RedHatOpenShiftManagementClientImpl.class); } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/ResourceManagerUtils.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/ResourceManagerUtils.java index 8086e3bfe751..e156594d232b 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/ResourceManagerUtils.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretImpl.java deleted file mode 100644 index 73745b3f2edb..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SecretInner; -import com.azure.resourcemanager.redhatopenshift.models.Secret; -import com.azure.resourcemanager.redhatopenshift.models.SecretUpdate; - -public final class SecretImpl implements Secret, Secret.Definition, Secret.Update { - private SecretInner innerObject; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String secretResources() { - return this.innerModel().secretResources(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SecretInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String childResourceName; - - private SecretUpdate updateParameters; - - public SecretImpl withExistingOpenshiftcluster(String resourceGroupName, String resourceName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - return this; - } - - public Secret create() { - this.innerObject = serviceManager.serviceClient() - .getSecrets() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public Secret create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecrets() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), context) - .getValue(); - return this; - } - - SecretImpl(String name, com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = new SecretInner(); - this.serviceManager = serviceManager; - this.childResourceName = name; - } - - public SecretImpl update() { - this.updateParameters = new SecretUpdate(); - return this; - } - - public Secret apply() { - this.innerObject = serviceManager.serviceClient() - .getSecrets() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, Context.NONE) - .getValue(); - return this; - } - - public Secret apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecrets() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, context) - .getValue(); - return this; - } - - SecretImpl(SecretInner innerObject, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "openshiftclusters"); - this.childResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "secret"); - } - - public Secret refresh() { - this.innerObject = serviceManager.serviceClient() - .getSecrets() - .getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE) - .getValue(); - return this; - } - - public Secret refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecrets() - .getWithResponse(resourceGroupName, resourceName, childResourceName, context) - .getValue(); - return this; - } - - public SecretImpl withSecretResources(String secretResources) { - if (isInCreateMode()) { - this.innerModel().withSecretResources(secretResources); - return this; - } else { - this.updateParameters.withSecretResources(secretResources); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsClientImpl.java deleted file mode 100644 index a0ca7eb3882a..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsClientImpl.java +++ /dev/null @@ -1,935 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.redhatopenshift.fluent.SecretsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SecretInner; -import com.azure.resourcemanager.redhatopenshift.models.SecretList; -import com.azure.resourcemanager.redhatopenshift.models.SecretUpdate; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecretsClient. - */ -public final class SecretsClientImpl implements SecretsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecretsService service; - - /** - * The service client containing this operation class. - */ - private final AzureRedHatOpenShiftClientImpl client; - - /** - * Initializes an instance of SecretsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecretsClientImpl(AzureRedHatOpenShiftClientImpl client) { - this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureRedHatOpenShiftClientSecrets to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") - public interface SecretsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/secrets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") SecretInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") SecretUpdate parameters, @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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); - } - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner get(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE).getValue(); - } - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SecretInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SecretInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context); - } - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String childResourceName, SecretInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SecretInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context) - .block(); - } - - /** - * Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - SecretInner parameters) { - return createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, Context.NONE) - .getValue(); - } - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String childResourceName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SecretUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SecretUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, parameters, accept, context); - } - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, String childResourceName, - SecretUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SecretUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context).block(); - } - - /** - * Updates a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param parameters The Secret resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner update(String resourceGroupName, String resourceName, String childResourceName, - SecretUpdate parameters) { - return updateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, 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 secretList represents a list of Secrets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - 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. - * @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 secretList represents a list of Secrets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsImpl.java deleted file mode 100644 index a64f7cafdcc0..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SecretsImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.SecretsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SecretInner; -import com.azure.resourcemanager.redhatopenshift.models.Secret; -import com.azure.resourcemanager.redhatopenshift.models.Secrets; - -public final class SecretsImpl implements Secrets { - private static final ClientLogger LOGGER = new ClientLogger(SecretsImpl.class); - - private final SecretsClient innerClient; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public SecretsImpl(SecretsClient innerClient, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, childResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecretImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Secret get(String resourceGroupName, String resourceName, String childResourceName) { - SecretInner inner = this.serviceClient().get(resourceGroupName, resourceName, childResourceName); - if (inner != null) { - return new SecretImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - this.serviceClient().delete(resourceGroupName, resourceName, childResourceName); - } - - public Secret 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "secret"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'secret'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "secret"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'secret'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "secret"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'secret'.", id))); - } - this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - public Response 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "secret"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'secret'.", id))); - } - return this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - private SecretsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - public SecretImpl define(String name) { - return new SecretImpl(name, this.manager()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProviderImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProviderImpl.java deleted file mode 100644 index 031c70380d65..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProviderImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviderUpdate; - -public final class SyncIdentityProviderImpl - implements SyncIdentityProvider, SyncIdentityProvider.Definition, SyncIdentityProvider.Update { - private SyncIdentityProviderInner innerObject; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resources() { - return this.innerModel().resources(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SyncIdentityProviderInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String childResourceName; - - private SyncIdentityProviderUpdate updateParameters; - - public SyncIdentityProviderImpl withExistingOpenshiftcluster(String resourceGroupName, String resourceName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - return this; - } - - public SyncIdentityProvider create() { - this.innerObject = serviceManager.serviceClient() - .getSyncIdentityProviders() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public SyncIdentityProvider create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSyncIdentityProviders() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), context) - .getValue(); - return this; - } - - SyncIdentityProviderImpl(String name, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = new SyncIdentityProviderInner(); - this.serviceManager = serviceManager; - this.childResourceName = name; - } - - public SyncIdentityProviderImpl update() { - this.updateParameters = new SyncIdentityProviderUpdate(); - return this; - } - - public SyncIdentityProvider apply() { - this.innerObject = serviceManager.serviceClient() - .getSyncIdentityProviders() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, Context.NONE) - .getValue(); - return this; - } - - public SyncIdentityProvider apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSyncIdentityProviders() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, context) - .getValue(); - return this; - } - - SyncIdentityProviderImpl(SyncIdentityProviderInner innerObject, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "openshiftclusters"); - this.childResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "syncIdentityProvider"); - } - - public SyncIdentityProvider refresh() { - this.innerObject = serviceManager.serviceClient() - .getSyncIdentityProviders() - .getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE) - .getValue(); - return this; - } - - public SyncIdentityProvider refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSyncIdentityProviders() - .getWithResponse(resourceGroupName, resourceName, childResourceName, context) - .getValue(); - return this; - } - - public SyncIdentityProviderImpl withResources(String resources) { - if (isInCreateMode()) { - this.innerModel().withResources(resources); - return this; - } else { - this.updateParameters.withResources(resources); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersClientImpl.java deleted file mode 100644 index 09a8e907b1d2..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersClientImpl.java +++ /dev/null @@ -1,947 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.redhatopenshift.fluent.SyncIdentityProvidersClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviderList; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviderUpdate; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SyncIdentityProvidersClient. - */ -public final class SyncIdentityProvidersClientImpl implements SyncIdentityProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final SyncIdentityProvidersService service; - - /** - * The service client containing this operation class. - */ - private final AzureRedHatOpenShiftClientImpl client; - - /** - * Initializes an instance of SyncIdentityProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SyncIdentityProvidersClientImpl(AzureRedHatOpenShiftClientImpl client) { - this.service = RestProxy.create(SyncIdentityProvidersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureRedHatOpenShiftClientSyncIdentityProviders to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") - public interface SyncIdentityProvidersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/syncIdentityProviders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") SyncIdentityProviderInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") SyncIdentityProviderUpdate parameters, @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("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); - } - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, - String childResourceName) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncIdentityProviderInner get(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE).getValue(); - } - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, SyncIdentityProviderInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, SyncIdentityProviderInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context); - } - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context) - .block(); - } - - /** - * Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncIdentityProviderInner createOrUpdate(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderInner parameters) { - return createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, Context.NONE) - .getValue(); - } - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String childResourceName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, SyncIdentityProviderUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, SyncIdentityProviderUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, parameters, accept, context); - } - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncIdentityProviderUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context).block(); - } - - /** - * Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param parameters The SyncIdentityProvider resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncIdentityProviderInner update(String resourceGroupName, String resourceName, String childResourceName, - SyncIdentityProviderUpdate parameters) { - return updateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, 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 syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - 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. - * @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 syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersImpl.java deleted file mode 100644 index f9aff76956a9..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncIdentityProvidersImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.SyncIdentityProvidersClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviders; - -public final class SyncIdentityProvidersImpl implements SyncIdentityProviders { - private static final ClientLogger LOGGER = new ClientLogger(SyncIdentityProvidersImpl.class); - - private final SyncIdentityProvidersClient innerClient; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public SyncIdentityProvidersImpl(SyncIdentityProvidersClient innerClient, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SyncIdentityProviderImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SyncIdentityProviderImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, childResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SyncIdentityProviderImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SyncIdentityProvider get(String resourceGroupName, String resourceName, String childResourceName) { - SyncIdentityProviderInner inner = this.serviceClient().get(resourceGroupName, resourceName, childResourceName); - if (inner != null) { - return new SyncIdentityProviderImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - this.serviceClient().delete(resourceGroupName, resourceName, childResourceName); - } - - public SyncIdentityProvider 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncIdentityProvider"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncIdentityProvider'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncIdentityProvider"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncIdentityProvider'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncIdentityProvider"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncIdentityProvider'.", id))); - } - this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - public Response 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncIdentityProvider"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncIdentityProvider'.", id))); - } - return this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - private SyncIdentityProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - public SyncIdentityProviderImpl define(String name) { - return new SyncIdentityProviderImpl(name, this.manager()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetImpl.java deleted file mode 100644 index 574f9d05df97..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; -import com.azure.resourcemanager.redhatopenshift.models.SyncSetUpdate; - -public final class SyncSetImpl implements SyncSet, SyncSet.Definition, SyncSet.Update { - private SyncSetInner innerObject; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resources() { - return this.innerModel().resources(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SyncSetInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String childResourceName; - - private SyncSetUpdate updateParameters; - - public SyncSetImpl withExistingOpenshiftcluster(String resourceGroupName, String resourceName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - return this; - } - - public SyncSet create() { - this.innerObject = serviceManager.serviceClient() - .getSyncSets() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public SyncSet create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSyncSets() - .createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, this.innerModel(), context) - .getValue(); - return this; - } - - SyncSetImpl(String name, com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = new SyncSetInner(); - this.serviceManager = serviceManager; - this.childResourceName = name; - } - - public SyncSetImpl update() { - this.updateParameters = new SyncSetUpdate(); - return this; - } - - public SyncSet apply() { - this.innerObject = serviceManager.serviceClient() - .getSyncSets() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, Context.NONE) - .getValue(); - return this; - } - - public SyncSet apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSyncSets() - .updateWithResponse(resourceGroupName, resourceName, childResourceName, updateParameters, context) - .getValue(); - return this; - } - - SyncSetImpl(SyncSetInner innerObject, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "openshiftclusters"); - this.childResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "syncSet"); - } - - public SyncSet refresh() { - this.innerObject = serviceManager.serviceClient() - .getSyncSets() - .getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE) - .getValue(); - return this; - } - - public SyncSet refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSyncSets() - .getWithResponse(resourceGroupName, resourceName, childResourceName, context) - .getValue(); - return this; - } - - public SyncSetImpl withResources(String resources) { - if (isInCreateMode()) { - this.innerModel().withResources(resources); - return this; - } else { - this.updateParameters.withResources(resources); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsClientImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsClientImpl.java deleted file mode 100644 index bedee8e687d5..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsClientImpl.java +++ /dev/null @@ -1,944 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.redhatopenshift.fluent.SyncSetsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncSetList; -import com.azure.resourcemanager.redhatopenshift.models.SyncSetUpdate; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SyncSetsClient. - */ -public final class SyncSetsClientImpl implements SyncSetsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SyncSetsService service; - - /** - * The service client containing this operation class. - */ - private final AzureRedHatOpenShiftClientImpl client; - - /** - * Initializes an instance of SyncSetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SyncSetsClientImpl(AzureRedHatOpenShiftClientImpl client) { - this.service = RestProxy.create(SyncSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureRedHatOpenShiftClientSyncSets to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureRedHatOpenShift") - public interface SyncSetsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/syncSets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") SyncSetInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") SyncSetUpdate parameters, @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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); - } - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncSetInner get(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE).getValue(); - } - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncSetInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncSetInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context); - } - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncSetInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncSetInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context) - .block(); - } - - /** - * Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncSetInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - SyncSetInner parameters) { - return createOrUpdateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, Context.NONE) - .getValue(); - } - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String childResourceName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncSetUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, SyncSetUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, parameters, accept, context); - } - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, String childResourceName, - SyncSetUpdate parameters) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String resourceName, - String childResourceName, SyncSetUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context).block(); - } - - /** - * Updates a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param parameters The SyncSet resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncSetInner update(String resourceGroupName, String resourceName, String childResourceName, - SyncSetUpdate parameters) { - return updateWithResponse(resourceGroupName, resourceName, childResourceName, parameters, 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 syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - 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. - * @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 syncSetList represents a list of SyncSets along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsImpl.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsImpl.java deleted file mode 100644 index cfaf6cfd65eb..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/SyncSetsImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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.redhatopenshift.fluent.SyncSetsClient; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; -import com.azure.resourcemanager.redhatopenshift.models.SyncSets; - -public final class SyncSetsImpl implements SyncSets { - private static final ClientLogger LOGGER = new ClientLogger(SyncSetsImpl.class); - - private final SyncSetsClient innerClient; - - private final com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager; - - public SyncSetsImpl(SyncSetsClient innerClient, - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SyncSetImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SyncSetImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, childResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SyncSetImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SyncSet get(String resourceGroupName, String resourceName, String childResourceName) { - SyncSetInner inner = this.serviceClient().get(resourceGroupName, resourceName, childResourceName); - if (inner != null) { - return new SyncSetImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - this.serviceClient().delete(resourceGroupName, resourceName, childResourceName); - } - - public SyncSet 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncSet"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncSet'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncSet"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncSet'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncSet"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncSet'.", id))); - } - this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - public Response 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "openshiftclusters"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'openshiftclusters'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "syncSet"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'syncSet'.", id))); - } - return this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - private SyncSetsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager() { - return this.serviceManager; - } - - public SyncSetImpl define(String name) { - return new SyncSetImpl(name, this.manager()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftClusterList.java similarity index 66% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterList.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftClusterList.java index 385908994387..764880d53663 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterList.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftClusterList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redhatopenshift.models; +package com.azure.resourcemanager.redhatopenshift.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * OpenShiftClusterList represents a list of OpenShift clusters. */ -@Fluent +@Immutable public final class OpenShiftClusterList implements JsonSerializable { /* - * The list of OpenShift clusters. + * The OpenShiftCluster items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OpenShiftClusterList class. */ - public OpenShiftClusterList() { + private OpenShiftClusterList() { } /** - * Get the value property: The list of OpenShift clusters. + * Get the value property: The OpenShiftCluster items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The list of OpenShift clusters. - * - * @param value the value value to set. - * @return the OpenShiftClusterList object itself. - */ - public OpenShiftClusterList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the OpenShiftClusterList object itself. - */ - public OpenShiftClusterList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OpenShiftClusterList 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 OpenShiftClusterList. */ public static OpenShiftClusterList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersionList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftVersionList.java similarity index 67% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersionList.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftVersionList.java index 07268b07a53a..dbfc1e71ce86 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersionList.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftVersionList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redhatopenshift.models; +package com.azure.resourcemanager.redhatopenshift.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * OpenShiftVersionList represents a List of available versions. */ -@Fluent +@Immutable public final class OpenShiftVersionList implements JsonSerializable { /* - * The List of available versions. + * The OpenShiftVersion items on this page */ private List value; /* - * Next Link to next operation. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OpenShiftVersionList class. */ - public OpenShiftVersionList() { + private OpenShiftVersionList() { } /** - * Get the value property: The List of available versions. + * Get the value property: The OpenShiftVersion items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The List of available versions. - * - * @param value the value value to set. - * @return the OpenShiftVersionList object itself. - */ - public OpenShiftVersionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Next Link to next operation. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Next Link to next operation. - * - * @param nextLink the nextLink value to set. - * @return the OpenShiftVersionList object itself. - */ - public OpenShiftVersionList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OpenShiftVersionList 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 OpenShiftVersionList. */ public static OpenShiftVersionList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OperationList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OperationList.java similarity index 65% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OperationList.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OperationList.java index b386f0057f8a..f21db1bbd10a 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OperationList.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OperationList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redhatopenshift.models; +package com.azure.resourcemanager.redhatopenshift.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * OperationList represents an RP operation list. */ -@Fluent +@Immutable public final class OperationList implements JsonSerializable { /* - * List of operations supported by the resource provider. + * The Operation items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationList class. */ - public OperationList() { + private OperationList() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: List of operations supported by the resource provider. - * - * @param value the value value to set. - * @return the OperationList object itself. - */ - public OperationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the OperationList object itself. - */ - public OperationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationList. */ public static OperationList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/PlatformWorkloadIdentityRoleSetList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/PlatformWorkloadIdentityRoleSetList.java new file mode 100644 index 000000000000..25bdad224305 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/PlatformWorkloadIdentityRoleSetList.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.redhatopenshift.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.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import java.io.IOException; +import java.util.List; + +/** + * PlatformWorkloadIdentityRoleSetList represents a List of role sets. + */ +@Immutable +public final class PlatformWorkloadIdentityRoleSetList + implements JsonSerializable { + /* + * The PlatformWorkloadIdentityRoleSet items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PlatformWorkloadIdentityRoleSetList class. + */ + private PlatformWorkloadIdentityRoleSetList() { + } + + /** + * Get the value property: The PlatformWorkloadIdentityRoleSet 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 PlatformWorkloadIdentityRoleSetList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformWorkloadIdentityRoleSetList 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 PlatformWorkloadIdentityRoleSetList. + */ + public static PlatformWorkloadIdentityRoleSetList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformWorkloadIdentityRoleSetList deserializedPlatformWorkloadIdentityRoleSetList + = new PlatformWorkloadIdentityRoleSetList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PlatformWorkloadIdentityRoleSetInner.fromJson(reader1)); + deserializedPlatformWorkloadIdentityRoleSetList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPlatformWorkloadIdentityRoleSetList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformWorkloadIdentityRoleSetList; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/package-info.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/package-info.java index 63441c918d53..614538637a7b 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/package-info.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for AzureRedHatOpenShiftClient. + * Package containing the implementations for RedHatOpenShift. * Rest API for Azure Red Hat OpenShift 4. */ package com.azure.resourcemanager.redhatopenshift.implementation; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ApiServerProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ApiServerProfile.java index 7436f572c61e..8cc73842690b 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ApiServerProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ApiServerProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -75,14 +75,6 @@ public String ip() { return this.ip; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ClusterProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ClusterProfile.java index 46de5b4403a4..787e63d1356c 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ClusterProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ClusterProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -41,6 +41,11 @@ public final class ClusterProfile implements JsonSerializable { */ private FipsValidatedModules fipsValidatedModules; + /* + * The URL of the managed OIDC issuer in a workload identity cluster. + */ + private String oidcIssuer; + /** * Creates an instance of ClusterProfile class. */ @@ -148,11 +153,12 @@ public ClusterProfile withFipsValidatedModules(FipsValidatedModules fipsValidate } /** - * Validates the instance. + * Get the oidcIssuer property: The URL of the managed OIDC issuer in a workload identity cluster. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the oidcIssuer value. */ - public void validate() { + public String oidcIssuer() { + return this.oidcIssuer; } /** @@ -196,6 +202,8 @@ public static ClusterProfile fromJson(JsonReader jsonReader) throws IOException } else if ("fipsValidatedModules".equals(fieldName)) { deserializedClusterProfile.fipsValidatedModules = FipsValidatedModules.fromString(reader.getString()); + } else if ("oidcIssuer".equals(fieldName)) { + deserializedClusterProfile.oidcIssuer = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ConsoleProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ConsoleProfile.java index c25fb95491e0..bcb93454c11c 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ConsoleProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ConsoleProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -36,14 +36,6 @@ public String url() { return this.url; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Display.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Display.java index 3dd36a39c9dd..94c40555b292 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Display.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Display.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Display represents the display details of an operation. */ -@Fluent +@Immutable public final class Display implements JsonSerializable { /* * Friendly name of the resource provider. @@ -39,7 +39,7 @@ public final class Display implements JsonSerializable { /** * Creates an instance of Display class. */ - public Display() { + private Display() { } /** @@ -51,17 +51,6 @@ public String provider() { return this.provider; } - /** - * Set the provider property: Friendly name of the resource provider. - * - * @param provider the provider value to set. - * @return the Display object itself. - */ - public Display withProvider(String provider) { - this.provider = provider; - return this; - } - /** * Get the resource property: Resource type on which the operation is performed. * @@ -71,17 +60,6 @@ public String resource() { return this.resource; } - /** - * Set the resource property: Resource type on which the operation is performed. - * - * @param resource the resource value to set. - * @return the Display object itself. - */ - public Display withResource(String resource) { - this.resource = resource; - return this; - } - /** * Get the operation property: Operation type: read, write, delete, listKeys/action, etc. * @@ -91,17 +69,6 @@ public String operation() { return this.operation; } - /** - * Set the operation property: Operation type: read, write, delete, listKeys/action, etc. - * - * @param operation the operation value to set. - * @return the Display object itself. - */ - public Display withOperation(String operation) { - this.operation = operation; - return this; - } - /** * Get the description property: Friendly name of the operation. * @@ -111,25 +78,6 @@ public String description() { return this.description; } - /** - * Set the description property: Friendly name of the operation. - * - * @param description the description value to set. - * @return the Display object itself. - */ - public Display withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/EffectiveOutboundIp.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/EffectiveOutboundIp.java index bab85c98d644..e3866dff7bb9 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/EffectiveOutboundIp.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/EffectiveOutboundIp.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * EffectiveOutboundIP represents an effective outbound IP resource of the cluster public load balancer. */ -@Fluent +@Immutable public final class EffectiveOutboundIp implements JsonSerializable { /* * The fully qualified Azure resource id of an IP address resource. @@ -24,7 +24,7 @@ public final class EffectiveOutboundIp implements JsonSerializable { /** - * Static value Disabled for EncryptionAtHost. + * Disabled. */ public static final EncryptionAtHost DISABLED = fromString("Disabled"); /** - * Static value Enabled for EncryptionAtHost. + * Enabled. */ public static final EncryptionAtHost ENABLED = fromString("Enabled"); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/FipsValidatedModules.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/FipsValidatedModules.java index 103b64dda9ef..7e5d4aa0d24c 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/FipsValidatedModules.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/FipsValidatedModules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -12,12 +12,12 @@ */ public final class FipsValidatedModules extends ExpandableStringEnum { /** - * Static value Disabled for FipsValidatedModules. + * Disabled. */ public static final FipsValidatedModules DISABLED = fromString("Disabled"); /** - * Static value Enabled for FipsValidatedModules. + * Enabled. */ public static final FipsValidatedModules ENABLED = fromString("Enabled"); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/IngressProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/IngressProfile.java index a54308299b9c..599bc9383798 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/IngressProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/IngressProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -86,14 +86,6 @@ public String ip() { return this.ip; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/LoadBalancerProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/LoadBalancerProfile.java index 578d2acb8b6c..b3313e39117c 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/LoadBalancerProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/LoadBalancerProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -62,20 +62,6 @@ public List effectiveOutboundIps() { return this.effectiveOutboundIps; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (managedOutboundIps() != null) { - managedOutboundIps().validate(); - } - if (effectiveOutboundIps() != null) { - effectiveOutboundIps().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePool.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePool.java deleted file mode 100644 index 2131e3af2474..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePool.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; - -/** - * An immutable client-side representation of MachinePool. - */ -public interface MachinePool { - /** - * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the resources property: The resources property. - * - * @return the resources value. - */ - String resources(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner object. - * - * @return the inner object. - */ - MachinePoolInner innerModel(); - - /** - * The entirety of the MachinePool definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The MachinePool definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the MachinePool definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the MachinePool definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @return the next definition stage. - */ - WithCreate withExistingOpenshiftcluster(String resourceGroupName, String resourceName); - } - - /** - * The stage of the MachinePool 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.WithResources { - /** - * Executes the create request. - * - * @return the created resource. - */ - MachinePool create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - MachinePool create(Context context); - } - - /** - * The stage of the MachinePool definition allowing to specify resources. - */ - interface WithResources { - /** - * Specifies the resources property: The resources property.. - * - * @param resources The resources property. - * @return the next definition stage. - */ - WithCreate withResources(String resources); - } - } - - /** - * Begins update for the MachinePool resource. - * - * @return the stage of resource update. - */ - MachinePool.Update update(); - - /** - * The template for MachinePool update. - */ - interface Update extends UpdateStages.WithResources { - /** - * Executes the update request. - * - * @return the updated resource. - */ - MachinePool apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - MachinePool apply(Context context); - } - - /** - * The MachinePool update stages. - */ - interface UpdateStages { - /** - * The stage of the MachinePool update allowing to specify resources. - */ - interface WithResources { - /** - * Specifies the resources property: The resources property.. - * - * @param resources The resources property. - * @return the next definition stage. - */ - Update withResources(String resources); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - MachinePool refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - MachinePool refresh(Context context); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolList.java deleted file mode 100644 index e78e398faf68..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolList.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; -import java.io.IOException; -import java.util.List; - -/** - * MachinePoolList represents a list of MachinePools. - */ -@Fluent -public final class MachinePoolList implements JsonSerializable { - /* - * The list of Machine Pools. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of MachinePoolList class. - */ - public MachinePoolList() { - } - - /** - * Get the value property: The list of Machine Pools. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of Machine Pools. - * - * @param value the value value to set. - * @return the MachinePoolList object itself. - */ - public MachinePoolList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the MachinePoolList object itself. - */ - public MachinePoolList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 MachinePoolList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachinePoolList 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 MachinePoolList. - */ - public static MachinePoolList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachinePoolList deserializedMachinePoolList = new MachinePoolList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> MachinePoolInner.fromJson(reader1)); - deserializedMachinePoolList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedMachinePoolList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMachinePoolList; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolUpdate.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolUpdate.java deleted file mode 100644 index a9417e02ef39..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePoolUpdate.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolProperties; -import java.io.IOException; - -/** - * MachinePool represents a MachinePool. - */ -@Fluent -public final class MachinePoolUpdate implements JsonSerializable { - /* - * The MachinePool Properties - */ - private MachinePoolProperties innerProperties; - - /* - * The system meta data relating to this resource. - */ - private SystemData systemData; - - /** - * Creates an instance of MachinePoolUpdate class. - */ - public MachinePoolUpdate() { - } - - /** - * Get the innerProperties property: The MachinePool Properties. - * - * @return the innerProperties value. - */ - private MachinePoolProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public String resources() { - return this.innerProperties() == null ? null : this.innerProperties().resources(); - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the MachinePoolUpdate object itself. - */ - public MachinePoolUpdate withResources(String resources) { - if (this.innerProperties() == null) { - this.innerProperties = new MachinePoolProperties(); - } - this.innerProperties().withResources(resources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MachinePoolUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachinePoolUpdate 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 MachinePoolUpdate. - */ - public static MachinePoolUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachinePoolUpdate deserializedMachinePoolUpdate = new MachinePoolUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedMachinePoolUpdate.innerProperties = MachinePoolProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedMachinePoolUpdate.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMachinePoolUpdate; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePools.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePools.java deleted file mode 100644 index 0498e487685a..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MachinePools.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 MachinePools. - */ -public interface MachinePools { - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 machinePoolList represents a list of MachinePools as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePoolList represents a list of MachinePools as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machinePool represents a MachinePool along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @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 machinePool represents a MachinePool. - */ - MachinePool get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the MachinePool resource. - * @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 resourceName, String childResourceName); - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @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 machinePool represents a MachinePool along with {@link Response}. - */ - MachinePool getById(String id); - - /** - * Gets a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns properties of a MachinePool. - * - * @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 machinePool represents a MachinePool along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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); - - /** - * Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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 the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new MachinePool resource. - * - * @param name resource name. - * @return the first stage of the new MachinePool definition. - */ - MachinePool.DefinitionStages.Blank define(String name); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedOutboundIPs.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedOutboundIPs.java index 48a196c9962c..4d06cbfe5ddb 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedOutboundIPs.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedOutboundIPs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -50,14 +50,6 @@ public ManagedOutboundIPs withCount(Integer count) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentity.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..7c11446912b7 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentityType.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..2ca1d1e66a01 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentityType.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.redhatopenshift.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MasterProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MasterProfile.java index 94b40c80b40b..4ec1b8a0b334 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MasterProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/MasterProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -122,14 +122,6 @@ public MasterProfile withDiskEncryptionSetId(String diskEncryptionSetId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/NetworkProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/NetworkProfile.java index 5609445c8c10..7a0617279ba9 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/NetworkProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/NetworkProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -147,17 +147,6 @@ public NetworkProfile withPreconfiguredNsg(PreconfiguredNsg preconfiguredNsg) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (loadBalancerProfile() != null) { - loadBalancerProfile().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftCluster.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftCluster.java index 73198b942742..bd40edb6d0be 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftCluster.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftCluster.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -51,6 +51,13 @@ public interface OpenShiftCluster { */ Map tags(); + /** + * 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. * @@ -86,6 +93,13 @@ public interface OpenShiftCluster { */ ServicePrincipalProfile servicePrincipalProfile(); + /** + * Gets the platformWorkloadIdentityProfile property: The workload identity profile. + * + * @return the platformWorkloadIdentityProfile value. + */ + PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile(); + /** * Gets the networkProfile property: The cluster network profile. * @@ -211,9 +225,10 @@ interface WithResourceGroup { * The stage of the OpenShiftCluster definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProvisioningState, - DefinitionStages.WithClusterProfile, DefinitionStages.WithConsoleProfile, - DefinitionStages.WithServicePrincipalProfile, DefinitionStages.WithNetworkProfile, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithProvisioningState, DefinitionStages.WithClusterProfile, + DefinitionStages.WithConsoleProfile, DefinitionStages.WithServicePrincipalProfile, + DefinitionStages.WithPlatformWorkloadIdentityProfile, DefinitionStages.WithNetworkProfile, DefinitionStages.WithMasterProfile, DefinitionStages.WithWorkerProfiles, DefinitionStages.WithApiserverProfile, DefinitionStages.WithIngressProfiles { /** @@ -245,6 +260,19 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the OpenShiftCluster 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); + } + /** * The stage of the OpenShiftCluster definition allowing to specify provisioningState. */ @@ -297,6 +325,20 @@ interface WithServicePrincipalProfile { WithCreate withServicePrincipalProfile(ServicePrincipalProfile servicePrincipalProfile); } + /** + * The stage of the OpenShiftCluster definition allowing to specify platformWorkloadIdentityProfile. + */ + interface WithPlatformWorkloadIdentityProfile { + /** + * Specifies the platformWorkloadIdentityProfile property: The workload identity profile.. + * + * @param platformWorkloadIdentityProfile The workload identity profile. + * @return the next definition stage. + */ + WithCreate + withPlatformWorkloadIdentityProfile(PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile); + } + /** * The stage of the OpenShiftCluster definition allowing to specify networkProfile. */ @@ -373,8 +415,9 @@ interface WithIngressProfiles { /** * The template for OpenShiftCluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProvisioningState, UpdateStages.WithClusterProfile, - UpdateStages.WithConsoleProfile, UpdateStages.WithServicePrincipalProfile, UpdateStages.WithNetworkProfile, + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProvisioningState, + UpdateStages.WithClusterProfile, UpdateStages.WithConsoleProfile, UpdateStages.WithServicePrincipalProfile, + UpdateStages.WithPlatformWorkloadIdentityProfile, UpdateStages.WithNetworkProfile, UpdateStages.WithMasterProfile, UpdateStages.WithWorkerProfiles, UpdateStages.WithApiserverProfile, UpdateStages.WithIngressProfiles { /** @@ -410,6 +453,20 @@ interface WithTags { Update withTags(Map tags); } + /** + * The stage of the OpenShiftCluster update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Identity stores information about the cluster MSI(s) in a workload + * identity cluster.. + * + * @param identity Identity stores information about the cluster MSI(s) in a workload identity cluster. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** * The stage of the OpenShiftCluster update allowing to specify provisioningState. */ @@ -462,6 +519,19 @@ interface WithServicePrincipalProfile { Update withServicePrincipalProfile(ServicePrincipalProfile servicePrincipalProfile); } + /** + * The stage of the OpenShiftCluster update allowing to specify platformWorkloadIdentityProfile. + */ + interface WithPlatformWorkloadIdentityProfile { + /** + * Specifies the platformWorkloadIdentityProfile property: The workload identity profile.. + * + * @param platformWorkloadIdentityProfile The workload identity profile. + * @return the next definition stage. + */ + Update withPlatformWorkloadIdentityProfile(PlatformWorkloadIdentityProfile platformWorkloadIdentityProfile); + } + /** * The stage of the OpenShiftCluster update allowing to specify networkProfile. */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterAdminKubeconfig.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterAdminKubeconfig.java index 5a1e896ed1b5..f3d029779d1d 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterAdminKubeconfig.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterAdminKubeconfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterCredentials.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterCredentials.java index c3332664a8d4..a5bcc790d6b6 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterCredentials.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterCredentials.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterUpdate.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterUpdate.java index 1adca407a87a..c02e9a3e97fa 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterUpdate.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterUpdate.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -31,9 +30,9 @@ public final class OpenShiftClusterUpdate implements JsonSerializable ingressPr return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -314,6 +337,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -337,8 +361,8 @@ public static OpenShiftClusterUpdate fromJson(JsonReader jsonReader) throws IOEx deserializedOpenShiftClusterUpdate.tags = tags; } else if ("properties".equals(fieldName)) { deserializedOpenShiftClusterUpdate.innerProperties = OpenShiftClusterProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedOpenShiftClusterUpdate.systemData = SystemData.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedOpenShiftClusterUpdate.identity = ManagedServiceIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusters.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusters.java index a6cc7f4ca3d5..6f14bb23e377 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusters.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -13,116 +13,120 @@ */ public interface OpenShiftClusters { /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); /** - * Lists OpenShift clusters in the specified subscription. + * Gets a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns properties of a OpenShift cluster. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster. */ - PagedIterable list(Context context); + OpenShiftCluster getByResourceGroup(String resourceGroupName, String resourceName); /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Deletes a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns nothing. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String resourceName); /** - * Lists OpenShift clusters in the specified subscription and resource group. + * Deletes a OpenShift cluster with the specified subscription, resource group and resource name. * - * The operation returns properties of each OpenShift cluster. + * The operation returns nothing. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with - * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void delete(String resourceGroupName, String resourceName, Context context); /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription and resource group. * - * The operation returns properties of a OpenShift cluster. + * The operation returns properties of each OpenShift cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return openShiftCluster represents an Azure Red Hat OpenShift cluster. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - OpenShiftCluster getByResourceGroup(String resourceGroupName, String resourceName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deletes a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns nothing. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String resourceName); + PagedIterable list(); /** - * Deletes a OpenShift cluster with the specified subscription, resource group and resource name. + * Lists OpenShift clusters in the specified subscription. * - * The operation returns nothing. + * The operation returns properties of each OpenShift cluster. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openShiftClusterList represents a list of OpenShift clusters as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String resourceName, Context context); + PagedIterable list(Context context); /** * Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group and resource name. @@ -194,7 +198,9 @@ Response listCredentialsWithResponse(String resourc * @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 openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster along with {@link Response}. */ OpenShiftCluster getById(String id); @@ -208,7 +214,9 @@ Response listCredentialsWithResponse(String resourc * @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 openShiftCluster represents an Azure Red Hat OpenShift cluster along with {@link Response}. + * @return a OpenShift cluster with the specified subscription, resource group and resource name. + * + * The operation returns properties of a OpenShift cluster along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersion.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersion.java index f226bc9042ce..becc44112117 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersion.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersion.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersions.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersions.java index df071ee5d3a7..afd235efb254 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersions.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersions.java @@ -1,22 +1,56 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.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 OpenShiftVersions. */ public interface OpenShiftVersions { + /** + * Gets an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + * + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string along with {@link Response}. + */ + Response getWithResponse(String location, String openShiftVersion, Context context); + + /** + * Gets an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + * + * @param location The name of the Azure region. + * @param openShiftVersion The desired version value of the OpenShiftVersion resource. + * @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 an available OpenShift version to install in the specified location. + * + * This operation returns installable OpenShift version as a string. + */ + OpenShiftVersion get(String location, String openShiftVersion); + /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. @@ -28,9 +62,9 @@ public interface OpenShiftVersions { /** * Lists all OpenShift versions available to install in the specified location. * - * The operation returns the installable OpenShift versions as strings. + * The operation returns the installable OpenShift versions as a string. * - * @param location The name of Azure region. + * @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. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operation.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operation.java index 295a4542a07a..f7146bb5da32 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operation.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operations.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operations.java index 9f7088da219b..13b834299aea 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operations.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -12,9 +12,7 @@ */ public interface Operations { /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * 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. @@ -23,9 +21,7 @@ public interface Operations { PagedIterable list(); /** - * Lists all of the available RP operations. - * - * The operation returns the RP operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OutboundType.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OutboundType.java index 7d4c90fd20b2..9b552d2303b0 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OutboundType.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/OutboundType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -12,12 +12,12 @@ */ public final class OutboundType extends ExpandableStringEnum { /** - * Static value Loadbalancer for OutboundType. + * Loadbalancer. */ public static final OutboundType LOADBALANCER = fromString("Loadbalancer"); /** - * Static value UserDefinedRouting for OutboundType. + * UserDefinedRouting. */ public static final OutboundType USER_DEFINED_ROUTING = fromString("UserDefinedRouting"); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentity.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentity.java new file mode 100644 index 000000000000..17359277e884 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentity.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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; + +/** + * PlatformWorkloadIdentity stores information representing a single workload identity. + */ +@Fluent +public final class PlatformWorkloadIdentity implements JsonSerializable { + /* + * The resource ID of the PlatformWorkloadIdentity resource + */ + private String resourceId; + + /* + * The ClientID of the PlatformWorkloadIdentity resource + */ + private String clientId; + + /* + * The ObjectID of the PlatformWorkloadIdentity resource + */ + private String objectId; + + /** + * Creates an instance of PlatformWorkloadIdentity class. + */ + public PlatformWorkloadIdentity() { + } + + /** + * Get the resourceId property: The resource ID of the PlatformWorkloadIdentity resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of the PlatformWorkloadIdentity resource. + * + * @param resourceId the resourceId value to set. + * @return the PlatformWorkloadIdentity object itself. + */ + public PlatformWorkloadIdentity withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the clientId property: The ClientID of the PlatformWorkloadIdentity resource. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Get the objectId property: The ObjectID of the PlatformWorkloadIdentity resource. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformWorkloadIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformWorkloadIdentity 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 PlatformWorkloadIdentity. + */ + public static PlatformWorkloadIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformWorkloadIdentity deserializedPlatformWorkloadIdentity = new PlatformWorkloadIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedPlatformWorkloadIdentity.resourceId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedPlatformWorkloadIdentity.clientId = reader.getString(); + } else if ("objectId".equals(fieldName)) { + deserializedPlatformWorkloadIdentity.objectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformWorkloadIdentity; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityProfile.java new file mode 100644 index 000000000000..96c3a01fb015 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityProfile.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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.Map; + +/** + * PlatformWorkloadIdentityProfile encapsulates all information that is specific to workload identity clusters. + */ +@Fluent +public final class PlatformWorkloadIdentityProfile implements JsonSerializable { + /* + * UpgradeableTo stores a single OpenShift version a workload identity cluster can be upgraded to + */ + private String upgradeableTo; + + /* + * Dictionary of + */ + private Map platformWorkloadIdentities; + + /** + * Creates an instance of PlatformWorkloadIdentityProfile class. + */ + public PlatformWorkloadIdentityProfile() { + } + + /** + * Get the upgradeableTo property: UpgradeableTo stores a single OpenShift version a workload identity cluster can + * be upgraded to. + * + * @return the upgradeableTo value. + */ + public String upgradeableTo() { + return this.upgradeableTo; + } + + /** + * Set the upgradeableTo property: UpgradeableTo stores a single OpenShift version a workload identity cluster can + * be upgraded to. + * + * @param upgradeableTo the upgradeableTo value to set. + * @return the PlatformWorkloadIdentityProfile object itself. + */ + public PlatformWorkloadIdentityProfile withUpgradeableTo(String upgradeableTo) { + this.upgradeableTo = upgradeableTo; + return this; + } + + /** + * Get the platformWorkloadIdentities property: Dictionary of <PlatformWorkloadIdentity>. + * + * @return the platformWorkloadIdentities value. + */ + public Map platformWorkloadIdentities() { + return this.platformWorkloadIdentities; + } + + /** + * Set the platformWorkloadIdentities property: Dictionary of <PlatformWorkloadIdentity>. + * + * @param platformWorkloadIdentities the platformWorkloadIdentities value to set. + * @return the PlatformWorkloadIdentityProfile object itself. + */ + public PlatformWorkloadIdentityProfile + withPlatformWorkloadIdentities(Map platformWorkloadIdentities) { + this.platformWorkloadIdentities = platformWorkloadIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeableTo", this.upgradeableTo); + jsonWriter.writeMapField("platformWorkloadIdentities", this.platformWorkloadIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformWorkloadIdentityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformWorkloadIdentityProfile 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 PlatformWorkloadIdentityProfile. + */ + public static PlatformWorkloadIdentityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformWorkloadIdentityProfile deserializedPlatformWorkloadIdentityProfile + = new PlatformWorkloadIdentityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeableTo".equals(fieldName)) { + deserializedPlatformWorkloadIdentityProfile.upgradeableTo = reader.getString(); + } else if ("platformWorkloadIdentities".equals(fieldName)) { + Map platformWorkloadIdentities + = reader.readMap(reader1 -> PlatformWorkloadIdentity.fromJson(reader1)); + deserializedPlatformWorkloadIdentityProfile.platformWorkloadIdentities = platformWorkloadIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformWorkloadIdentityProfile; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRole.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRole.java new file mode 100644 index 000000000000..093472437fc5 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRole.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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; + +/** + * PlatformWorkloadIdentityRole represents a mapping from a particular OCP operator to the built-in role that should be + * assigned to that operator's corresponding managed identity. + */ +@Immutable +public final class PlatformWorkloadIdentityRole implements JsonSerializable { + /* + * OperatorName represents the name of the operator that this role is for. + */ + private String operatorName; + + /* + * RoleDefinitionName represents the name of the role. + */ + private String roleDefinitionName; + + /* + * RoleDefinitionID represents the resource ID of the role definition. + */ + private String roleDefinitionId; + + /** + * Creates an instance of PlatformWorkloadIdentityRole class. + */ + private PlatformWorkloadIdentityRole() { + } + + /** + * Get the operatorName property: OperatorName represents the name of the operator that this role is for. + * + * @return the operatorName value. + */ + public String operatorName() { + return this.operatorName; + } + + /** + * Get the roleDefinitionName property: RoleDefinitionName represents the name of the role. + * + * @return the roleDefinitionName value. + */ + public String roleDefinitionName() { + return this.roleDefinitionName; + } + + /** + * Get the roleDefinitionId property: RoleDefinitionID represents the resource ID of the role definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operatorName", this.operatorName); + jsonWriter.writeStringField("roleDefinitionName", this.roleDefinitionName); + jsonWriter.writeStringField("roleDefinitionId", this.roleDefinitionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformWorkloadIdentityRole from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformWorkloadIdentityRole 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 PlatformWorkloadIdentityRole. + */ + public static PlatformWorkloadIdentityRole fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformWorkloadIdentityRole deserializedPlatformWorkloadIdentityRole = new PlatformWorkloadIdentityRole(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operatorName".equals(fieldName)) { + deserializedPlatformWorkloadIdentityRole.operatorName = reader.getString(); + } else if ("roleDefinitionName".equals(fieldName)) { + deserializedPlatformWorkloadIdentityRole.roleDefinitionName = reader.getString(); + } else if ("roleDefinitionId".equals(fieldName)) { + deserializedPlatformWorkloadIdentityRole.roleDefinitionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformWorkloadIdentityRole; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSet.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSet.java new file mode 100644 index 000000000000..0af4fa3c9189 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSet.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.redhatopenshift.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import java.util.List; + +/** + * An immutable client-side representation of PlatformWorkloadIdentityRoleSet. + */ +public interface PlatformWorkloadIdentityRoleSet { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the openShiftVersion property: OpenShiftVersion represents the version associated with this set of roles. + * + * @return the openShiftVersion value. + */ + String openShiftVersion(); + + /** + * Gets the platformWorkloadIdentityRoles property: PlatformWorkloadIdentityRoles represents the set of roles + * associated with this version. + * + * @return the platformWorkloadIdentityRoles value. + */ + List platformWorkloadIdentityRoles(); + + /** + * Gets the inner com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner + * object. + * + * @return the inner object. + */ + PlatformWorkloadIdentityRoleSetInner innerModel(); +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSetOperations.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSetOperations.java new file mode 100644 index 000000000000..027304ad7d32 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSetOperations.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.redhatopenshift.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PlatformWorkloadIdentityRoleSetOperations. + */ +public interface PlatformWorkloadIdentityRoleSetOperations { + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string along with {@link Response}. + */ + Response getWithResponse(String location, String openShiftMinorVersion, + Context context); + + /** + * Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + * + * @param location The name of the Azure region. + * @param openShiftMinorVersion The desired version value of the PlatformWorkloadIdentityRoleSet resource. + * @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 mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * This operation returns Platform Workload Identity Role Set as a string. + */ + PlatformWorkloadIdentityRoleSet get(String location, String openShiftMinorVersion); +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSets.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSets.java new file mode 100644 index 000000000000..132fd16c3a30 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSets.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of PlatformWorkloadIdentityRoleSets. + */ +public interface PlatformWorkloadIdentityRoleSets { + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * Lists a mapping of OpenShift versions to identity requirements, which include operatorName, roleDefinitionName, + * roleDefinitionId, and serviceAccounts. + * + * This operation returns a list of Platform Workload Identity Role Sets as a string. + * + * @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 platformWorkloadIdentityRoleSetList represents a List of role sets as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PreconfiguredNsg.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PreconfiguredNsg.java index 078e81b57d06..fbf10abef44b 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PreconfiguredNsg.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/PreconfiguredNsg.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -12,12 +12,12 @@ */ public final class PreconfiguredNsg extends ExpandableStringEnum { /** - * Static value Disabled for PreconfiguredNsg. + * Disabled. */ public static final PreconfiguredNsg DISABLED = fromString("Disabled"); /** - * Static value Enabled for PreconfiguredNsg. + * Enabled. */ public static final PreconfiguredNsg ENABLED = fromString("Enabled"); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ProvisioningState.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ProvisioningState.java index d66b3e26b874..cf6a72b8a9e5 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ProvisioningState.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -12,37 +12,37 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value AdminUpdating for ProvisioningState. + * AdminUpdating. */ public static final ProvisioningState ADMIN_UPDATING = fromString("AdminUpdating"); /** - * Static value Canceled for ProvisioningState. + * Canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Creating for ProvisioningState. + * Creating. */ public static final ProvisioningState CREATING = fromString("Creating"); /** - * Static value Deleting for ProvisioningState. + * Deleting. */ public static final ProvisioningState DELETING = fromString("Deleting"); /** - * Static value Failed for ProvisioningState. + * Failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Succeeded for ProvisioningState. + * Succeeded. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Updating for ProvisioningState. + * Updating. */ public static final ProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secret.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secret.java deleted file mode 100644 index e891bd703c5f..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secret.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SecretInner; - -/** - * An immutable client-side representation of Secret. - */ -public interface Secret { - /** - * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the secretResources property: The Secrets Resources. - * - * @return the secretResources value. - */ - String secretResources(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.redhatopenshift.fluent.models.SecretInner object. - * - * @return the inner object. - */ - SecretInner innerModel(); - - /** - * The entirety of the Secret definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Secret definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Secret definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Secret definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @return the next definition stage. - */ - WithCreate withExistingOpenshiftcluster(String resourceGroupName, String resourceName); - } - - /** - * The stage of the Secret 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.WithSecretResources { - /** - * Executes the create request. - * - * @return the created resource. - */ - Secret create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Secret create(Context context); - } - - /** - * The stage of the Secret definition allowing to specify secretResources. - */ - interface WithSecretResources { - /** - * Specifies the secretResources property: The Secrets Resources.. - * - * @param secretResources The Secrets Resources. - * @return the next definition stage. - */ - WithCreate withSecretResources(String secretResources); - } - } - - /** - * Begins update for the Secret resource. - * - * @return the stage of resource update. - */ - Secret.Update update(); - - /** - * The template for Secret update. - */ - interface Update extends UpdateStages.WithSecretResources { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Secret apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Secret apply(Context context); - } - - /** - * The Secret update stages. - */ - interface UpdateStages { - /** - * The stage of the Secret update allowing to specify secretResources. - */ - interface WithSecretResources { - /** - * Specifies the secretResources property: The Secrets Resources.. - * - * @param secretResources The Secrets Resources. - * @return the next definition stage. - */ - Update withSecretResources(String secretResources); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Secret refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Secret refresh(Context context); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretList.java deleted file mode 100644 index 36516eb128a4..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretList.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 com.azure.resourcemanager.redhatopenshift.fluent.models.SecretInner; -import java.io.IOException; -import java.util.List; - -/** - * SecretList represents a list of Secrets. - */ -@Fluent -public final class SecretList implements JsonSerializable { - /* - * The list of secrets. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of SecretList class. - */ - public SecretList() { - } - - /** - * Get the value property: The list of secrets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of secrets. - * - * @param value the value value to set. - * @return the SecretList object itself. - */ - public SecretList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the SecretList object itself. - */ - public SecretList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 SecretList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecretList 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 SecretList. - */ - public static SecretList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecretList deserializedSecretList = new SecretList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SecretInner.fromJson(reader1)); - deserializedSecretList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecretList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecretList; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretUpdate.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretUpdate.java deleted file mode 100644 index 512009208e6b..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SecretUpdate.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SecretProperties; -import java.io.IOException; - -/** - * Secret represents a secret. - */ -@Fluent -public final class SecretUpdate implements JsonSerializable { - /* - * The Secret Properties - */ - private SecretProperties innerProperties; - - /* - * The system meta data relating to this resource. - */ - private SystemData systemData; - - /** - * Creates an instance of SecretUpdate class. - */ - public SecretUpdate() { - } - - /** - * Get the innerProperties property: The Secret Properties. - * - * @return the innerProperties value. - */ - private SecretProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the secretResources property: The Secrets Resources. - * - * @return the secretResources value. - */ - public String secretResources() { - return this.innerProperties() == null ? null : this.innerProperties().secretResources(); - } - - /** - * Set the secretResources property: The Secrets Resources. - * - * @param secretResources the secretResources value to set. - * @return the SecretUpdate object itself. - */ - public SecretUpdate withSecretResources(String secretResources) { - if (this.innerProperties() == null) { - this.innerProperties = new SecretProperties(); - } - this.innerProperties().withSecretResources(secretResources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecretUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecretUpdate 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 SecretUpdate. - */ - public static SecretUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecretUpdate deserializedSecretUpdate = new SecretUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedSecretUpdate.innerProperties = SecretProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecretUpdate.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecretUpdate; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secrets.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secrets.java deleted file mode 100644 index a3136180a344..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Secrets.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 Secrets. - */ -public interface Secrets { - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 secretList represents a list of Secrets as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secretList represents a list of Secrets as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret represents a secret along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @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 secret represents a secret. - */ - Secret get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the Secret resource. - * @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 resourceName, String childResourceName); - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @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 secret represents a secret along with {@link Response}. - */ - Secret getById(String id); - - /** - * Gets a Secret with the specified subscription, resource group and resource name. - * - * The operation returns properties of a Secret. - * - * @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 secret represents a secret along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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); - - /** - * Deletes a Secret with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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 the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Secret resource. - * - * @param name resource name. - * @return the first stage of the new Secret definition. - */ - Secret.DefinitionStages.Blank define(String name); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ServicePrincipalProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ServicePrincipalProfile.java index d4c3c65b6c72..f9079e228a29 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ServicePrincipalProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/ServicePrincipalProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -72,14 +72,6 @@ public ServicePrincipalProfile withClientSecret(String clientSecret) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProvider.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProvider.java deleted file mode 100644 index d0013e2594cd..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProvider.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; - -/** - * An immutable client-side representation of SyncIdentityProvider. - */ -public interface SyncIdentityProvider { - /** - * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the resources property: The resources property. - * - * @return the resources value. - */ - String resources(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner object. - * - * @return the inner object. - */ - SyncIdentityProviderInner innerModel(); - - /** - * The entirety of the SyncIdentityProvider definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The SyncIdentityProvider definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the SyncIdentityProvider definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the SyncIdentityProvider definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @return the next definition stage. - */ - WithCreate withExistingOpenshiftcluster(String resourceGroupName, String resourceName); - } - - /** - * The stage of the SyncIdentityProvider 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.WithResources { - /** - * Executes the create request. - * - * @return the created resource. - */ - SyncIdentityProvider create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SyncIdentityProvider create(Context context); - } - - /** - * The stage of the SyncIdentityProvider definition allowing to specify resources. - */ - interface WithResources { - /** - * Specifies the resources property: The resources property.. - * - * @param resources The resources property. - * @return the next definition stage. - */ - WithCreate withResources(String resources); - } - } - - /** - * Begins update for the SyncIdentityProvider resource. - * - * @return the stage of resource update. - */ - SyncIdentityProvider.Update update(); - - /** - * The template for SyncIdentityProvider update. - */ - interface Update extends UpdateStages.WithResources { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SyncIdentityProvider apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SyncIdentityProvider apply(Context context); - } - - /** - * The SyncIdentityProvider update stages. - */ - interface UpdateStages { - /** - * The stage of the SyncIdentityProvider update allowing to specify resources. - */ - interface WithResources { - /** - * Specifies the resources property: The resources property.. - * - * @param resources The resources property. - * @return the next definition stage. - */ - Update withResources(String resources); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SyncIdentityProvider refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SyncIdentityProvider refresh(Context context); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderList.java deleted file mode 100644 index 82b05c39eb38..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderList.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import java.io.IOException; -import java.util.List; - -/** - * SyncSetList represents a list of SyncSets. - */ -@Fluent -public final class SyncIdentityProviderList implements JsonSerializable { - /* - * The list of sync identity providers - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of SyncIdentityProviderList class. - */ - public SyncIdentityProviderList() { - } - - /** - * Get the value property: The list of sync identity providers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of sync identity providers. - * - * @param value the value value to set. - * @return the SyncIdentityProviderList object itself. - */ - public SyncIdentityProviderList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the SyncIdentityProviderList object itself. - */ - public SyncIdentityProviderList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 SyncIdentityProviderList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncIdentityProviderList 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 SyncIdentityProviderList. - */ - public static SyncIdentityProviderList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncIdentityProviderList deserializedSyncIdentityProviderList = new SyncIdentityProviderList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SyncIdentityProviderInner.fromJson(reader1)); - deserializedSyncIdentityProviderList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSyncIdentityProviderList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncIdentityProviderList; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderUpdate.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderUpdate.java deleted file mode 100644 index 7049521678d6..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviderUpdate.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderProperties; -import java.io.IOException; - -/** - * SyncIdentityProvider represents a SyncIdentityProvider. - */ -@Fluent -public final class SyncIdentityProviderUpdate implements JsonSerializable { - /* - * The SyncIdentityProvider Properties - */ - private SyncIdentityProviderProperties innerProperties; - - /* - * The system meta data relating to this resource. - */ - private SystemData systemData; - - /** - * Creates an instance of SyncIdentityProviderUpdate class. - */ - public SyncIdentityProviderUpdate() { - } - - /** - * Get the innerProperties property: The SyncIdentityProvider Properties. - * - * @return the innerProperties value. - */ - private SyncIdentityProviderProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the resources property: The resources property. - * - * @return the resources value. - */ - public String resources() { - return this.innerProperties() == null ? null : this.innerProperties().resources(); - } - - /** - * Set the resources property: The resources property. - * - * @param resources the resources value to set. - * @return the SyncIdentityProviderUpdate object itself. - */ - public SyncIdentityProviderUpdate withResources(String resources) { - if (this.innerProperties() == null) { - this.innerProperties = new SyncIdentityProviderProperties(); - } - this.innerProperties().withResources(resources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SyncIdentityProviderUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncIdentityProviderUpdate 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 SyncIdentityProviderUpdate. - */ - public static SyncIdentityProviderUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncIdentityProviderUpdate deserializedSyncIdentityProviderUpdate = new SyncIdentityProviderUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedSyncIdentityProviderUpdate.innerProperties - = SyncIdentityProviderProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSyncIdentityProviderUpdate.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncIdentityProviderUpdate; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviders.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviders.java deleted file mode 100644 index 5c0ec440e0ba..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncIdentityProviders.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 SyncIdentityProviders. - */ -public interface SyncIdentityProviders { - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context); - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @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 syncIdentityProvider represents a SyncIdentityProvider. - */ - SyncIdentityProvider get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncIdentityProvider resource. - * @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 resourceName, String childResourceName); - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @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 syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - SyncIdentityProvider getById(String id); - - /** - * Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncIdentityProvider. - * - * @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 syncIdentityProvider represents a SyncIdentityProvider along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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); - - /** - * Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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 the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SyncIdentityProvider resource. - * - * @param name resource name. - * @return the first stage of the new SyncIdentityProvider definition. - */ - SyncIdentityProvider.DefinitionStages.Blank define(String name); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSet.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSet.java deleted file mode 100644 index ddd132423018..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSet.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; - -/** - * An immutable client-side representation of SyncSet. - */ -public interface SyncSet { - /** - * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the resources property: Resources represents the SyncSets configuration. - * - * @return the resources value. - */ - String resources(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner object. - * - * @return the inner object. - */ - SyncSetInner innerModel(); - - /** - * The entirety of the SyncSet definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The SyncSet definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the SyncSet definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the SyncSet definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @return the next definition stage. - */ - WithCreate withExistingOpenshiftcluster(String resourceGroupName, String resourceName); - } - - /** - * The stage of the SyncSet 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.WithResources { - /** - * Executes the create request. - * - * @return the created resource. - */ - SyncSet create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SyncSet create(Context context); - } - - /** - * The stage of the SyncSet definition allowing to specify resources. - */ - interface WithResources { - /** - * Specifies the resources property: Resources represents the SyncSets configuration.. - * - * @param resources Resources represents the SyncSets configuration. - * @return the next definition stage. - */ - WithCreate withResources(String resources); - } - } - - /** - * Begins update for the SyncSet resource. - * - * @return the stage of resource update. - */ - SyncSet.Update update(); - - /** - * The template for SyncSet update. - */ - interface Update extends UpdateStages.WithResources { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SyncSet apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SyncSet apply(Context context); - } - - /** - * The SyncSet update stages. - */ - interface UpdateStages { - /** - * The stage of the SyncSet update allowing to specify resources. - */ - interface WithResources { - /** - * Specifies the resources property: Resources represents the SyncSets configuration.. - * - * @param resources Resources represents the SyncSets configuration. - * @return the next definition stage. - */ - Update withResources(String resources); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SyncSet refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SyncSet refresh(Context context); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetList.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetList.java deleted file mode 100644 index a5023ee3b59f..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetList.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; -import java.io.IOException; -import java.util.List; - -/** - * SyncSetList represents a list of SyncSets. - */ -@Fluent -public final class SyncSetList implements JsonSerializable { - /* - * The list of syncsets. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of SyncSetList class. - */ - public SyncSetList() { - } - - /** - * Get the value property: The list of syncsets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of syncsets. - * - * @param value the value value to set. - * @return the SyncSetList object itself. - */ - public SyncSetList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the SyncSetList object itself. - */ - public SyncSetList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 SyncSetList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncSetList 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 SyncSetList. - */ - public static SyncSetList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncSetList deserializedSyncSetList = new SyncSetList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SyncSetInner.fromJson(reader1)); - deserializedSyncSetList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSyncSetList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncSetList; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetUpdate.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetUpdate.java deleted file mode 100644 index cd8551249afa..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSetUpdate.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetProperties; -import java.io.IOException; - -/** - * SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ -@Fluent -public final class SyncSetUpdate implements JsonSerializable { - /* - * The Syncsets properties - */ - private SyncSetProperties innerProperties; - - /* - * The system meta data relating to this resource. - */ - private SystemData systemData; - - /** - * Creates an instance of SyncSetUpdate class. - */ - public SyncSetUpdate() { - } - - /** - * Get the innerProperties property: The Syncsets properties. - * - * @return the innerProperties value. - */ - private SyncSetProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the resources property: Resources represents the SyncSets configuration. - * - * @return the resources value. - */ - public String resources() { - return this.innerProperties() == null ? null : this.innerProperties().resources(); - } - - /** - * Set the resources property: Resources represents the SyncSets configuration. - * - * @param resources the resources value to set. - * @return the SyncSetUpdate object itself. - */ - public SyncSetUpdate withResources(String resources) { - if (this.innerProperties() == null) { - this.innerProperties = new SyncSetProperties(); - } - this.innerProperties().withResources(resources); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SyncSetUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SyncSetUpdate 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 SyncSetUpdate. - */ - public static SyncSetUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SyncSetUpdate deserializedSyncSetUpdate = new SyncSetUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedSyncSetUpdate.innerProperties = SyncSetProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSyncSetUpdate.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSyncSetUpdate; - }); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSets.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSets.java deleted file mode 100644 index 32c854abfa91..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/SyncSets.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.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 SyncSets. - */ -public interface SyncSets { - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @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 syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * The operation returns properties of each SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSetList represents a list of SyncSets as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @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 syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - */ - SyncSet get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the OpenShift cluster resource. - * @param childResourceName The name of the SyncSet resource. - * @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 resourceName, String childResourceName); - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @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 syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - SyncSet getById(String id); - - /** - * Gets a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns properties of a SyncSet. - * - * @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 syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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); - - /** - * Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * The operation returns nothing. - * - * @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 the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SyncSet resource. - * - * @param name resource name. - * @return the first stage of the new SyncSet definition. - */ - SyncSet.DefinitionStages.Blank define(String name); -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/UserAssignedIdentity.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..e93a61dd0bc8 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.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; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Visibility.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Visibility.java index e7d11d948a2a..74bb97edeece 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Visibility.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/Visibility.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -12,12 +12,12 @@ */ public final class Visibility extends ExpandableStringEnum { /** - * Static value Private for Visibility. + * Private. */ public static final Visibility PRIVATE = fromString("Private"); /** - * Static value Public for Visibility. + * Public. */ public static final Visibility PUBLIC = fromString("Public"); diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/WorkerProfile.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/WorkerProfile.java index b3fa76079d30..70365addbcd2 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/WorkerProfile.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/WorkerProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.models; @@ -197,14 +197,6 @@ public WorkerProfile withDiskEncryptionSetId(String diskEncryptionSetId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/package-info.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/package-info.java index 8eaec011972c..9e2724f350a7 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/package-info.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AzureRedHatOpenShiftClient. + * Package containing the data models for RedHatOpenShift. * Rest API for Azure Red Hat OpenShift 4. */ package com.azure.resourcemanager.redhatopenshift.models; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/package-info.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/package-info.java index 8ce48a5d2d6d..2e3cc9152d61 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/package-info.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/com/azure/resourcemanager/redhatopenshift/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for AzureRedHatOpenShiftClient. + * Package containing the classes for RedHatOpenShift. * Rest API for Azure Red Hat OpenShift 4. */ package com.azure.resourcemanager.redhatopenshift; diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/module-info.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/module-info.java index 2c3d743ca69b..acadd0b3d01f 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/module-info.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.redhatopenshift { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.redhatopenshift.fluent.models to com.azure.core; opens com.azure.resourcemanager.redhatopenshift.models to com.azure.core; + opens com.azure.resourcemanager.redhatopenshift.implementation.models to com.azure.core; } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/azure-resourcemanager-redhatopenshift_metadata.json b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/azure-resourcemanager-redhatopenshift_metadata.json new file mode 100644 index 000000000000..6c5107383046 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/azure-resourcemanager-redhatopenshift_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.RedHatOpenShift":"2025-07-25"},"crossLanguagePackageId":"Microsoft.RedHatOpenShift","crossLanguageVersion":"52ce5d65cb6b","crossLanguageDefinitions":{"com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient":"Microsoft.RedHatOpenShift.OpenShiftClusters","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.beginCreateOrUpdate":"Microsoft.RedHatOpenShift.OpenShiftClusters.createOrUpdate","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.beginDelete":"Microsoft.RedHatOpenShift.OpenShiftClusters.delete","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.beginUpdate":"Microsoft.RedHatOpenShift.OpenShiftClusters.update","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.createOrUpdate":"Microsoft.RedHatOpenShift.OpenShiftClusters.createOrUpdate","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.delete":"Microsoft.RedHatOpenShift.OpenShiftClusters.delete","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.getByResourceGroup":"Microsoft.RedHatOpenShift.OpenShiftClusters.get","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.getByResourceGroupWithResponse":"Microsoft.RedHatOpenShift.OpenShiftClusters.get","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.list":"Microsoft.RedHatOpenShift.OpenShiftClusters.list","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.listAdminCredentials":"Microsoft.RedHatOpenShift.OpenShiftClusters.listAdminCredentials","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.listAdminCredentialsWithResponse":"Microsoft.RedHatOpenShift.OpenShiftClusters.listAdminCredentials","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.listByResourceGroup":"Microsoft.RedHatOpenShift.OpenShiftClusters.listByResourceGroup","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.listCredentials":"Microsoft.RedHatOpenShift.OpenShiftClusters.listCredentials","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.listCredentialsWithResponse":"Microsoft.RedHatOpenShift.OpenShiftClusters.listCredentials","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftClustersClient.update":"Microsoft.RedHatOpenShift.OpenShiftClusters.update","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftVersionsClient":"Microsoft.RedHatOpenShift.OpenShiftVersions","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftVersionsClient.get":"Microsoft.RedHatOpenShift.OpenShiftVersions.get","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftVersionsClient.getWithResponse":"Microsoft.RedHatOpenShift.OpenShiftVersions.get","com.azure.resourcemanager.redhatopenshift.fluent.OpenShiftVersionsClient.list":"Microsoft.RedHatOpenShift.OpenShiftVersions.list","com.azure.resourcemanager.redhatopenshift.fluent.OperationsClient":"Microsoft.RedHatOpenShift.Operations","com.azure.resourcemanager.redhatopenshift.fluent.OperationsClient.list":"Azure.ResourceManager.Legacy.Operations.list","com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetOperationsClient":"Microsoft.RedHatOpenShift","com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetOperationsClient.get":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSets.get","com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetOperationsClient.getWithResponse":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSets.get","com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetsClient":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSets","com.azure.resourcemanager.redhatopenshift.fluent.PlatformWorkloadIdentityRoleSetsClient.list":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSets.list","com.azure.resourcemanager.redhatopenshift.fluent.RedHatOpenShiftManagementClient":"Microsoft.RedHatOpenShift","com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterAdminKubeconfigInner":"Microsoft.RedHatOpenShift.OpenShiftClusterAdminKubeconfig","com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterCredentialsInner":"Microsoft.RedHatOpenShift.OpenShiftClusterCredentials","com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterInner":"Microsoft.RedHatOpenShift.OpenShiftCluster","com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftClusterProperties":"Microsoft.RedHatOpenShift.OpenShiftClusterProperties","com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftVersionInner":"Microsoft.RedHatOpenShift.OpenShiftVersion","com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftVersionProperties":"Microsoft.RedHatOpenShift.OpenShiftVersionProperties","com.azure.resourcemanager.redhatopenshift.fluent.models.OperationInner":"Microsoft.RedHatOpenShift.Operation","com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSet","com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetProperties":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSetProperties","com.azure.resourcemanager.redhatopenshift.implementation.RedHatOpenShiftManagementClientBuilder":"Microsoft.RedHatOpenShift","com.azure.resourcemanager.redhatopenshift.implementation.models.OpenShiftClusterList":"Microsoft.RedHatOpenShift.OpenShiftClusterList","com.azure.resourcemanager.redhatopenshift.implementation.models.OpenShiftVersionList":"Microsoft.RedHatOpenShift.OpenShiftVersionList","com.azure.resourcemanager.redhatopenshift.implementation.models.OperationList":"Microsoft.RedHatOpenShift.OperationList","com.azure.resourcemanager.redhatopenshift.implementation.models.PlatformWorkloadIdentityRoleSetList":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRoleSetList","com.azure.resourcemanager.redhatopenshift.models.ApiServerProfile":"Microsoft.RedHatOpenShift.APIServerProfile","com.azure.resourcemanager.redhatopenshift.models.ClusterProfile":"Microsoft.RedHatOpenShift.ClusterProfile","com.azure.resourcemanager.redhatopenshift.models.ConsoleProfile":"Microsoft.RedHatOpenShift.ConsoleProfile","com.azure.resourcemanager.redhatopenshift.models.Display":"Microsoft.RedHatOpenShift.Display","com.azure.resourcemanager.redhatopenshift.models.EffectiveOutboundIp":"Microsoft.RedHatOpenShift.EffectiveOutboundIP","com.azure.resourcemanager.redhatopenshift.models.EncryptionAtHost":"Microsoft.RedHatOpenShift.EncryptionAtHost","com.azure.resourcemanager.redhatopenshift.models.FipsValidatedModules":"Microsoft.RedHatOpenShift.FipsValidatedModules","com.azure.resourcemanager.redhatopenshift.models.IngressProfile":"Microsoft.RedHatOpenShift.IngressProfile","com.azure.resourcemanager.redhatopenshift.models.LoadBalancerProfile":"Microsoft.RedHatOpenShift.LoadBalancerProfile","com.azure.resourcemanager.redhatopenshift.models.ManagedOutboundIPs":"Microsoft.RedHatOpenShift.ManagedOutboundIPs","com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.redhatopenshift.models.MasterProfile":"Microsoft.RedHatOpenShift.MasterProfile","com.azure.resourcemanager.redhatopenshift.models.NetworkProfile":"Microsoft.RedHatOpenShift.NetworkProfile","com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterUpdate":"Microsoft.RedHatOpenShift.OpenShiftClusterUpdate","com.azure.resourcemanager.redhatopenshift.models.OutboundType":"Microsoft.RedHatOpenShift.OutboundType","com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentity","com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityProfile","com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRole":"Microsoft.RedHatOpenShift.PlatformWorkloadIdentityRole","com.azure.resourcemanager.redhatopenshift.models.PreconfiguredNsg":"Microsoft.RedHatOpenShift.PreconfiguredNSG","com.azure.resourcemanager.redhatopenshift.models.ProvisioningState":"Microsoft.RedHatOpenShift.ProvisioningState","com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile":"Microsoft.RedHatOpenShift.ServicePrincipalProfile","com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.redhatopenshift.models.Visibility":"Microsoft.RedHatOpenShift.Visibility","com.azure.resourcemanager.redhatopenshift.models.WorkerProfile":"Microsoft.RedHatOpenShift.WorkerProfile"},"generatedFiles":["src/main/java/com/azure/resourcemanager/redhatopenshift/RedHatOpenShiftManager.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftClustersClient.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OpenShiftVersionsClient.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetOperationsClient.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/PlatformWorkloadIdentityRoleSetsClient.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/RedHatOpenShiftManagementClient.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterAdminKubeconfigInner.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterCredentialsInner.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterInner.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftClusterProperties.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionInner.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OpenShiftVersionProperties.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetInner.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/PlatformWorkloadIdentityRoleSetProperties.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/redhatopenshift/fluent/package-info.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterAdminKubeconfigImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterCredentialsImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClusterImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersClientImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftClustersImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OpenShiftVersionsImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetOperationsImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsClientImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/PlatformWorkloadIdentityRoleSetsImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/RedHatOpenShiftManagementClientImpl.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftClusterList.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OpenShiftVersionList.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/OperationList.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/models/PlatformWorkloadIdentityRoleSetList.java","src/main/java/com/azure/resourcemanager/redhatopenshift/implementation/package-info.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ApiServerProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ClusterProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ConsoleProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/Display.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/EffectiveOutboundIp.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/EncryptionAtHost.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/FipsValidatedModules.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/IngressProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/LoadBalancerProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedOutboundIPs.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/MasterProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/NetworkProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftCluster.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterAdminKubeconfig.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterCredentials.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusterUpdate.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftClusters.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersion.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OpenShiftVersions.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operation.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/Operations.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/OutboundType.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentity.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRole.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSet.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSetOperations.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PlatformWorkloadIdentityRoleSets.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/PreconfiguredNsg.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/ServicePrincipalProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/Visibility.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/WorkerProfile.java","src/main/java/com/azure/resourcemanager/redhatopenshift/models/package-info.java","src/main/java/com/azure/resourcemanager/redhatopenshift/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redhatopenshift/proxy-config.json b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redhatopenshift/proxy-config.json index 1a12897a8541..4cdd4e81a2fd 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redhatopenshift/proxy-config.json +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redhatopenshift/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.redhatopenshift.implementation.MachinePoolsClientImpl$MachinePoolsService"],["com.azure.resourcemanager.redhatopenshift.implementation.OpenShiftClustersClientImpl$OpenShiftClustersService"],["com.azure.resourcemanager.redhatopenshift.implementation.OpenShiftVersionsClientImpl$OpenShiftVersionsService"],["com.azure.resourcemanager.redhatopenshift.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.redhatopenshift.implementation.SecretsClientImpl$SecretsService"],["com.azure.resourcemanager.redhatopenshift.implementation.SyncIdentityProvidersClientImpl$SyncIdentityProvidersService"],["com.azure.resourcemanager.redhatopenshift.implementation.SyncSetsClientImpl$SyncSetsService"]] \ No newline at end of file +[["com.azure.resourcemanager.redhatopenshift.implementation.OpenShiftClustersClientImpl$OpenShiftClustersService"],["com.azure.resourcemanager.redhatopenshift.implementation.OpenShiftVersionsClientImpl$OpenShiftVersionsService"],["com.azure.resourcemanager.redhatopenshift.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.redhatopenshift.implementation.PlatformWorkloadIdentityRoleSetOperationsClientImpl$PlatformWorkloadIdentityRoleSetOperationsService"],["com.azure.resourcemanager.redhatopenshift.implementation.PlatformWorkloadIdentityRoleSetsClientImpl$PlatformWorkloadIdentityRoleSetsService"]] \ No newline at end of file diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/azure-resourcemanager-redhatopenshift.properties b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/azure-resourcemanager-redhatopenshift.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/main/resources/azure-resourcemanager-redhatopenshift.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateSamples.java deleted file mode 100644 index 8863b6512ff6..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for MachinePools CreateOrUpdate. - */ -public final class MachinePoolsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K") - .create(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteSamples.java deleted file mode 100644 index 05f077f9c7f2..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for MachinePools Delete. - */ -public final class MachinePoolsDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_Delete.json - */ - /** - * Sample code: Deletes a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetSamples.java deleted file mode 100644 index c254b8b5d4e9..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for MachinePools Get. - */ -public final class MachinePoolsGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_Get.json - */ - /** - * Sample code: Gets a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListSamples.java deleted file mode 100644 index 0b05150137fd..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for MachinePools List. - */ -public final class MachinePoolsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_List.json - */ - /** - * Sample code: Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsMachinePoolsThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.machinePools().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsUpdateSamples.java deleted file mode 100644 index 77be3efc298e..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsUpdateSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; - -/** - * Samples for MachinePools Update. - */ -public final class MachinePoolsUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/MachinePools_Update.json - */ - /** - * Sample code: Updates a MachinePool with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesAMachinePoolWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - MachinePool resource = manager.machinePools() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K") - .apply(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersCreateOrUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersCreateOrUpdateSamples.java index b876de73443d..09075832f5c5 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersCreateOrUpdateSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -12,10 +12,15 @@ import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; import com.azure.resourcemanager.redhatopenshift.models.LoadBalancerProfile; import com.azure.resourcemanager.redhatopenshift.models.ManagedOutboundIPs; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.PreconfiguredNsg; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; +import com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity; import com.azure.resourcemanager.redhatopenshift.models.Visibility; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; import java.util.Arrays; @@ -27,9 +32,7 @@ */ public final class OpenShiftClustersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_CreateOrUpdate.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_CreateOrUpdate.json */ /** * Sample code: Creates or updates a OpenShift cluster with the specified subscription, resource group and resource @@ -44,13 +47,18 @@ public static void createsOrUpdatesAOpenShiftClusterWithTheSpecifiedSubscription .withRegion("location") .withExistingResourceGroup("resourceGroup") .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("", new UserAssignedIdentity()))) .withClusterProfile(new ClusterProfile().withPullSecret("fakeTokenPlaceholder") .withDomain("cluster.location.aroapp.io") - .withResourceGroupId("/subscriptions/subscriptionId/resourceGroups/clusterResourceGroup") + .withResourceGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clusterResourceGroup") .withFipsValidatedModules(FipsValidatedModules.ENABLED)) .withConsoleProfile(new ConsoleProfile()) .withServicePrincipalProfile( new ServicePrincipalProfile().withClientId("clientId").withClientSecret("fakeTokenPlaceholder")) + .withPlatformWorkloadIdentityProfile(new PlatformWorkloadIdentityProfile() + .withPlatformWorkloadIdentities(mapOf("", new PlatformWorkloadIdentity()))) .withNetworkProfile(new NetworkProfile().withPodCidr("10.128.0.0/14") .withServiceCidr("172.30.0.0/16") .withLoadBalancerProfile( @@ -58,13 +66,13 @@ public static void createsOrUpdatesAOpenShiftClusterWithTheSpecifiedSubscription .withPreconfiguredNsg(PreconfiguredNsg.DISABLED)) .withMasterProfile(new MasterProfile().withVmSize("Standard_D8s_v3") .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") .withEncryptionAtHost(EncryptionAtHost.ENABLED)) .withWorkerProfiles(Arrays.asList(new WorkerProfile().withName("worker") .withVmSize("Standard_D2s_v3") .withDiskSizeGB(128) .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") .withCount(3))) .withApiserverProfile(new ApiServerProfile().withVisibility(Visibility.PUBLIC)) .withIngressProfiles( diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersDeleteSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersDeleteSamples.java index 9e9a5917d236..2a50c79218de 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersDeleteSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftClustersDeleteSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_Delete.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_Delete.json */ /** * Sample code: Deletes a OpenShift cluster with the specified subscription, resource group and resource name. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersGetByResourceGroupSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersGetByResourceGroupSamples.java index 982d7465f4aa..f52d62ca1b16 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersGetByResourceGroupSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftClustersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_Get.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_Get.json */ /** * Sample code: Gets a OpenShift cluster with the specified subscription, resource group and resource name. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsSamples.java index 8ac890f7ce2b..f45fed4cdb2d 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftClustersListAdminCredentialsSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_ListAdminCredentials.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_ListAdminCredentials.json */ /** * Sample code: Lists admin kubeconfig of an OpenShift cluster with the specified subscription, resource group and diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListByResourceGroupSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListByResourceGroupSamples.java index 0da100882fea..1d7bf115a297 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListByResourceGroupSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftClustersListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_ListByResourceGroup.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_ListByResourceGroup.json */ /** * Sample code: Lists OpenShift clusters in the specified subscription and resource group. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListCredentialsSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListCredentialsSamples.java index 848f9de44f9e..5871bb380e37 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListCredentialsSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListCredentialsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftClustersListCredentialsSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_ListCredentials.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_ListCredentials.json */ /** * Sample code: Lists credentials of an OpenShift cluster with the specified subscription, resource group and diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListSamples.java index 8ec10c00e16a..45c70497149f 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftClustersListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_List.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_List.json */ /** * Sample code: Lists OpenShift clusters in the specified subscription. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersUpdateSamples.java index ad3ca205b8b8..93a4713dfb23 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersUpdateSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -12,11 +12,16 @@ import com.azure.resourcemanager.redhatopenshift.models.IngressProfile; import com.azure.resourcemanager.redhatopenshift.models.LoadBalancerProfile; import com.azure.resourcemanager.redhatopenshift.models.ManagedOutboundIPs; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redhatopenshift.models.MasterProfile; import com.azure.resourcemanager.redhatopenshift.models.NetworkProfile; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftCluster; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; import com.azure.resourcemanager.redhatopenshift.models.PreconfiguredNsg; import com.azure.resourcemanager.redhatopenshift.models.ServicePrincipalProfile; +import com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity; import com.azure.resourcemanager.redhatopenshift.models.Visibility; import com.azure.resourcemanager.redhatopenshift.models.WorkerProfile; import java.util.Arrays; @@ -28,29 +33,33 @@ */ public final class OpenShiftClustersUpdateSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftClusters_Update.json + * x-ms-original-file: 2025-07-25/OpenShiftClusters_Update.json */ /** - * Sample code: Updates a OpenShift cluster with the specified subscription, resource group and resource name. + * Sample code: Creates or updates a OpenShift cluster with the specified subscription, resource group and resource + * name. * * @param manager Entry point to RedHatOpenShiftManager. */ - public static void updatesAOpenShiftClusterWithTheSpecifiedSubscriptionResourceGroupAndResourceName( + public static void createsOrUpdatesAOpenShiftClusterWithTheSpecifiedSubscriptionResourceGroupAndResourceName( com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { OpenShiftCluster resource = manager.openShiftClusters() .getByResourceGroupWithResponse("resourceGroup", "resourceName", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("", new UserAssignedIdentity()))) .withClusterProfile(new ClusterProfile().withPullSecret("fakeTokenPlaceholder") .withDomain("cluster.location.aroapp.io") - .withResourceGroupId("/subscriptions/subscriptionId/resourceGroups/clusterResourceGroup") + .withResourceGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clusterResourceGroup") .withFipsValidatedModules(FipsValidatedModules.ENABLED)) .withConsoleProfile(new ConsoleProfile()) .withServicePrincipalProfile( new ServicePrincipalProfile().withClientId("clientId").withClientSecret("fakeTokenPlaceholder")) + .withPlatformWorkloadIdentityProfile(new PlatformWorkloadIdentityProfile() + .withPlatformWorkloadIdentities(mapOf("", new PlatformWorkloadIdentity()))) .withNetworkProfile(new NetworkProfile().withPodCidr("10.128.0.0/14") .withServiceCidr("172.30.0.0/16") .withLoadBalancerProfile( @@ -58,13 +67,13 @@ public static void updatesAOpenShiftClusterWithTheSpecifiedSubscriptionResourceG .withPreconfiguredNsg(PreconfiguredNsg.DISABLED)) .withMasterProfile(new MasterProfile().withVmSize("Standard_D8s_v3") .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/master") .withEncryptionAtHost(EncryptionAtHost.ENABLED)) .withWorkerProfiles(Arrays.asList(new WorkerProfile().withName("worker") .withVmSize("Standard_D2s_v3") .withDiskSizeGB(128) .withSubnetId( - "/subscriptions/subscriptionId/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vnetResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet/subnets/worker") .withCount(3))) .withApiserverProfile(new ApiServerProfile().withVisibility(Visibility.PUBLIC)) .withIngressProfiles( diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetSamples.java new file mode 100644 index 000000000000..2d513d2bd2d4 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +/** + * Samples for OpenShiftVersions Get. + */ +public final class OpenShiftVersionsGetSamples { + /* + * x-ms-original-file: 2025-07-25/OpenShiftVersions_Get.json + */ + /** + * Sample code: Gets an available OpenShift version to install in the specified location. + * + * @param manager Entry point to RedHatOpenShiftManager. + */ + public static void getsAnAvailableOpenShiftVersionToInstallInTheSpecifiedLocation( + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { + manager.openShiftVersions().getWithResponse("location", "4.14.40", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListSamples.java index 8f75247a2444..ab973725bba6 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OpenShiftVersionsListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/OpenShiftVersions_List.json + * x-ms-original-file: 2025-07-25/OpenShiftVersions_List.json */ /** * Sample code: Lists all OpenShift versions available to install in the specified location. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListSamples.java index 615dfabe0bbd..7769f3c2787b 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListSamples.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Operations_List.json + * x-ms-original-file: 2025-07-25/Operations_List.json */ /** * Sample code: Lists all of the available RP operations. diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationGetSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationGetSamples.java new file mode 100644 index 000000000000..865b75ffa4b1 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +/** + * Samples for PlatformWorkloadIdentityRoleSetOperation Get. + */ +public final class PlatformWorkloadIdentityRoleSetOperationGetSamples { + /* + * x-ms-original-file: 2025-07-25/PlatformWorkloadIdentityRoleSet_Get.json + */ + /** + * Sample code: Gets a mapping of an OpenShift version to identity requirements, which includes operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * @param manager Entry point to RedHatOpenShiftManager. + */ + public static void + getsAMappingOfAnOpenShiftVersionToIdentityRequirementsWhichIncludesOperatorNameRoleDefinitionNameRoleDefinitionIdAndServiceAccounts( + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { + manager.platformWorkloadIdentityRoleSetOperations() + .getWithResponse("location", "4.14", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListSamples.java new file mode 100644 index 000000000000..e592c62a363d --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +/** + * Samples for PlatformWorkloadIdentityRoleSets List. + */ +public final class PlatformWorkloadIdentityRoleSetsListSamples { + /* + * x-ms-original-file: 2025-07-25/PlatformWorkloadIdentityRoleSets_List.json + */ + /** + * Sample code: Lists a mapping of OpenShift versions to identity requirements, which include operatorName, + * roleDefinitionName, roleDefinitionId, and serviceAccounts. + * + * @param manager Entry point to RedHatOpenShiftManager. + */ + public static void + listsAMappingOfOpenShiftVersionsToIdentityRequirementsWhichIncludeOperatorNameRoleDefinitionNameRoleDefinitionIdAndServiceAccounts( + com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { + manager.platformWorkloadIdentityRoleSets().list("location", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsCreateOrUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsCreateOrUpdateSamples.java deleted file mode 100644 index 89d1c9c6bc68..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsCreateOrUpdateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for Secrets CreateOrUpdate. - */ -public final class SecretsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .create(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteSamples.java deleted file mode 100644 index 28981deb7377..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for Secrets Delete. - */ -public final class SecretsDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_Delete.json - */ - /** - * Sample code: Deletes a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsGetSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsGetSamples.java deleted file mode 100644 index 0a5d00d6d3da..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for Secrets Get. - */ -public final class SecretsGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_Get.json - */ - /** - * Sample code: Gets a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsListSamples.java deleted file mode 100644 index 80e752ff4c6a..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for Secrets List. - */ -public final class SecretsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_List.json - */ - /** - * Sample code: Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsSecretsThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.secrets().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsUpdateSamples.java deleted file mode 100644 index a70819fcdd35..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsUpdateSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.resourcemanager.redhatopenshift.models.Secret; - -/** - * Samples for Secrets Update. - */ -public final class SecretsUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/Secrets_Update.json - */ - /** - * Sample code: Updates a Secret with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesASecretWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - Secret resource = manager.secrets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateSamples.java deleted file mode 100644 index d7c94e86c7ed..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncIdentityProviders CreateOrUpdate. - */ -public final class SyncIdentityProvidersCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a SyncIdentityProvider with the specified subscription, resource group and - * resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==") - .create(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteSamples.java deleted file mode 100644 index 71a0a8ea3d9b..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncIdentityProviders Delete. - */ -public final class SyncIdentityProvidersDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_Delete.json - */ - /** - * Sample code: Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetSamples.java deleted file mode 100644 index 31136bce8d0b..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncIdentityProviders Get. - */ -public final class SyncIdentityProvidersGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_Get.json - */ - /** - * Sample code: Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListSamples.java deleted file mode 100644 index 696b863b96c3..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncIdentityProviders List. - */ -public final class SyncIdentityProvidersListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_List.json - */ - /** - * Sample code: Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsSyncIdentityProvidersThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncIdentityProviders().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersUpdateSamples.java deleted file mode 100644 index cc1eb8418402..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersUpdateSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; - -/** - * Samples for SyncIdentityProviders Update. - */ -public final class SyncIdentityProvidersUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncIdentityProviders_Update.json - */ - /** - * Sample code: Updates a SyncIdentityProvider with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesASyncIdentityProviderWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - SyncIdentityProvider resource = manager.syncIdentityProviders() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withResources( - "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==") - .apply(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateSamples.java deleted file mode 100644 index 49fd30f21985..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncSets CreateOrUpdate. - */ -public final class SyncSetsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_CreateOrUpdate.json - */ - /** - * Sample code: Creates or updates a SyncSet with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void createsOrUpdatesASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets() - .define("childResourceName") - .withExistingOpenshiftcluster("resourceGroup", "resourceName") - .withResources( - "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=") - .create(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteSamples.java deleted file mode 100644 index a69cb16625c7..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncSets Delete. - */ -public final class SyncSetsDeleteSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_Delete.json - */ - /** - * Sample code: Deletes a SyncSet with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void deletesASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets() - .deleteWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetSamples.java deleted file mode 100644 index 7f8663738ff6..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncSets Get. - */ -public final class SyncSetsGetSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_Get.json - */ - /** - * Sample code: Gets a SyncSet with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void getsASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListSamples.java deleted file mode 100644 index 7aac80c15c7e..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -/** - * Samples for SyncSets List. - */ -public final class SyncSetsListSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_List.json - */ - /** - * Sample code: Lists SyncSets that belong to that Azure Red Hat OpenShift Cluster. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void listsSyncSetsThatBelongToThatAzureRedHatOpenShiftCluster( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - manager.syncSets().list("resourceGroup", "resourceName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsUpdateSamples.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsUpdateSamples.java deleted file mode 100644 index d9aadeba81c3..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/samples/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsUpdateSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; - -/** - * Samples for SyncSets Update. - */ -public final class SyncSetsUpdateSamples { - /* - * x-ms-original-file: - * specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/ - * examples/SyncSets_Update.json - */ - /** - * Sample code: Updates a SyncSet with the specified subscription, resource group and resource name. - * - * @param manager Entry point to RedHatOpenShiftManager. - */ - public static void updatesASyncSetWithTheSpecifiedSubscriptionResourceGroupAndResourceName( - com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager manager) { - SyncSet resource = manager.syncSets() - .getWithResponse("resourceGroup", "resourceName", "childResourceName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withResources( - "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=") - .apply(); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ApiServerProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ApiServerProfileTests.java index 710af19eed18..5cf47880b703 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ApiServerProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ApiServerProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -13,7 +13,7 @@ public final class ApiServerProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApiServerProfile model - = BinaryData.fromString("{\"visibility\":\"Public\",\"url\":\"uujitcjc\",\"ip\":\"zevndhkrwpdappds\"}") + = BinaryData.fromString("{\"visibility\":\"Public\",\"url\":\"gzgqexzlo\",\"ip\":\"scpai\"}") .toObject(ApiServerProfile.class); Assertions.assertEquals(Visibility.PUBLIC, model.visibility()); } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ConsoleProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ConsoleProfileTests.java index bf4850cd67f8..f54fc18d0e31 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ConsoleProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ConsoleProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -10,7 +10,7 @@ public final class ConsoleProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ConsoleProfile model = BinaryData.fromString("{\"url\":\"fsinzgvfcjrwzoxx\"}").toObject(ConsoleProfile.class); + ConsoleProfile model = BinaryData.fromString("{\"url\":\"ilnerkujysvlejuv\"}").toObject(ConsoleProfile.class); } @org.junit.jupiter.api.Test diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/DisplayTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/DisplayTests.java index bb112251d4af..192b0adf61d4 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/DisplayTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/DisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -19,17 +19,4 @@ public void testDeserialize() throws Exception { Assertions.assertEquals("tu", model.operation()); Assertions.assertEquals("nryrtihf", model.description()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Display model = new Display().withProvider("uxzdxtay") - .withResource("hmwhfpmrqo") - .withOperation("tu") - .withDescription("nryrtihf"); - model = BinaryData.fromObject(model).toObject(Display.class); - Assertions.assertEquals("uxzdxtay", model.provider()); - Assertions.assertEquals("hmwhfpmrqo", model.resource()); - Assertions.assertEquals("tu", model.operation()); - Assertions.assertEquals("nryrtihf", model.description()); - } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/EffectiveOutboundIpTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/EffectiveOutboundIpTests.java index 4aca8097929c..6eec9719c63d 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/EffectiveOutboundIpTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/EffectiveOutboundIpTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -12,14 +12,7 @@ public final class EffectiveOutboundIpTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EffectiveOutboundIp model - = BinaryData.fromString("{\"id\":\"smjqulngsntnbyb\"}").toObject(EffectiveOutboundIp.class); - Assertions.assertEquals("smjqulngsntnbyb", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EffectiveOutboundIp model = new EffectiveOutboundIp().withId("smjqulngsntnbyb"); - model = BinaryData.fromObject(model).toObject(EffectiveOutboundIp.class); - Assertions.assertEquals("smjqulngsntnbyb", model.id()); + = BinaryData.fromString("{\"id\":\"fiyipjxsqwpgrj\"}").toObject(EffectiveOutboundIp.class); + Assertions.assertEquals("fiyipjxsqwpgrj", model.id()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/IngressProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/IngressProfileTests.java index 19391cf74f3d..8e5b984cbf55 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/IngressProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/IngressProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -13,17 +13,17 @@ public final class IngressProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IngressProfile model - = BinaryData.fromString("{\"name\":\"kvwrwjfeu\",\"visibility\":\"Private\",\"ip\":\"tjelt\"}") + = BinaryData.fromString("{\"name\":\"hhbcsglummajtjao\",\"visibility\":\"Public\",\"ip\":\"nbdxk\"}") .toObject(IngressProfile.class); - Assertions.assertEquals("kvwrwjfeu", model.name()); - Assertions.assertEquals(Visibility.PRIVATE, model.visibility()); + Assertions.assertEquals("hhbcsglummajtjao", model.name()); + Assertions.assertEquals(Visibility.PUBLIC, model.visibility()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IngressProfile model = new IngressProfile().withName("kvwrwjfeu").withVisibility(Visibility.PRIVATE); + IngressProfile model = new IngressProfile().withName("hhbcsglummajtjao").withVisibility(Visibility.PUBLIC); model = BinaryData.fromObject(model).toObject(IngressProfile.class); - Assertions.assertEquals("kvwrwjfeu", model.name()); - Assertions.assertEquals(Visibility.PRIVATE, model.visibility()); + Assertions.assertEquals("hhbcsglummajtjao", model.name()); + Assertions.assertEquals(Visibility.PUBLIC, model.visibility()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/LoadBalancerProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/LoadBalancerProfileTests.java index 0c4cadfc35e7..1eac2b15b031 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/LoadBalancerProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/LoadBalancerProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -13,16 +13,16 @@ public final class LoadBalancerProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LoadBalancerProfile model = BinaryData.fromString( - "{\"managedOutboundIps\":{\"count\":870807939},\"effectiveOutboundIps\":[{\"id\":\"gxg\"},{\"id\":\"pemvtzfkufubljof\"},{\"id\":\"eofjaeqjh\"},{\"id\":\"b\"}]}") + "{\"managedOutboundIps\":{\"count\":697614114},\"effectiveOutboundIps\":[{\"id\":\"jdkirsoodqx\"},{\"id\":\"rmnohj\"},{\"id\":\"kwh\"}]}") .toObject(LoadBalancerProfile.class); - Assertions.assertEquals(870807939, model.managedOutboundIps().count()); + Assertions.assertEquals(697614114, model.managedOutboundIps().count()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LoadBalancerProfile model - = new LoadBalancerProfile().withManagedOutboundIps(new ManagedOutboundIPs().withCount(870807939)); + = new LoadBalancerProfile().withManagedOutboundIps(new ManagedOutboundIPs().withCount(697614114)); model = BinaryData.fromObject(model).toObject(LoadBalancerProfile.class); - Assertions.assertEquals(870807939, model.managedOutboundIps().count()); + Assertions.assertEquals(697614114, model.managedOutboundIps().count()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolInnerTests.java deleted file mode 100644 index 7b0107ab2690..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; -import org.junit.jupiter.api.Assertions; - -public final class MachinePoolInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachinePoolInner model = BinaryData.fromString( - "{\"properties\":{\"resources\":\"ougpbkwt\"},\"id\":\"tduqktapspwgcuer\",\"name\":\"umkdosvqwhbmd\",\"type\":\"bbjfddgmbmbexp\"}") - .toObject(MachinePoolInner.class); - Assertions.assertEquals("ougpbkwt", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachinePoolInner model = new MachinePoolInner().withResources("ougpbkwt"); - model = BinaryData.fromObject(model).toObject(MachinePoolInner.class); - Assertions.assertEquals("ougpbkwt", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolListTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolListTests.java deleted file mode 100644 index 9c6eaaeb5f6d..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolListTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolInner; -import com.azure.resourcemanager.redhatopenshift.models.MachinePoolList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MachinePoolListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachinePoolList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resources\":\"ugjzzdatqxhocdge\"},\"id\":\"lgphu\",\"name\":\"icndvkaozwyifty\",\"type\":\"xhurok\"},{\"properties\":{\"resources\":\"xolniwpwcukjfk\"},\"id\":\"awxklr\",\"name\":\"plwckbas\",\"type\":\"ypnddhsgcb\"},{\"properties\":{\"resources\":\"hejkotynqgou\"},\"id\":\"ndlik\",\"name\":\"yqkgfg\",\"type\":\"bmadgak\"},{\"properties\":{\"resources\":\"rxybz\"},\"id\":\"e\",\"name\":\"qytbciq\",\"type\":\"ouf\"}],\"nextLink\":\"mnkzsmod\"}") - .toObject(MachinePoolList.class); - Assertions.assertEquals("ugjzzdatqxhocdge", model.value().get(0).resources()); - Assertions.assertEquals("mnkzsmod", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachinePoolList model = new MachinePoolList() - .withValue(Arrays.asList(new MachinePoolInner().withResources("ugjzzdatqxhocdge"), - new MachinePoolInner().withResources("xolniwpwcukjfk"), - new MachinePoolInner().withResources("hejkotynqgou"), new MachinePoolInner().withResources("rxybz"))) - .withNextLink("mnkzsmod"); - model = BinaryData.fromObject(model).toObject(MachinePoolList.class); - Assertions.assertEquals("ugjzzdatqxhocdge", model.value().get(0).resources()); - Assertions.assertEquals("mnkzsmod", model.nextLink()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolPropertiesTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolPropertiesTests.java deleted file mode 100644 index a393a5a3d68f..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.MachinePoolProperties; -import org.junit.jupiter.api.Assertions; - -public final class MachinePoolPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachinePoolProperties model - = BinaryData.fromString("{\"resources\":\"htqqrolfp\"}").toObject(MachinePoolProperties.class); - Assertions.assertEquals("htqqrolfp", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachinePoolProperties model = new MachinePoolProperties().withResources("htqqrolfp"); - model = BinaryData.fromObject(model).toObject(MachinePoolProperties.class); - Assertions.assertEquals("htqqrolfp", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolUpdateTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolUpdateTests.java deleted file mode 100644 index 3a7540ca13a8..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolUpdateTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.models.MachinePoolUpdate; -import org.junit.jupiter.api.Assertions; - -public final class MachinePoolUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachinePoolUpdate model = BinaryData.fromString("{\"properties\":{\"resources\":\"rlkhbzhfepgzgq\"}}") - .toObject(MachinePoolUpdate.class); - Assertions.assertEquals("rlkhbzhfepgzgq", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachinePoolUpdate model = new MachinePoolUpdate().withResources("rlkhbzhfepgzgq"); - model = BinaryData.fromObject(model).toObject(MachinePoolUpdate.class); - Assertions.assertEquals("rlkhbzhfepgzgq", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 4d9d04753525..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MachinePoolsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"resources\":\"dudgwdslfhot\"},\"id\":\"cynpwlbjnp\",\"name\":\"acfta\",\"type\":\"ehxnltyfsop\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MachinePool response = manager.machinePools() - .define("pheoflokeyy") - .withExistingOpenshiftcluster("chcbonqvpkvlrxnj", "ase") - .withResources("jbdlwtgrhpdjpju") - .create(); - - Assertions.assertEquals("dudgwdslfhot", response.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteWithResponseMockTests.java deleted file mode 100644 index a076d0bc62b2..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MachinePoolsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.machinePools() - .deleteWithResponse("wxrjfeallnwsub", "snjampmng", "zscxaqwo", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListMockTests.java deleted file mode 100644 index c5837bcbf898..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsListMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MachinePoolsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"resources\":\"cuiywgqyw\"},\"id\":\"drvyn\",\"name\":\"zgpphrcgyncocpe\",\"type\":\"fvm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.machinePools().list("hjybigehoqfbo", "skanyk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cuiywgqyw", response.iterator().next().resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedOutboundIPsTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedOutboundIPsTests.java index 04a21ec3c87a..bfbb73ed6360 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedOutboundIPsTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedOutboundIPsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -11,14 +11,14 @@ public final class ManagedOutboundIPsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ManagedOutboundIPs model = BinaryData.fromString("{\"count\":91789189}").toObject(ManagedOutboundIPs.class); - Assertions.assertEquals(91789189, model.count()); + ManagedOutboundIPs model = BinaryData.fromString("{\"count\":1629637737}").toObject(ManagedOutboundIPs.class); + Assertions.assertEquals(1629637737, model.count()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedOutboundIPs model = new ManagedOutboundIPs().withCount(91789189); + ManagedOutboundIPs model = new ManagedOutboundIPs().withCount(1629637737); model = BinaryData.fromObject(model).toObject(ManagedOutboundIPs.class); - Assertions.assertEquals(91789189, model.count()); + Assertions.assertEquals(1629637737, model.count()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedServiceIdentityTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..6d93c5616fa6 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/ManagedServiceIdentityTests.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.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshift.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"xo\",\"tenantId\":\"jionpimexgstxgc\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"vmclw\":{\"principalId\":\"aajrm\",\"clientId\":\"jwzrl\"},\"bfkgukdkex\":{\"principalId\":\"j\",\"clientId\":\"ejctbzaqsqsycb\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model + = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("vmclw", new UserAssignedIdentity(), "bfkgukdkex", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MasterProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MasterProfileTests.java index 7ee0fd07e863..657df770e1df 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MasterProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MasterProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -13,24 +13,24 @@ public final class MasterProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MasterProfile model = BinaryData.fromString( - "{\"vmSize\":\"gc\",\"subnetId\":\"wclxxwrl\",\"encryptionAtHost\":\"Enabled\",\"diskEncryptionSetId\":\"skcqvkocrcjd\"}") + "{\"vmSize\":\"norcjxvsnbyxqab\",\"subnetId\":\"ocpcy\",\"encryptionAtHost\":\"Disabled\",\"diskEncryptionSetId\":\"zafb\"}") .toObject(MasterProfile.class); - Assertions.assertEquals("gc", model.vmSize()); - Assertions.assertEquals("wclxxwrl", model.subnetId()); - Assertions.assertEquals(EncryptionAtHost.ENABLED, model.encryptionAtHost()); - Assertions.assertEquals("skcqvkocrcjd", model.diskEncryptionSetId()); + Assertions.assertEquals("norcjxvsnbyxqab", model.vmSize()); + Assertions.assertEquals("ocpcy", model.subnetId()); + Assertions.assertEquals(EncryptionAtHost.DISABLED, model.encryptionAtHost()); + Assertions.assertEquals("zafb", model.diskEncryptionSetId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MasterProfile model = new MasterProfile().withVmSize("gc") - .withSubnetId("wclxxwrl") - .withEncryptionAtHost(EncryptionAtHost.ENABLED) - .withDiskEncryptionSetId("skcqvkocrcjd"); + MasterProfile model = new MasterProfile().withVmSize("norcjxvsnbyxqab") + .withSubnetId("ocpcy") + .withEncryptionAtHost(EncryptionAtHost.DISABLED) + .withDiskEncryptionSetId("zafb"); model = BinaryData.fromObject(model).toObject(MasterProfile.class); - Assertions.assertEquals("gc", model.vmSize()); - Assertions.assertEquals("wclxxwrl", model.subnetId()); - Assertions.assertEquals(EncryptionAtHost.ENABLED, model.encryptionAtHost()); - Assertions.assertEquals("skcqvkocrcjd", model.diskEncryptionSetId()); + Assertions.assertEquals("norcjxvsnbyxqab", model.vmSize()); + Assertions.assertEquals("ocpcy", model.subnetId()); + Assertions.assertEquals(EncryptionAtHost.DISABLED, model.encryptionAtHost()); + Assertions.assertEquals("zafb", model.diskEncryptionSetId()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/NetworkProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/NetworkProfileTests.java index d3a78c0e8cc6..26f380e880f0 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/NetworkProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/NetworkProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -16,28 +16,28 @@ public final class NetworkProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkProfile model = BinaryData.fromString( - "{\"podCidr\":\"fxxypininmayhuy\",\"serviceCidr\":\"kpode\",\"outboundType\":\"UserDefinedRouting\",\"loadBalancerProfile\":{\"managedOutboundIps\":{\"count\":1899394591},\"effectiveOutboundIps\":[{\"id\":\"iheogna\"},{\"id\":\"zxtheotusivyevcc\"},{\"id\":\"ihnhun\"}]},\"preconfiguredNSG\":\"Enabled\"}") + "{\"podCidr\":\"sezcxtb\",\"serviceCidr\":\"gfycc\",\"outboundType\":\"Loadbalancer\",\"loadBalancerProfile\":{\"managedOutboundIps\":{\"count\":2139410059},\"effectiveOutboundIps\":[{\"id\":\"iachbo\"},{\"id\":\"flnrosfqpteehzz\"},{\"id\":\"pyqr\"}]},\"preconfiguredNSG\":\"Disabled\"}") .toObject(NetworkProfile.class); - Assertions.assertEquals("fxxypininmayhuy", model.podCidr()); - Assertions.assertEquals("kpode", model.serviceCidr()); - Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, model.outboundType()); - Assertions.assertEquals(1899394591, model.loadBalancerProfile().managedOutboundIps().count()); - Assertions.assertEquals(PreconfiguredNsg.ENABLED, model.preconfiguredNsg()); + Assertions.assertEquals("sezcxtb", model.podCidr()); + Assertions.assertEquals("gfycc", model.serviceCidr()); + Assertions.assertEquals(OutboundType.LOADBALANCER, model.outboundType()); + Assertions.assertEquals(2139410059, model.loadBalancerProfile().managedOutboundIps().count()); + Assertions.assertEquals(PreconfiguredNsg.DISABLED, model.preconfiguredNsg()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NetworkProfile model = new NetworkProfile().withPodCidr("fxxypininmayhuy") - .withServiceCidr("kpode") - .withOutboundType(OutboundType.USER_DEFINED_ROUTING) + NetworkProfile model = new NetworkProfile().withPodCidr("sezcxtb") + .withServiceCidr("gfycc") + .withOutboundType(OutboundType.LOADBALANCER) .withLoadBalancerProfile( - new LoadBalancerProfile().withManagedOutboundIps(new ManagedOutboundIPs().withCount(1899394591))) - .withPreconfiguredNsg(PreconfiguredNsg.ENABLED); + new LoadBalancerProfile().withManagedOutboundIps(new ManagedOutboundIPs().withCount(2139410059))) + .withPreconfiguredNsg(PreconfiguredNsg.DISABLED); model = BinaryData.fromObject(model).toObject(NetworkProfile.class); - Assertions.assertEquals("fxxypininmayhuy", model.podCidr()); - Assertions.assertEquals("kpode", model.serviceCidr()); - Assertions.assertEquals(OutboundType.USER_DEFINED_ROUTING, model.outboundType()); - Assertions.assertEquals(1899394591, model.loadBalancerProfile().managedOutboundIps().count()); - Assertions.assertEquals(PreconfiguredNsg.ENABLED, model.preconfiguredNsg()); + Assertions.assertEquals("sezcxtb", model.podCidr()); + Assertions.assertEquals("gfycc", model.serviceCidr()); + Assertions.assertEquals(OutboundType.LOADBALANCER, model.outboundType()); + Assertions.assertEquals(2139410059, model.loadBalancerProfile().managedOutboundIps().count()); + Assertions.assertEquals(PreconfiguredNsg.DISABLED, model.preconfiguredNsg()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClusterAdminKubeconfigInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClusterAdminKubeconfigInnerTests.java index c8e945221fdb..695c599aabcc 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClusterAdminKubeconfigInnerTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClusterAdminKubeconfigInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -11,16 +11,8 @@ public final class OpenShiftClusterAdminKubeconfigInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OpenShiftClusterAdminKubeconfigInner model = BinaryData.fromString("{\"kubeconfig\":\"ljavbqid\"}") + OpenShiftClusterAdminKubeconfigInner model = BinaryData.fromString("{\"kubeconfig\":\"eojnxqbzvddn\"}") .toObject(OpenShiftClusterAdminKubeconfigInner.class); - Assertions.assertEquals("ljavbqid", model.kubeconfig()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OpenShiftClusterAdminKubeconfigInner model - = new OpenShiftClusterAdminKubeconfigInner().withKubeconfig("ljavbqid"); - model = BinaryData.fromObject(model).toObject(OpenShiftClusterAdminKubeconfigInner.class); - Assertions.assertEquals("ljavbqid", model.kubeconfig()); + Assertions.assertEquals("eojnxqbzvddn", model.kubeconfig()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsWithResponseMockTests.java index 9d11883d39a7..ef06f5675bf1 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsWithResponseMockTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftClustersListAdminCredentialsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftClusterAdminKubeconfig; @@ -20,19 +20,19 @@ public final class OpenShiftClustersListAdminCredentialsWithResponseMockTests { @Test public void testListAdminCredentialsWithResponse() throws Exception { - String responseStr = "{\"kubeconfig\":\"hm\"}"; + String responseStr = "{\"kubeconfig\":\"lwtgrhpdj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); OpenShiftClusterAdminKubeconfig response = manager.openShiftClusters() - .listAdminCredentialsWithResponse("yeicxmqciwqvhk", "ixuigdtopbobj", com.azure.core.util.Context.NONE) + .listAdminCredentialsWithResponse("keyyi", "nj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("hm", response.kubeconfig()); + Assertions.assertEquals("lwtgrhpdj", response.kubeconfig()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionInnerTests.java index ebb5f498bc7a..769ea16aeb8c 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionInnerTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -12,15 +12,8 @@ public final class OpenShiftVersionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OpenShiftVersionInner model = BinaryData.fromString( - "{\"properties\":{\"version\":\"mfdatscmdvpj\"},\"id\":\"lsuuvmkjozkrwfnd\",\"name\":\"odjpslwejd\",\"type\":\"vwryoqpso\"}") + "{\"properties\":{\"version\":\"jbpzvgnwzsymg\"},\"id\":\"uf\",\"name\":\"yzkohdbihanuf\",\"type\":\"fcbjysagithxqha\"}") .toObject(OpenShiftVersionInner.class); - Assertions.assertEquals("mfdatscmdvpj", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OpenShiftVersionInner model = new OpenShiftVersionInner().withVersion("mfdatscmdvpj"); - model = BinaryData.fromObject(model).toObject(OpenShiftVersionInner.class); - Assertions.assertEquals("mfdatscmdvpj", model.version()); + Assertions.assertEquals("jbpzvgnwzsymg", model.version()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionListTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionListTests.java index 79f6d9bac5ff..8fedaadc43eb 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionListTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionListTests.java @@ -1,35 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.OpenShiftVersionInner; -import com.azure.resourcemanager.redhatopenshift.models.OpenShiftVersionList; -import java.util.Arrays; +import com.azure.resourcemanager.redhatopenshift.implementation.models.OpenShiftVersionList; import org.junit.jupiter.api.Assertions; public final class OpenShiftVersionListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OpenShiftVersionList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"version\":\"pzvgnwzsymglzufc\"},\"id\":\"kohdbiha\",\"name\":\"ufhfcbjysa\",\"type\":\"ithxqhabifpi\"},{\"properties\":{\"version\":\"czbysc\"},\"id\":\"q\",\"name\":\"uhivyqniw\",\"type\":\"ybrk\"},{\"properties\":{\"version\":\"umjgrtfwvuk\"},\"id\":\"audccsnhs\",\"name\":\"cnyejhkryhtnapcz\",\"type\":\"lokjyemkk\"},{\"properties\":{\"version\":\"pjoxzjnch\"},\"id\":\"jspodmailzyde\",\"name\":\"o\",\"type\":\"wyahuxinpmqnja\"}],\"nextLink\":\"ixjsprozvcputeg\"}") + "{\"value\":[{\"properties\":{\"version\":\"pqxu\"},\"id\":\"vyq\",\"name\":\"iwbybrkxvdumjg\",\"type\":\"tfwvukxgaudc\"},{\"properties\":{\"version\":\"h\"},\"id\":\"cnyejhkryhtnapcz\",\"name\":\"lokjyemkk\",\"type\":\"ni\"},{\"properties\":{\"version\":\"xzjnchgejs\"},\"id\":\"dmailzydehojw\",\"name\":\"ahuxinpm\",\"type\":\"njaqwixjspro\"}],\"nextLink\":\"cputegjvwmfdats\"}") .toObject(OpenShiftVersionList.class); - Assertions.assertEquals("pzvgnwzsymglzufc", model.value().get(0).version()); - Assertions.assertEquals("ixjsprozvcputeg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OpenShiftVersionList model = new OpenShiftVersionList() - .withValue(Arrays.asList(new OpenShiftVersionInner().withVersion("pzvgnwzsymglzufc"), - new OpenShiftVersionInner().withVersion("czbysc"), - new OpenShiftVersionInner().withVersion("umjgrtfwvuk"), - new OpenShiftVersionInner().withVersion("pjoxzjnch"))) - .withNextLink("ixjsprozvcputeg"); - model = BinaryData.fromObject(model).toObject(OpenShiftVersionList.class); - Assertions.assertEquals("pzvgnwzsymglzufc", model.value().get(0).version()); - Assertions.assertEquals("ixjsprozvcputeg", model.nextLink()); + Assertions.assertEquals("pqxu", model.value().get(0).version()); + Assertions.assertEquals("cputegjvwmfdats", model.nextLink()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionPropertiesTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionPropertiesTests.java index bd12f9ee884b..fd6949790063 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionPropertiesTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -12,14 +12,7 @@ public final class OpenShiftVersionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OpenShiftVersionProperties model - = BinaryData.fromString("{\"version\":\"ctazakljlahbcryf\"}").toObject(OpenShiftVersionProperties.class); - Assertions.assertEquals("ctazakljlahbcryf", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OpenShiftVersionProperties model = new OpenShiftVersionProperties().withVersion("ctazakljlahbcryf"); - model = BinaryData.fromObject(model).toObject(OpenShiftVersionProperties.class); - Assertions.assertEquals("ctazakljlahbcryf", model.version()); + = BinaryData.fromString("{\"version\":\"fpikxwczb\"}").toObject(OpenShiftVersionProperties.class); + Assertions.assertEquals("fpikxwczb", model.version()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetWithResponseMockTests.java similarity index 62% rename from sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetWithResponseMockTests.java rename to sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetWithResponseMockTests.java index 802cc9490773..cc0aecd47113 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/MachinePoolsGetWithResponseMockTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsGetWithResponseMockTests.java @@ -1,39 +1,38 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.MachinePool; +import com.azure.resourcemanager.redhatopenshift.models.OpenShiftVersion; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class MachinePoolsGetWithResponseMockTests { +public final class OpenShiftVersionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"resources\":\"uvcc\"},\"id\":\"nfnbacfionlebxe\",\"name\":\"qgtz\",\"type\":\"dpnqbq\"}"; + = "{\"properties\":{\"version\":\"rzayv\"},\"id\":\"pgvdf\",\"name\":\"iotkftutqxl\",\"type\":\"gxlefgugnxkrxd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - MachinePool response = manager.machinePools() - .getWithResponse("coofsxlzev", "bmqj", "abcypmivk", com.azure.core.util.Context.NONE) - .getValue(); + OpenShiftVersion response + = manager.openShiftVersions().getWithResponse("u", "m", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("uvcc", response.resources()); + Assertions.assertEquals("rzayv", response.version()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListMockTests.java index 58697230fdd3..9270a676f262 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListMockTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OpenShiftVersionsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; import com.azure.resourcemanager.redhatopenshift.models.OpenShiftVersion; @@ -22,18 +22,18 @@ public final class OpenShiftVersionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"version\":\"ofmx\"},\"id\":\"c\",\"name\":\"jpgd\",\"type\":\"toc\"}]}"; + = "{\"value\":[{\"properties\":{\"version\":\"hzrvqd\"},\"id\":\"bhj\",\"name\":\"big\",\"type\":\"h\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.openShiftVersions().list("bkbfkgukdkex", com.azure.core.util.Context.NONE); + = manager.openShiftVersions().list("mi", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ofmx", response.iterator().next().version()); + Assertions.assertEquals("hzrvqd", response.iterator().next().version()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationInnerTests.java index 9d9607d3e642..072b753caad5 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationInnerTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationInnerTests.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.redhatopenshift.fluent.models.OperationInner; -import com.azure.resourcemanager.redhatopenshift.models.Display; import org.junit.jupiter.api.Assertions; public final class OperationInnerTests { @@ -22,21 +21,4 @@ public void testDeserialize() throws Exception { Assertions.assertEquals("txukcdmp", model.display().description()); Assertions.assertEquals("cryuan", model.origin()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("itjz") - .withDisplay(new Display().withProvider("usarhmofc") - .withResource("smy") - .withOperation("kdtmlxhekuk") - .withDescription("txukcdmp")) - .withOrigin("cryuan"); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("itjz", model.name()); - Assertions.assertEquals("usarhmofc", model.display().provider()); - Assertions.assertEquals("smy", model.display().resource()); - Assertions.assertEquals("kdtmlxhekuk", model.display().operation()); - Assertions.assertEquals("txukcdmp", model.display().description()); - Assertions.assertEquals("cryuan", model.origin()); - } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationListTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationListTests.java index 66e780ed5e35..2177c7595fd8 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationListTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationListTests.java @@ -1,60 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.OperationInner; -import com.azure.resourcemanager.redhatopenshift.models.Display; -import com.azure.resourcemanager.redhatopenshift.models.OperationList; -import java.util.Arrays; +import com.azure.resourcemanager.redhatopenshift.implementation.models.OperationList; import org.junit.jupiter.api.Assertions; public final class OperationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"ownoizhw\"},{\"name\":\"xybqsoqij\",\"display\":{\"provider\":\"mbpazlobcufpdzn\",\"resource\":\"t\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"lhjxr\"},{\"name\":\"kwm\",\"display\":{\"provider\":\"tsizntocipaoua\",\"resource\":\"s\",\"operation\":\"cmpoyfdkfogkny\",\"description\":\"ofjdde\"},\"origin\":\"rd\"}],\"nextLink\":\"pewnw\"}") + "{\"value\":[{\"name\":\"hq\",\"display\":{\"provider\":\"jxpybczmeh\",\"resource\":\"zopbsphrupidgs\",\"operation\":\"bejhphoycmsxa\",\"description\":\"hdxbmtqio\"},\"origin\":\"zehtbmu\"},{\"name\":\"ownoizhw\",\"display\":{\"provider\":\"ybqsoqijg\",\"resource\":\"mbpazlobcufpdzn\",\"operation\":\"t\",\"description\":\"qjnqglhqgnufoooj\"},\"origin\":\"ifsqesaagdfmg\"},{\"name\":\"lhjxr\",\"display\":{\"provider\":\"wmrvktsizntocipa\",\"resource\":\"ajpsquc\",\"operation\":\"o\",\"description\":\"dkfo\"},\"origin\":\"nygj\"}],\"nextLink\":\"jddeqsrdeupewnw\"}") .toObject(OperationList.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals("ownoizhw", model.value().get(0).origin()); - Assertions.assertEquals("pewnw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList().withValue(Arrays.asList( - new OperationInner().withName("quvgjxpybczme") - .withDisplay(new Display().withProvider("zopbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")) - .withOrigin("ownoizhw"), - new OperationInner().withName("xybqsoqij") - .withDisplay(new Display().withProvider("mbpazlobcufpdzn") - .withResource("t") - .withOperation("qjnqglhqgnufoooj") - .withDescription("ifsqesaagdfmg")) - .withOrigin("lhjxr"), - new OperationInner().withName("kwm") - .withDisplay(new Display().withProvider("tsizntocipaoua") - .withResource("s") - .withOperation("cmpoyfdkfogkny") - .withDescription("ofjdde")) - .withOrigin("rd"))) - .withNextLink("pewnw"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals("ownoizhw", model.value().get(0).origin()); - Assertions.assertEquals("pewnw", model.nextLink()); + Assertions.assertEquals("hq", model.value().get(0).name()); + Assertions.assertEquals("jxpybczmeh", model.value().get(0).display().provider()); + Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().resource()); + Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().operation()); + Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().description()); + Assertions.assertEquals("zehtbmu", model.value().get(0).origin()); + Assertions.assertEquals("jddeqsrdeupewnw", model.nextLink()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListMockTests.java index 540c2366bbd9..44b11ddf248e 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListMockTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; import com.azure.resourcemanager.redhatopenshift.models.Operation; @@ -22,22 +22,22 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"jionpimexgstxgc\",\"display\":{\"provider\":\"gmaajrm\",\"resource\":\"jwzrl\",\"operation\":\"mcl\",\"description\":\"ijcoejctb\"},\"origin\":\"qsqsy\"}]}"; + = "{\"value\":[{\"name\":\"yd\",\"display\":{\"provider\":\"mjthjqkwp\",\"resource\":\"icxm\",\"operation\":\"iwqvhkh\",\"description\":\"uigdtopbobjog\"},\"origin\":\"e\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("jionpimexgstxgc", response.iterator().next().name()); - Assertions.assertEquals("gmaajrm", response.iterator().next().display().provider()); - Assertions.assertEquals("jwzrl", response.iterator().next().display().resource()); - Assertions.assertEquals("mcl", response.iterator().next().display().operation()); - Assertions.assertEquals("ijcoejctb", response.iterator().next().display().description()); - Assertions.assertEquals("qsqsy", response.iterator().next().origin()); + Assertions.assertEquals("yd", response.iterator().next().name()); + Assertions.assertEquals("mjthjqkwp", response.iterator().next().display().provider()); + Assertions.assertEquals("icxm", response.iterator().next().display().resource()); + Assertions.assertEquals("iwqvhkh", response.iterator().next().display().operation()); + Assertions.assertEquals("uigdtopbobjog", response.iterator().next().display().description()); + Assertions.assertEquals("e", response.iterator().next().origin()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityProfileTests.java new file mode 100644 index 000000000000..26ef83069f3f --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityProfileTests.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.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityProfile; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class PlatformWorkloadIdentityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlatformWorkloadIdentityProfile model = BinaryData.fromString( + "{\"upgradeableTo\":\"gjvtbv\",\"platformWorkloadIdentities\":{\"uitnwuiz\":{\"resourceId\":\"zdn\",\"clientId\":\"jq\",\"objectId\":\"hmuouqfprwzwbn\"},\"zuhtymwisdkfthwx\":{\"resourceId\":\"zxufiz\",\"clientId\":\"kyfi\",\"objectId\":\"fidfvzw\"}}}") + .toObject(PlatformWorkloadIdentityProfile.class); + Assertions.assertEquals("gjvtbv", model.upgradeableTo()); + Assertions.assertEquals("zdn", model.platformWorkloadIdentities().get("uitnwuiz").resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PlatformWorkloadIdentityProfile model = new PlatformWorkloadIdentityProfile().withUpgradeableTo("gjvtbv") + .withPlatformWorkloadIdentities(mapOf("uitnwuiz", new PlatformWorkloadIdentity().withResourceId("zdn"), + "zuhtymwisdkfthwx", new PlatformWorkloadIdentity().withResourceId("zxufiz"))); + model = BinaryData.fromObject(model).toObject(PlatformWorkloadIdentityProfile.class); + Assertions.assertEquals("gjvtbv", model.upgradeableTo()); + Assertions.assertEquals("zdn", model.platformWorkloadIdentities().get("uitnwuiz").resourceId()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetInnerTests.java new file mode 100644 index 000000000000..56424bcea406 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetInner; +import org.junit.jupiter.api.Assertions; + +public final class PlatformWorkloadIdentityRoleSetInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlatformWorkloadIdentityRoleSetInner model = BinaryData.fromString( + "{\"properties\":{\"openShiftVersion\":\"zdatqxhocdg\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"gphuticndvka\",\"roleDefinitionName\":\"wyiftyhxhur\",\"roleDefinitionId\":\"ftyxolniw\"},{\"operatorName\":\"cukjf\",\"roleDefinitionName\":\"iawxklry\",\"roleDefinitionId\":\"wckbasyypnd\"},{\"operatorName\":\"sgcbac\",\"roleDefinitionName\":\"ejk\",\"roleDefinitionId\":\"ynqgoulzndlikwyq\"}]},\"id\":\"fgibmadgakeq\",\"name\":\"rxybz\",\"type\":\"qedqytbciqfoufl\"}") + .toObject(PlatformWorkloadIdentityRoleSetInner.class); + Assertions.assertEquals("zdatqxhocdg", model.openShiftVersion()); + Assertions.assertEquals("gphuticndvka", model.platformWorkloadIdentityRoles().get(0).operatorName()); + Assertions.assertEquals("wyiftyhxhur", model.platformWorkloadIdentityRoles().get(0).roleDefinitionName()); + Assertions.assertEquals("ftyxolniw", model.platformWorkloadIdentityRoles().get(0).roleDefinitionId()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetListTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetListTests.java new file mode 100644 index 000000000000..41aca649bbd9 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetListTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.implementation.models.PlatformWorkloadIdentityRoleSetList; +import org.junit.jupiter.api.Assertions; + +public final class PlatformWorkloadIdentityRoleSetListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlatformWorkloadIdentityRoleSetList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"openShiftVersion\":\"pjhulsuuvmkj\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"wfndiodjpsl\",\"roleDefinitionName\":\"jdpvwryo\",\"roleDefinitionId\":\"soacctazakl\"}]},\"id\":\"ahbc\",\"name\":\"yffdfdos\",\"type\":\"gexpaojakhmsbz\"},{\"properties\":{\"openShiftVersion\":\"rzevdphlxaol\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"rgqjbpfzfsinzg\",\"roleDefinitionName\":\"cjrwzoxxjtfellu\",\"roleDefinitionId\":\"zitonpeqfpjkjl\"},{\"operatorName\":\"fpdvhpfxxypi\",\"roleDefinitionName\":\"nmayhuybb\",\"roleDefinitionId\":\"odepoogin\"},{\"operatorName\":\"amiheognarxz\",\"roleDefinitionName\":\"heotusiv\",\"roleDefinitionId\":\"v\"},{\"operatorName\":\"iqihn\",\"roleDefinitionName\":\"ngbwjz\",\"roleDefinitionId\":\"fygxgispemvtzfk\"}]},\"id\":\"ubljofxqe\",\"name\":\"fjaeq\",\"type\":\"hqjbasvmsmj\"},{\"properties\":{\"openShiftVersion\":\"ngsntnbybk\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"rwclxxwrljdo\",\"roleDefinitionName\":\"kcqvkocrc\",\"roleDefinitionId\":\"kwt\"},{\"operatorName\":\"xbnjbiksq\",\"roleDefinitionName\":\"lssai\",\"roleDefinitionId\":\"p\"},{\"operatorName\":\"nzl\",\"roleDefinitionName\":\"fmppe\",\"roleDefinitionId\":\"vmgxsab\"},{\"operatorName\":\"qduujitcjczdz\",\"roleDefinitionName\":\"ndhkrw\",\"roleDefinitionId\":\"appd\"}]},\"id\":\"dkvwrwjfe\",\"name\":\"snhu\",\"type\":\"je\"}],\"nextLink\":\"mrldhu\"}") + .toObject(PlatformWorkloadIdentityRoleSetList.class); + Assertions.assertEquals("pjhulsuuvmkj", model.value().get(0).openShiftVersion()); + Assertions.assertEquals("wfndiodjpsl", + model.value().get(0).platformWorkloadIdentityRoles().get(0).operatorName()); + Assertions.assertEquals("jdpvwryo", + model.value().get(0).platformWorkloadIdentityRoles().get(0).roleDefinitionName()); + Assertions.assertEquals("soacctazakl", + model.value().get(0).platformWorkloadIdentityRoles().get(0).roleDefinitionId()); + Assertions.assertEquals("mrldhu", model.nextLink()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationsGetWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..70d4f7cf5160 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetOperationsGetWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSet; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PlatformWorkloadIdentityRoleSetOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"openShiftVersion\":\"dmoh\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"vudwx\",\"roleDefinitionName\":\"dnvowg\",\"roleDefinitionId\":\"jugwdkcglhsl\"},{\"operatorName\":\"jdyggdtji\",\"roleDefinitionName\":\"b\",\"roleDefinitionId\":\"ofqweykhmenevfye\"},{\"operatorName\":\"whybcib\",\"roleDefinitionName\":\"vdcsitynn\",\"roleDefinitionId\":\"mdectehfiqscjey\"}]},\"id\":\"hezrkgq\",\"name\":\"c\",\"type\":\"refovgmkqsleyyvx\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PlatformWorkloadIdentityRoleSet response = manager.platformWorkloadIdentityRoleSetOperations() + .getWithResponse("xnltyfsoppu", "uesnzwdejbavo", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("dmoh", response.openShiftVersion()); + Assertions.assertEquals("vudwx", response.platformWorkloadIdentityRoles().get(0).operatorName()); + Assertions.assertEquals("dnvowg", response.platformWorkloadIdentityRoles().get(0).roleDefinitionName()); + Assertions.assertEquals("jugwdkcglhsl", response.platformWorkloadIdentityRoles().get(0).roleDefinitionId()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetPropertiesTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetPropertiesTests.java new file mode 100644 index 000000000000..5f71c6eacff9 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.fluent.models.PlatformWorkloadIdentityRoleSetProperties; +import org.junit.jupiter.api.Assertions; + +public final class PlatformWorkloadIdentityRoleSetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlatformWorkloadIdentityRoleSetProperties model = BinaryData.fromString( + "{\"openShiftVersion\":\"nkzsmodmglou\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"wtmutduq\",\"roleDefinitionName\":\"ap\",\"roleDefinitionId\":\"wgcu\"}]}") + .toObject(PlatformWorkloadIdentityRoleSetProperties.class); + Assertions.assertEquals("nkzsmodmglou", model.openShiftVersion()); + Assertions.assertEquals("wtmutduq", model.platformWorkloadIdentityRoles().get(0).operatorName()); + Assertions.assertEquals("ap", model.platformWorkloadIdentityRoles().get(0).roleDefinitionName()); + Assertions.assertEquals("wgcu", model.platformWorkloadIdentityRoles().get(0).roleDefinitionId()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListMockTests.java new file mode 100644 index 000000000000..20796afa5fc0 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleSetsListMockTests.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.redhatopenshift.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRoleSet; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PlatformWorkloadIdentityRoleSetsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"openShiftVersion\":\"nyktzlcuiy\",\"platformWorkloadIdentityRoles\":[{\"operatorName\":\"wgndrvynhzgpp\",\"roleDefinitionName\":\"cgyncocpecf\",\"roleDefinitionId\":\"mcoo\"}]},\"id\":\"xlzevgbmqjqabcy\",\"name\":\"mivkwlzuvcc\",\"type\":\"wnfnbacf\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.platformWorkloadIdentityRoleSets().list("qfbow", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("nyktzlcuiy", response.iterator().next().openShiftVersion()); + Assertions.assertEquals("wgndrvynhzgpp", + response.iterator().next().platformWorkloadIdentityRoles().get(0).operatorName()); + Assertions.assertEquals("cgyncocpecf", + response.iterator().next().platformWorkloadIdentityRoles().get(0).roleDefinitionName()); + Assertions.assertEquals("mcoo", + response.iterator().next().platformWorkloadIdentityRoles().get(0).roleDefinitionId()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleTests.java new file mode 100644 index 000000000000..0163b497c0ee --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityRoleTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentityRole; +import org.junit.jupiter.api.Assertions; + +public final class PlatformWorkloadIdentityRoleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlatformWorkloadIdentityRole model = BinaryData.fromString( + "{\"operatorName\":\"tumkdosvqwhbm\",\"roleDefinitionName\":\"bbjfddgmbmbexp\",\"roleDefinitionId\":\"htqqrolfp\"}") + .toObject(PlatformWorkloadIdentityRole.class); + Assertions.assertEquals("tumkdosvqwhbm", model.operatorName()); + Assertions.assertEquals("bbjfddgmbmbexp", model.roleDefinitionName()); + Assertions.assertEquals("htqqrolfp", model.roleDefinitionId()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityTests.java new file mode 100644 index 000000000000..1e24a0f2401b --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/PlatformWorkloadIdentityTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.models.PlatformWorkloadIdentity; +import org.junit.jupiter.api.Assertions; + +public final class PlatformWorkloadIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PlatformWorkloadIdentity model = BinaryData + .fromString("{\"resourceId\":\"t\",\"clientId\":\"waopvkmijcmmxd\",\"objectId\":\"fufsrpymzi\"}") + .toObject(PlatformWorkloadIdentity.class); + Assertions.assertEquals("t", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PlatformWorkloadIdentity model = new PlatformWorkloadIdentity().withResourceId("t"); + model = BinaryData.fromObject(model).toObject(PlatformWorkloadIdentity.class); + Assertions.assertEquals("t", model.resourceId()); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteWithResponseMockTests.java deleted file mode 100644 index 6cab4e7a0d44..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SecretsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SecretsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.secrets() - .deleteWithResponse("yggdtjixh", "kuofqweykhme", "evfyexfwhybcib", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderInnerTests.java deleted file mode 100644 index 318535e38225..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import org.junit.jupiter.api.Assertions; - -public final class SyncIdentityProviderInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncIdentityProviderInner model = BinaryData - .fromString("{\"properties\":{\"resources\":\"nwui\"},\"id\":\"a\",\"name\":\"x\",\"type\":\"fizuckyf\"}") - .toObject(SyncIdentityProviderInner.class); - Assertions.assertEquals("nwui", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncIdentityProviderInner model = new SyncIdentityProviderInner().withResources("nwui"); - model = BinaryData.fromObject(model).toObject(SyncIdentityProviderInner.class); - Assertions.assertEquals("nwui", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderListTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderListTests.java deleted file mode 100644 index dda4fa0b41bc..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderListTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviderList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SyncIdentityProviderListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncIdentityProviderList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resources\":\"uvfqawrlyxwj\"},\"id\":\"prbnwbxgjvtbv\",\"name\":\"ysszdnrujqguh\",\"type\":\"uouq\"}],\"nextLink\":\"rwzwbng\"}") - .toObject(SyncIdentityProviderList.class); - Assertions.assertEquals("uvfqawrlyxwj", model.value().get(0).resources()); - Assertions.assertEquals("rwzwbng", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncIdentityProviderList model = new SyncIdentityProviderList() - .withValue(Arrays.asList(new SyncIdentityProviderInner().withResources("uvfqawrlyxwj"))) - .withNextLink("rwzwbng"); - model = BinaryData.fromObject(model).toObject(SyncIdentityProviderList.class); - Assertions.assertEquals("uvfqawrlyxwj", model.value().get(0).resources()); - Assertions.assertEquals("rwzwbng", model.nextLink()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderPropertiesTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderPropertiesTests.java deleted file mode 100644 index 3119fb664bc4..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncIdentityProviderProperties; -import org.junit.jupiter.api.Assertions; - -public final class SyncIdentityProviderPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncIdentityProviderProperties model - = BinaryData.fromString("{\"resources\":\"rfidfvzwdz\"}").toObject(SyncIdentityProviderProperties.class); - Assertions.assertEquals("rfidfvzwdz", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncIdentityProviderProperties model = new SyncIdentityProviderProperties().withResources("rfidfvzwdz"); - model = BinaryData.fromObject(model).toObject(SyncIdentityProviderProperties.class); - Assertions.assertEquals("rfidfvzwdz", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderUpdateTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderUpdateTests.java deleted file mode 100644 index eccff06fd974..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProviderUpdateTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProviderUpdate; -import org.junit.jupiter.api.Assertions; - -public final class SyncIdentityProviderUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncIdentityProviderUpdate model = BinaryData.fromString("{\"properties\":{\"resources\":\"mmajtjaodx\"}}") - .toObject(SyncIdentityProviderUpdate.class); - Assertions.assertEquals("mmajtjaodx", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncIdentityProviderUpdate model = new SyncIdentityProviderUpdate().withResources("mmajtjaodx"); - model = BinaryData.fromObject(model).toObject(SyncIdentityProviderUpdate.class); - Assertions.assertEquals("mmajtjaodx", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index b8a8742a4da3..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncIdentityProvidersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"resources\":\"spkwlhzdobpxjm\"},\"id\":\"bvvnchrkcciw\",\"name\":\"zjuqkhrsaj\",\"type\":\"wkuofoskghsauu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SyncIdentityProvider response = manager.syncIdentityProviders() - .define("fqrvkdvjsllrmvvd") - .withExistingOpenshiftcluster("b", "oczvy") - .withResources("t") - .create(); - - Assertions.assertEquals("spkwlhzdobpxjm", response.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteWithResponseMockTests.java deleted file mode 100644 index a81f079d7a1e..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncIdentityProvidersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.syncIdentityProviders().deleteWithResponse("stkiiuxhqyud", "o", "rq", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetWithResponseMockTests.java deleted file mode 100644 index 6cc99c9e5530..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncIdentityProvidersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"resources\":\"ezyiuokktwhrdxw\"},\"id\":\"wqsmbsur\",\"name\":\"xim\",\"type\":\"ryocfsfksymdd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SyncIdentityProvider response = manager.syncIdentityProviders() - .getWithResponse("jmcmatuokthfu", "uaodsfcpk", "xodpuozmyzydagfu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ezyiuokktwhrdxw", response.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListMockTests.java deleted file mode 100644 index 60ac7f58549b..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncIdentityProvidersListMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.SyncIdentityProvider; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncIdentityProvidersListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"resources\":\"vmdajvnysou\"},\"id\":\"e\",\"name\":\"a\",\"type\":\"oaeupfhyhltrpmo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.syncIdentityProviders().list("yvxyqjp", "cattpngjcrcczsq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vmdajvnysou", response.iterator().next().resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetInnerTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetInnerTests.java deleted file mode 100644 index b4f28473c0b0..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; -import org.junit.jupiter.api.Assertions; - -public final class SyncSetInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncSetInner model = BinaryData.fromString( - "{\"properties\":{\"resources\":\"newmdwzjeiachbo\"},\"id\":\"flnrosfqpteehzz\",\"name\":\"ypyqrimzinp\",\"type\":\"swjdkirso\"}") - .toObject(SyncSetInner.class); - Assertions.assertEquals("newmdwzjeiachbo", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncSetInner model = new SyncSetInner().withResources("newmdwzjeiachbo"); - model = BinaryData.fromObject(model).toObject(SyncSetInner.class); - Assertions.assertEquals("newmdwzjeiachbo", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetListTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetListTests.java deleted file mode 100644 index ac7c36cbdb55..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetListTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetInner; -import com.azure.resourcemanager.redhatopenshift.models.SyncSetList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SyncSetListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncSetList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resources\":\"wisdkft\"},\"id\":\"xmnteiwaop\",\"name\":\"km\",\"type\":\"jcmmxdcufufsrp\"}],\"nextLink\":\"zidnsezcxtbzsgfy\"}") - .toObject(SyncSetList.class); - Assertions.assertEquals("wisdkft", model.value().get(0).resources()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncSetList model = new SyncSetList().withValue(Arrays.asList(new SyncSetInner().withResources("wisdkft"))) - .withNextLink("zidnsezcxtbzsgfy"); - model = BinaryData.fromObject(model).toObject(SyncSetList.class); - Assertions.assertEquals("wisdkft", model.value().get(0).resources()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.nextLink()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetPropertiesTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetPropertiesTests.java deleted file mode 100644 index ad61a2ab3148..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.fluent.models.SyncSetProperties; -import org.junit.jupiter.api.Assertions; - -public final class SyncSetPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncSetProperties model - = BinaryData.fromString("{\"resources\":\"qxhcrmn\"}").toObject(SyncSetProperties.class); - Assertions.assertEquals("qxhcrmn", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncSetProperties model = new SyncSetProperties().withResources("qxhcrmn"); - model = BinaryData.fromObject(model).toObject(SyncSetProperties.class); - Assertions.assertEquals("qxhcrmn", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetUpdateTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetUpdateTests.java deleted file mode 100644 index 2920c79102fe..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetUpdateTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redhatopenshift.models.SyncSetUpdate; -import org.junit.jupiter.api.Assertions; - -public final class SyncSetUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncSetUpdate model - = BinaryData.fromString("{\"properties\":{\"resources\":\"dxkqpx\"}}").toObject(SyncSetUpdate.class); - Assertions.assertEquals("dxkqpx", model.resources()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncSetUpdate model = new SyncSetUpdate().withResources("dxkqpx"); - model = BinaryData.fromObject(model).toObject(SyncSetUpdate.class); - Assertions.assertEquals("dxkqpx", model.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 0d086c0ff543..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncSetsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"resources\":\"wnuzoqftiyqzrnkc\"},\"id\":\"yx\",\"name\":\"whzlsicohoq\",\"type\":\"nwvlryavwhheunmm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SyncSet response = manager.syncSets() - .define("ishc") - .withExistingOpenshiftcluster("cwif", "jttgzf") - .withResources("ajdeyeamdphaga") - .create(); - - Assertions.assertEquals("wnuzoqftiyqzrnkc", response.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteWithResponseMockTests.java deleted file mode 100644 index 174da82747d3..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncSetsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.syncSets() - .deleteWithResponse("ucgygevqz", "typmrbpizcdrqjsd", "ydnfyhxdeoejz", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetWithResponseMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetWithResponseMockTests.java deleted file mode 100644 index cfaf44856f43..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncSetsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"resources\":\"jnspydp\"},\"id\":\"oenkouknvudwti\",\"name\":\"kbldngkpocipa\",\"type\":\"yxoegukgjnp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SyncSet response = manager.syncSets() - .getWithResponse("lvmezyvshxmzsbbz", "ggi", "rxwburv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jnspydp", response.resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListMockTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListMockTests.java deleted file mode 100644 index cc8f509c4c71..000000000000 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/SyncSetsListMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.redhatopenshift.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.redhatopenshift.RedHatOpenShiftManager; -import com.azure.resourcemanager.redhatopenshift.models.SyncSet; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SyncSetsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"resources\":\"osvexcsonpclhoc\"},\"id\":\"slkevle\",\"name\":\"gz\",\"type\":\"buhfmvfaxkffeiit\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RedHatOpenShiftManager manager = RedHatOpenShiftManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.syncSets().list("mjmvxieduugidyjr", "f", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("osvexcsonpclhoc", response.iterator().next().resources()); - } -} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/UserAssignedIdentityTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..01ca14057c99 --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/UserAssignedIdentityTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshift.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redhatopenshift.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"pofm\",\"clientId\":\"x\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/WorkerProfileTests.java b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/WorkerProfileTests.java index 280041588f9e..48fd11ede962 100644 --- a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/WorkerProfileTests.java +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/src/test/java/com/azure/resourcemanager/redhatopenshift/generated/WorkerProfileTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redhatopenshift.generated; @@ -13,33 +13,33 @@ public final class WorkerProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkerProfile model = BinaryData.fromString( - "{\"name\":\"tnhxbn\",\"vmSize\":\"iksqr\",\"diskSizeGB\":1154463022,\"subnetId\":\"ainqpjwnzlljfm\",\"count\":450622751,\"encryptionAtHost\":\"Enabled\",\"diskEncryptionSetId\":\"mgxsab\"}") + "{\"name\":\"j\",\"vmSize\":\"btoqcjmkljavbqid\",\"diskSizeGB\":1381464845,\"subnetId\":\"zyulp\",\"count\":377543492,\"encryptionAtHost\":\"Enabled\",\"diskEncryptionSetId\":\"lkhbz\"}") .toObject(WorkerProfile.class); - Assertions.assertEquals("tnhxbn", model.name()); - Assertions.assertEquals("iksqr", model.vmSize()); - Assertions.assertEquals(1154463022, model.diskSizeGB()); - Assertions.assertEquals("ainqpjwnzlljfm", model.subnetId()); - Assertions.assertEquals(450622751, model.count()); + Assertions.assertEquals("j", model.name()); + Assertions.assertEquals("btoqcjmkljavbqid", model.vmSize()); + Assertions.assertEquals(1381464845, model.diskSizeGB()); + Assertions.assertEquals("zyulp", model.subnetId()); + Assertions.assertEquals(377543492, model.count()); Assertions.assertEquals(EncryptionAtHost.ENABLED, model.encryptionAtHost()); - Assertions.assertEquals("mgxsab", model.diskEncryptionSetId()); + Assertions.assertEquals("lkhbz", model.diskEncryptionSetId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkerProfile model = new WorkerProfile().withName("tnhxbn") - .withVmSize("iksqr") - .withDiskSizeGB(1154463022) - .withSubnetId("ainqpjwnzlljfm") - .withCount(450622751) + WorkerProfile model = new WorkerProfile().withName("j") + .withVmSize("btoqcjmkljavbqid") + .withDiskSizeGB(1381464845) + .withSubnetId("zyulp") + .withCount(377543492) .withEncryptionAtHost(EncryptionAtHost.ENABLED) - .withDiskEncryptionSetId("mgxsab"); + .withDiskEncryptionSetId("lkhbz"); model = BinaryData.fromObject(model).toObject(WorkerProfile.class); - Assertions.assertEquals("tnhxbn", model.name()); - Assertions.assertEquals("iksqr", model.vmSize()); - Assertions.assertEquals(1154463022, model.diskSizeGB()); - Assertions.assertEquals("ainqpjwnzlljfm", model.subnetId()); - Assertions.assertEquals(450622751, model.count()); + Assertions.assertEquals("j", model.name()); + Assertions.assertEquals("btoqcjmkljavbqid", model.vmSize()); + Assertions.assertEquals(1381464845, model.diskSizeGB()); + Assertions.assertEquals("zyulp", model.subnetId()); + Assertions.assertEquals(377543492, model.count()); Assertions.assertEquals(EncryptionAtHost.ENABLED, model.encryptionAtHost()); - Assertions.assertEquals("mgxsab", model.diskEncryptionSetId()); + Assertions.assertEquals("lkhbz", model.diskEncryptionSetId()); } } diff --git a/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/tsp-location.yaml b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/tsp-location.yaml new file mode 100644 index 000000000000..0555c251567e --- /dev/null +++ b/sdk/redhatopenshift/azure-resourcemanager-redhatopenshift/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/OpenShiftClusters +commit: c30e9d0376fb34c59c3207b09b4e933eee295e50 +repo: Azure/azure-rest-api-specs +additionalDirectories: