From 7ed9593c5fe402f0225eb9335c8d2064460db64b Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 30 Mar 2026 14:28:21 +0000 Subject: [PATCH] Configurations: 'specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb/tspconfig.yaml', API Version: 2026-01-20-preview, SDK Release Type: beta, and CommitSHA: 'f6e1fbd6268be7712bf96a516ba846f7d42e2baa' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6080421 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../azure-resourcemanager-horizondb/README.md | 102 ++ .../azure-resourcemanager-horizondb/SAMPLE.md | 922 ++++++++++ .../azure-resourcemanager-horizondb/pom.xml | 74 + .../horizondb/HorizonDbManager.java | 398 +++++ .../fluent/HorizonDbClustersClient.java | 454 +++++ .../fluent/HorizonDbFirewallRulesClient.java | 369 ++++ .../fluent/HorizonDbManagementClient.java | 104 ++ .../HorizonDbParameterGroupsClient.java | 566 ++++++ .../fluent/HorizonDbPoolsClient.java | 118 ++ ...zonDbPrivateEndpointConnectionsClient.java | 351 ++++ .../HorizonDbPrivateLinkResourcesClient.java | 122 ++ .../fluent/HorizonDbReplicasClient.java | 487 +++++ .../horizondb/fluent/OperationsClient.java | 52 + .../fluent/models/HorizonDbClusterInner.java | 181 ++ .../models/HorizonDbFirewallRuleInner.java | 156 ++ ...rameterGroupConnectionPropertiesInner.java | 107 ++ .../models/HorizonDbParameterGroupInner.java | 182 ++ .../fluent/models/HorizonDbPoolInner.java | 163 ++ .../HorizonDbPrivateLinkResourceInner.java | 146 ++ .../fluent/models/HorizonDbReplicaInner.java | 155 ++ .../fluent/models/OperationInner.java | 150 ++ .../PrivateEndpointConnectionInner.java | 146 ++ ...rivateEndpointConnectionResourceInner.java | 146 ++ .../horizondb/fluent/models/package-info.java | 9 + .../horizondb/fluent/package-info.java | 9 + .../implementation/HorizonDbClusterImpl.java | 184 ++ .../HorizonDbClustersClientImpl.java | 1098 ++++++++++++ .../implementation/HorizonDbClustersImpl.java | 143 ++ .../HorizonDbFirewallRuleImpl.java | 136 ++ .../HorizonDbFirewallRulesClientImpl.java | 809 +++++++++ .../HorizonDbFirewallRulesImpl.java | 179 ++ .../HorizonDbManagementClientBuilder.java | 138 ++ .../HorizonDbManagementClientImpl.java | 420 +++++ ...arameterGroupConnectionPropertiesImpl.java | 41 + .../HorizonDbParameterGroupImpl.java | 184 ++ .../HorizonDbParameterGroupsClientImpl.java | 1582 +++++++++++++++++ .../HorizonDbParameterGroupsImpl.java | 175 ++ .../implementation/HorizonDbPoolImpl.java | 61 + .../HorizonDbPoolsClientImpl.java | 356 ++++ .../implementation/HorizonDbPoolsImpl.java | 64 + ...bPrivateEndpointConnectionsClientImpl.java | 777 ++++++++ ...rizonDbPrivateEndpointConnectionsImpl.java | 104 ++ .../HorizonDbPrivateLinkResourceImpl.java | 50 + ...rizonDbPrivateLinkResourcesClientImpl.java | 367 ++++ .../HorizonDbPrivateLinkResourcesImpl.java | 69 + .../implementation/HorizonDbReplicaImpl.java | 144 ++ .../HorizonDbReplicasClientImpl.java | 1023 +++++++++++ .../implementation/HorizonDbReplicasImpl.java | 176 ++ .../implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 242 +++ .../implementation/OperationsImpl.java | 45 + .../PrivateEndpointConnectionImpl.java | 50 + ...PrivateEndpointConnectionResourceImpl.java | 50 + .../implementation/ResourceManagerUtils.java | 195 ++ .../models/HorizonDbClusterListResult.java | 96 + .../HorizonDbFirewallRuleListResult.java | 97 + ...erGroupConnectionPropertiesListResult.java | 99 ++ .../HorizonDbParameterGroupListResult.java | 97 + .../models/HorizonDbPoolListResult.java | 95 + ...orizonDbPrivateLinkResourceListResult.java | 98 + .../models/HorizonDbReplicaListResult.java | 96 + .../models/OperationListResult.java | 96 + ...eEndpointConnectionResourceListResult.java | 98 + .../implementation/package-info.java | 9 + .../horizondb/models/ActionType.java | 46 + .../horizondb/models/CreateModeCluster.java | 56 + .../horizondb/models/CreateModePool.java | 51 + .../horizondb/models/HorizonDbCluster.java | 265 +++ .../HorizonDbClusterForPatchUpdate.java | 117 ++ ...terParameterGroupConnectionProperties.java | 133 ++ .../models/HorizonDbClusterProperties.java | 497 ++++++ ...izonDbClusterPropertiesForPatchUpdate.java | 147 ++ .../horizondb/models/HorizonDbClusters.java | 158 ++ .../models/HorizonDbFirewallRule.java | 190 ++ .../HorizonDbFirewallRuleProperties.java | 160 ++ .../models/HorizonDbFirewallRules.java | 152 ++ .../models/HorizonDbParameterGroup.java | 265 +++ ...nDbParameterGroupConnectionProperties.java | 41 + ...HorizonDbParameterGroupForPatchUpdate.java | 119 ++ .../HorizonDbParameterGroupProperties.java | 207 +++ ...arameterGroupPropertiesForPatchUpdate.java | 147 ++ .../models/HorizonDbParameterGroups.java | 218 +++ .../horizondb/models/HorizonDbPool.java | 63 + .../models/HorizonDbPoolProperties.java | 155 ++ .../horizondb/models/HorizonDbPools.java | 67 + .../HorizonDbPrivateEndpointConnections.java | 129 ++ .../models/HorizonDbPrivateLinkResource.java | 55 + .../models/HorizonDbPrivateLinkResources.java | 69 + .../horizondb/models/HorizonDbReplica.java | 190 ++ .../HorizonDbReplicaForPatchUpdate.java | 87 + .../models/HorizonDbReplicaProperties.java | 162 ++ ...izonDbReplicaPropertiesForPatchUpdate.java | 88 + .../horizondb/models/HorizonDbReplicas.java | 151 ++ .../horizondb/models/Network.java | 73 + .../horizondb/models/Operation.java | 58 + .../horizondb/models/OperationDisplay.java | 128 ++ .../horizondb/models/Operations.java | 35 + ...ptionalPropertiesUpdateableProperties.java | 120 ++ .../horizondb/models/Origin.java | 57 + .../horizondb/models/ParameterProperties.java | 225 +++ .../horizondb/models/PrivateEndpoint.java | 73 + .../models/PrivateEndpointConnection.java | 55 + .../PrivateEndpointConnectionProperties.java | 131 ++ ...teEndpointConnectionProvisioningState.java | 62 + .../PrivateEndpointConnectionResource.java | 55 + .../PrivateEndpointConnectionUpdate.java | 87 + ...rivateEndpointServiceConnectionStatus.java | 57 + .../models/PrivateLinkResourceProperties.java | 111 ++ .../PrivateLinkServiceConnectionState.java | 147 ++ .../horizondb/models/ProvisioningState.java | 66 + .../models/PublicNetworkAccessState.java | 51 + .../horizondb/models/ReplicaRole.java | 51 + .../horizondb/models/State.java | 81 + .../horizondb/models/ZonePlacementPolicy.java | 51 + .../horizondb/models/package-info.java | 9 + .../horizondb/package-info.java | 9 + .../src/main/java/module-info.java | 16 + ...re-resourcemanager-horizondb_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...azure-resourcemanager-horizondb.properties | 1 + ...orizonDbClustersCreateOrUpdateSamples.java | 54 + .../HorizonDbClustersDeleteSamples.java | 22 + ...onDbClustersGetByResourceGroupSamples.java | 23 + ...nDbClustersListByResourceGroupSamples.java | 23 + .../HorizonDbClustersListSamples.java | 23 + .../HorizonDbClustersUpdateSamples.java | 47 + ...nDbFirewallRulesCreateOrUpdateSamples.java | 31 + .../HorizonDbFirewallRulesDeleteSamples.java | 24 + .../HorizonDbFirewallRulesGetSamples.java | 24 + .../HorizonDbFirewallRulesListSamples.java | 23 + ...bParameterGroupsCreateOrUpdateSamples.java | 53 + ...HorizonDbParameterGroupsDeleteSamples.java | 23 + ...ameterGroupsGetByResourceGroupSamples.java | 24 + ...meterGroupsListByResourceGroupSamples.java | 24 + ...ParameterGroupsListConnectionsSamples.java | 24 + .../HorizonDbParameterGroupsListSamples.java | 23 + ...nDbParameterGroupsListVersionsSamples.java | 24 + ...HorizonDbParameterGroupsUpdateSamples.java | 52 + .../generated/HorizonDbPoolsGetSamples.java | 23 + .../generated/HorizonDbPoolsListSamples.java | 22 + ...ivateEndpointConnectionsDeleteSamples.java | 24 + ...bPrivateEndpointConnectionsGetSamples.java | 25 + ...PrivateEndpointConnectionsListSamples.java | 24 + ...ivateEndpointConnectionsUpdateSamples.java | 34 + ...rizonDbPrivateLinkResourcesGetSamples.java | 24 + ...izonDbPrivateLinkResourcesListSamples.java | 24 + ...orizonDbReplicasCreateOrUpdateSamples.java | 29 + .../HorizonDbReplicasDeleteSamples.java | 24 + .../HorizonDbReplicasGetSamples.java | 24 + .../HorizonDbReplicasListSamples.java | 23 + .../HorizonDbReplicasUpdateSamples.java | 32 + .../generated/OperationsListSamples.java | 23 + ...rameterGroupConnectionPropertiesTests.java | 30 + .../HorizonDbFirewallRuleInnerTests.java | 34 + .../HorizonDbFirewallRuleListResultTests.java | 22 + .../HorizonDbFirewallRulePropertiesTests.java | 32 + ...bFirewallRulesCreateOrUpdateMockTests.java | 46 + ...FirewallRulesGetWithResponseMockTests.java | 41 + .../HorizonDbFirewallRulesListMockTests.java | 41 + ...erGroupConnectionPropertiesInnerTests.java | 17 + ...upConnectionPropertiesListResultTests.java | 19 + ...onDbParameterGroupForPatchUpdateTests.java | 57 + .../HorizonDbParameterGroupInnerTests.java | 64 + ...orizonDbParameterGroupListResultTests.java | 26 + ...terGroupPropertiesForPatchUpdateTests.java | 37 + ...orizonDbParameterGroupPropertiesTests.java | 41 + ...arameterGroupsCreateOrUpdateMockTests.java | 72 + ...tByResourceGroupWithResponseMockTests.java | 45 + ...terGroupsListByResourceGroupMockTests.java | 45 + ...rameterGroupsListConnectionsMockTests.java | 36 + ...HorizonDbParameterGroupsListMockTests.java | 45 + ...bParameterGroupsListVersionsMockTests.java | 45 + .../generated/HorizonDbPoolInnerTests.java | 20 + .../HorizonDbPoolListResultTests.java | 21 + .../HorizonDbPoolPropertiesTests.java | 19 + ...orizonDbPoolsGetWithResponseMockTests.java | 40 + .../HorizonDbPoolsListMockTests.java | 40 + ...ntConnectionsGetWithResponseMockTests.java | 43 + ...ivateEndpointConnectionsListMockTests.java | 45 + ...ateEndpointConnectionsUpdateMockTests.java | 53 + ...orizonDbPrivateLinkResourceInnerTests.java | 19 + ...nDbPrivateLinkResourceListResultTests.java | 20 + ...LinkResourcesGetWithResponseMockTests.java | 39 + ...onDbPrivateLinkResourcesListMockTests.java | 39 + .../HorizonDbReplicaForPatchUpdateTests.java | 28 + .../generated/HorizonDbReplicaInnerTests.java | 31 + .../HorizonDbReplicaListResultTests.java | 22 + ...bReplicaPropertiesForPatchUpdateTests.java | 27 + .../HorizonDbReplicaPropertiesTests.java | 30 + ...izonDbReplicasCreateOrUpdateMockTests.java | 44 + ...zonDbReplicasGetWithResponseMockTests.java | 41 + .../HorizonDbReplicasListMockTests.java | 41 + .../horizondb/generated/NetworkTests.java | 21 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 36 + ...alPropertiesUpdateablePropertiesTests.java | 40 + .../generated/ParameterPropertiesTests.java | 28 + .../PrivateEndpointConnectionInnerTests.java | 23 + ...vateEndpointConnectionPropertiesTests.java | 23 + ...eEndpointConnectionResourceInnerTests.java | 25 + ...ointConnectionResourceListResultTests.java | 26 + .../PrivateEndpointConnectionUpdateTests.java | 42 + .../generated/PrivateEndpointTests.java | 21 + .../PrivateLinkResourcePropertiesTests.java | 19 + ...rivateLinkServiceConnectionStateTests.java | 34 + .../tsp-location.yaml | 4 + sdk/horizondb/ci.yml | 46 + sdk/horizondb/pom.xml | 15 + 214 files changed, 24278 insertions(+) create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/CHANGELOG.md create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/README.md create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/SAMPLE.md create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/pom.xml create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/HorizonDbManager.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbClustersClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbFirewallRulesClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbManagementClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbParameterGroupsClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPoolsClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateEndpointConnectionsClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateLinkResourcesClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbReplicasClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/OperationsClient.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbClusterInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbFirewallRuleInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupConnectionPropertiesInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPoolInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPrivateLinkResourceInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbReplicaInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/OperationInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionResourceInner.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/package-info.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/package-info.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClusterImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRuleImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientBuilder.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupConnectionPropertiesImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourceImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicaImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsClientImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionResourceImpl.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/ResourceManagerUtils.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbClusterListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbFirewallRuleListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupConnectionPropertiesListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPoolListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPrivateLinkResourceListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbReplicaListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/OperationListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/PrivateEndpointConnectionResourceListResult.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/package-info.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ActionType.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModeCluster.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModePool.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbCluster.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterForPatchUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterParameterGroupConnectionProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterPropertiesForPatchUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusters.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRule.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRuleProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRules.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroup.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupConnectionProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupForPatchUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupPropertiesForPatchUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroups.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPool.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPoolProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPools.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateEndpointConnections.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResource.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResources.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplica.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaForPatchUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaPropertiesForPatchUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicas.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Network.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operation.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OperationDisplay.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operations.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OptionalPropertiesUpdateableProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Origin.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ParameterProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpoint.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnection.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionResource.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionUpdate.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkResourceProperties.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ProvisioningState.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PublicNetworkAccessState.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ReplicaRole.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/State.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ZonePlacementPolicy.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/package-info.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/package-info.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/module-info.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/azure-resourcemanager-horizondb_metadata.json create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/proxy-config.json create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/reflect-config.json create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/azure-resourcemanager-horizondb.properties create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersCreateOrUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersDeleteSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersGetByResourceGroupSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListByResourceGroupSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesDeleteSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsDeleteSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasDeleteSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasUpdateSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/OperationsListSamples.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClusterParameterGroupConnectionPropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulePropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetWithResponseMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupForPatchUpdateTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesForPatchUpdateTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolPropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetWithResponseMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetWithResponseMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetWithResponseMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaForPatchUpdateTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesForPatchUpdateTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetWithResponseMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/NetworkTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationDisplayTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationsListMockTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OptionalPropertiesUpdateablePropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/ParameterPropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionPropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceInnerTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceListResultTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionUpdateTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkResourcePropertiesTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkServiceConnectionStateTests.java create mode 100644 sdk/horizondb/azure-resourcemanager-horizondb/tsp-location.yaml create mode 100644 sdk/horizondb/ci.yml create mode 100644 sdk/horizondb/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 01c42e4c4898..18cd41322a55 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -523,6 +523,7 @@ com.azure.resourcemanager:azure-resourcemanager-computebulkactions;1.0.0-beta.1; com.azure.resourcemanager:azure-resourcemanager-artifactsigning;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appnetwork;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-servicegroups;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-horizondb;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index a865180fc213..f4b91c68547b 100644 --- a/pom.xml +++ b/pom.xml @@ -131,6 +131,7 @@ sdk/healthcareapis sdk/healthdataaiservices sdk/healthinsights + sdk/horizondb sdk/hybridcompute sdk/hybridconnectivity sdk/hybridcontainerservice diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/CHANGELOG.md b/sdk/horizondb/azure-resourcemanager-horizondb/CHANGELOG.md new file mode 100644 index 000000000000..13ce18068365 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2026-03-30) + +- Azure Resource Manager HorizonDb client library for Java. This package contains Microsoft Azure SDK for HorizonDb Management SDK. Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. Package api-version 2026-01-20-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-horizondb Java SDK. diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/README.md b/sdk/horizondb/azure-resourcemanager-horizondb/README.md new file mode 100644 index 000000000000..698a0e1c4c1d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager HorizonDb client library for Java + +Azure Resource Manager HorizonDb client library for Java. + +This package contains Microsoft Azure SDK for HorizonDb Management SDK. Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. Package api-version 2026-01-20-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-horizondb;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-horizondb + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +HorizonDbManager manager = HorizonDbManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/horizondb/azure-resourcemanager-horizondb/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/SAMPLE.md b/sdk/horizondb/azure-resourcemanager-horizondb/SAMPLE.md new file mode 100644 index 000000000000..ee0c8b1dab97 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/SAMPLE.md @@ -0,0 +1,922 @@ +# Code snippets and samples + + +## HorizonDbClusters + +- [CreateOrUpdate](#horizondbclusters_createorupdate) +- [Delete](#horizondbclusters_delete) +- [GetByResourceGroup](#horizondbclusters_getbyresourcegroup) +- [List](#horizondbclusters_list) +- [ListByResourceGroup](#horizondbclusters_listbyresourcegroup) +- [Update](#horizondbclusters_update) + +## HorizonDbFirewallRules + +- [CreateOrUpdate](#horizondbfirewallrules_createorupdate) +- [Delete](#horizondbfirewallrules_delete) +- [Get](#horizondbfirewallrules_get) +- [List](#horizondbfirewallrules_list) + +## HorizonDbParameterGroups + +- [CreateOrUpdate](#horizondbparametergroups_createorupdate) +- [Delete](#horizondbparametergroups_delete) +- [GetByResourceGroup](#horizondbparametergroups_getbyresourcegroup) +- [List](#horizondbparametergroups_list) +- [ListByResourceGroup](#horizondbparametergroups_listbyresourcegroup) +- [ListConnections](#horizondbparametergroups_listconnections) +- [ListVersions](#horizondbparametergroups_listversions) +- [Update](#horizondbparametergroups_update) + +## HorizonDbPools + +- [Get](#horizondbpools_get) +- [List](#horizondbpools_list) + +## HorizonDbPrivateEndpointConnections + +- [Delete](#horizondbprivateendpointconnections_delete) +- [Get](#horizondbprivateendpointconnections_get) +- [List](#horizondbprivateendpointconnections_list) +- [Update](#horizondbprivateendpointconnections_update) + +## HorizonDbPrivateLinkResources + +- [Get](#horizondbprivatelinkresources_get) +- [List](#horizondbprivatelinkresources_list) + +## HorizonDbReplicas + +- [CreateOrUpdate](#horizondbreplicas_createorupdate) +- [Delete](#horizondbreplicas_delete) +- [Get](#horizondbreplicas_get) +- [List](#horizondbreplicas_list) +- [Update](#horizondbreplicas_update) + +## Operations + +- [List](#operations_list) +### HorizonDbClusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.horizondb.models.CreateModeCluster; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterProperties; +import com.azure.resourcemanager.horizondb.models.ZonePlacementPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbClusters CreateOrUpdate. + */ +public final class HorizonDbClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void createOrUpdateAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters() + .define("examplecluster") + .withRegion("westus2") + .withExistingResourceGroup("exampleresourcegroup") + .withTags(mapOf("env", "dev")) + .withProperties(new HorizonDbClusterProperties().withAdministratorLogin("exampleadministratorlogin") + .withAdministratorLoginPassword("fakeTokenPlaceholder") + .withVersion("17") + .withCreateMode(CreateModeCluster.CREATE) + .withSourceClusterResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/examplesourceresourcegroup/providers/Microsoft.HorizonDb/clusters/examplesourcecluster") + .withReplicaCount(2) + .withVCores(4) + .withZonePlacementPolicy(ZonePlacementPolicy.STRICT)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HorizonDbClusters_Delete + +```java +/** + * Samples for HorizonDbClusters Delete. + */ +public final class HorizonDbClustersDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_Delete.json + */ + /** + * Sample code: Delete a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters().delete("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbClusters_GetByResourceGroup + +```java +/** + * Samples for HorizonDbClusters GetByResourceGroup. + */ +public final class HorizonDbClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_Get.json + */ + /** + * Sample code: Get a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters() + .getByResourceGroupWithResponse("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbClusters_List + +```java +/** + * Samples for HorizonDbClusters List. + */ +public final class HorizonDbClustersListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_ListBySubscription.json + */ + /** + * Sample code: List HorizonDb clusters by subscription. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbClustersBySubscription(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbClusters_ListByResourceGroup + +```java +/** + * Samples for HorizonDbClusters ListByResourceGroup. + */ +public final class HorizonDbClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_ListByResourceGroup.json + */ + /** + * Sample code: List HorizonDb clusters in a resource group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbClustersInAResourceGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters().listByResourceGroup("exampleresourcegroup", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbClusters_Update + +```java +import com.azure.resourcemanager.horizondb.models.HorizonDbCluster; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbClusters Update. + */ +public final class HorizonDbClustersUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_Update.json + */ + /** + * Sample code: Update a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void updateAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + HorizonDbCluster resource = manager.horizonDbClusters() + .getByResourceGroupWithResponse("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("team", "updated-data-platform")) + .withProperties( + new HorizonDbClusterPropertiesForPatchUpdate().withAdministratorLoginPassword("fakeTokenPlaceholder") + .withVCores(8)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HorizonDbFirewallRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; + +/** + * Samples for HorizonDbFirewallRules CreateOrUpdate. + */ +public final class HorizonDbFirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb firewall rule. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + createOrUpdateAHorizonDbFirewallRule(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .define("examplefirewallrule") + .withExistingPool("exampleresourcegroup", "examplecluster", "examplepool") + .withProperties(new HorizonDbFirewallRuleProperties().withStartIpAddress("10.0.0.1") + .withEndIpAddress("10.0.0.10") + .withDescription("Allow access from corporate network")) + .create(); + } +} +``` + +### HorizonDbFirewallRules_Delete + +```java +/** + * Samples for HorizonDbFirewallRules Delete. + */ +public final class HorizonDbFirewallRulesDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_Delete.json + */ + /** + * Sample code: Delete a HorizonDb firewall rule. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbFirewallRule(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .delete("exampleresourcegroup", "examplecluster", "examplepool", "examplefirewallrule", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbFirewallRules_Get + +```java +/** + * Samples for HorizonDbFirewallRules Get. + */ +public final class HorizonDbFirewallRulesGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_Get.json + */ + /** + * Sample code: Get a HorizonDb firewall rule. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbFirewallRule(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", "examplefirewallrule", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbFirewallRules_List + +```java +/** + * Samples for HorizonDbFirewallRules List. + */ +public final class HorizonDbFirewallRulesListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_List.json + */ + /** + * Sample code: List HorizonDb firewall rules in a pool. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void listHorizonDbFirewallRulesInAPool(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .list("exampleresourcegroup", "examplecluster", "examplepool", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbParameterGroups CreateOrUpdate. + */ +public final class HorizonDbParameterGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + createOrUpdateAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .define("exampleparametergroup") + .withRegion("westus2") + .withExistingResourceGroup("exampleresourcegroup") + .withTags(mapOf("env", "dev", "team", "data-platform")) + .withProperties(new HorizonDbParameterGroupProperties() + .withParameters(Arrays.asList(new ParameterProperties().withName("max_connections").withValue("200"), + new ParameterProperties().withName("log_min_error_statement").withValue("error"), + new ParameterProperties().withName("shared_buffers").withValue("2000"))) + .withDescription("Parameter group for high-throughput workloads") + .withPgVersion(17) + .withApplyImmediately(true)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HorizonDbParameterGroups_Delete + +```java +/** + * Samples for HorizonDbParameterGroups Delete. + */ +public final class HorizonDbParameterGroupsDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_Delete.json + */ + /** + * Sample code: Delete a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .delete("exampleresourcegroup", "exampleparametergroup", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_GetByResourceGroup + +```java +/** + * Samples for HorizonDbParameterGroups GetByResourceGroup. + */ +public final class HorizonDbParameterGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_Get.json + */ + /** + * Sample code: Get a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .getByResourceGroupWithResponse("exampleresourcegroup", "exampleparametergroup", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_List + +```java +/** + * Samples for HorizonDbParameterGroups List. + */ +public final class HorizonDbParameterGroupsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListBySubscription.json + */ + /** + * Sample code: List HorizonDb parameter groups in a subscription. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbParameterGroupsInASubscription(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_ListByResourceGroup + +```java +/** + * Samples for HorizonDbParameterGroups ListByResourceGroup. + */ +public final class HorizonDbParameterGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListByResourceGroup.json + */ + /** + * Sample code: List HorizonDb parameter groups in a resource group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbParameterGroupsInAResourceGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .listByResourceGroup("exampleresourcegroup", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_ListConnections + +```java +/** + * Samples for HorizonDbParameterGroups ListConnections. + */ +public final class HorizonDbParameterGroupsListConnectionsSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListConnections.json + */ + /** + * Sample code: List connections for a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listConnectionsForAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .listConnections("exampleresourcegroup", "exampleparametergroup", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_ListVersions + +```java +/** + * Samples for HorizonDbParameterGroups ListVersions. + */ +public final class HorizonDbParameterGroupsListVersionsSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListVersions.json + */ + /** + * Sample code: List parameter groups filtered by version. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listParameterGroupsFilteredByVersion(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .listVersions("exampleresourcegroup", "exampleparametergroup", 22, com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbParameterGroups_Update + +```java +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbParameterGroups Update. + */ +public final class HorizonDbParameterGroupsUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_Update.json + */ + /** + * Sample code: Update a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void updateAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + HorizonDbParameterGroup resource = manager.horizonDbParameterGroups() + .getByResourceGroupWithResponse("exampleresourcegroup", "exampleparametergroup", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("team", "updated-data-platform")) + .withProperties(new HorizonDbParameterGroupPropertiesForPatchUpdate() + .withParameters(Arrays.asList(new ParameterProperties().withName("max_connections").withValue("300"), + new ParameterProperties().withName("log_min_error_statement").withValue("warning"))) + .withDescription("Updated parameter group for high-throughput workloads") + .withApplyImmediately(true)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HorizonDbPools_Get + +```java +/** + * Samples for HorizonDbPools Get. + */ +public final class HorizonDbPoolsGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Pools_Get.json + */ + /** + * Sample code: Get a HorizonDb pool. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbPool(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPools() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPools_List + +```java +/** + * Samples for HorizonDbPools List. + */ +public final class HorizonDbPoolsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Pools_List.json + */ + /** + * Sample code: List HorizonDb pools in a cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void listHorizonDbPoolsInACluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPools().list("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPrivateEndpointConnections_Delete + +```java +/** + * Samples for HorizonDbPrivateEndpointConnections Delete. + */ +public final class HorizonDbPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete a private endpoint connection. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAPrivateEndpointConnection(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .delete("exampleresourcegroup", "exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPrivateEndpointConnections_Get + +```java +/** + * Samples for HorizonDbPrivateEndpointConnections Get. + */ +public final class HorizonDbPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get a private endpoint connection. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAPrivateEndpointConnection(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .getWithResponse("exampleresourcegroup", "examplecluster", + "exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPrivateEndpointConnections_List + +```java +/** + * Samples for HorizonDbPrivateEndpointConnections List. + */ +public final class HorizonDbPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_List.json + */ + /** + * Sample code: List all private endpoint connections on a cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listAllPrivateEndpointConnectionsOnACluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .list("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPrivateEndpointConnections_Update + +```java +import com.azure.resourcemanager.horizondb.models.OptionalPropertiesUpdateableProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState; + +/** + * Samples for HorizonDbPrivateEndpointConnections Update. + */ +public final class HorizonDbPrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Update.json + */ + /** + * Sample code: Approve or reject a private endpoint connection. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + approveOrRejectAPrivateEndpointConnection(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .update("exampleresourcegroup", "exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + new PrivateEndpointConnectionUpdate().withProperties(new OptionalPropertiesUpdateableProperties() + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPrivateLinkResources_Get + +```java +/** + * Samples for HorizonDbPrivateLinkResources Get. + */ +public final class HorizonDbPrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateLinkResources_Get.json + */ + /** + * Sample code: Gets a private link resource for HorizonDb. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + getsAPrivateLinkResourceForHorizonDb(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateLinkResources() + .getWithResponse("exampleresourcegroup", "examplecluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbPrivateLinkResources_List + +```java +/** + * Samples for HorizonDbPrivateLinkResources List. + */ +public final class HorizonDbPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateLinkResources_List.json + */ + /** + * Sample code: Gets private link resources for HorizonDb. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + getsPrivateLinkResourcesForHorizonDb(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateLinkResources() + .list("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbReplicas_CreateOrUpdate + +```java +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; + +/** + * Samples for HorizonDbReplicas CreateOrUpdate. + */ +public final class HorizonDbReplicasCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void createOrUpdateAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .define("examplereplica") + .withExistingPool("exampleresourcegroup", "examplecluster", "examplepool") + .withProperties(new HorizonDbReplicaProperties().withRole(ReplicaRole.READ).withAvailabilityZone("1")) + .create(); + } +} +``` + +### HorizonDbReplicas_Delete + +```java +/** + * Samples for HorizonDbReplicas Delete. + */ +public final class HorizonDbReplicasDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_Delete.json + */ + /** + * Sample code: Delete a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .delete("exampleresourcegroup", "examplecluster", "examplepool", "examplereplica", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbReplicas_Get + +```java +/** + * Samples for HorizonDbReplicas Get. + */ +public final class HorizonDbReplicasGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_Get.json + */ + /** + * Sample code: Get a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", "examplereplica", + com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbReplicas_List + +```java +/** + * Samples for HorizonDbReplicas List. + */ +public final class HorizonDbReplicasListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_List.json + */ + /** + * Sample code: List HorizonDb replicas in a pool. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void listHorizonDbReplicasInAPool(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .list("exampleresourcegroup", "examplecluster", "examplepool", com.azure.core.util.Context.NONE); + } +} +``` + +### HorizonDbReplicas_Update + +```java +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; + +/** + * Samples for HorizonDbReplicas Update. + */ +public final class HorizonDbReplicasUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_Update.json + */ + /** + * Sample code: Update a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void updateAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + HorizonDbReplica resource = manager.horizonDbReplicas() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", "examplereplica", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new HorizonDbReplicaPropertiesForPatchUpdate().withRole(ReplicaRole.READ_WRITE)) + .apply(); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Operations_List.json + */ + /** + * Sample code: List operations for Microsoft.HorizonDb. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listOperationsForMicrosoftHorizonDb(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/pom.xml b/sdk/horizondb/azure-resourcemanager-horizondb/pom.xml new file mode 100644 index 000000000000..579cc5475dca --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-horizondb + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for HorizonDb Management + This package contains Microsoft Azure SDK for HorizonDb Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. Package api-version 2026-01-20-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.57.1 + + + com.azure + azure-core-management + 1.19.3 + + + com.azure + azure-core-test + 1.27.0-beta.14 + test + + + com.azure + azure-identity + 1.18.2 + test + + + diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/HorizonDbManager.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/HorizonDbManager.java new file mode 100644 index 000000000000..9b6ae1bf8bab --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/HorizonDbManager.java @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbManagementClient; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbClustersImpl; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbFirewallRulesImpl; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbManagementClientBuilder; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbParameterGroupsImpl; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbPoolsImpl; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbPrivateLinkResourcesImpl; +import com.azure.resourcemanager.horizondb.implementation.HorizonDbReplicasImpl; +import com.azure.resourcemanager.horizondb.implementation.OperationsImpl; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusters; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRules; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroups; +import com.azure.resourcemanager.horizondb.models.HorizonDbPools; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateEndpointConnections; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateLinkResources; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicas; +import com.azure.resourcemanager.horizondb.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to HorizonDbManager. + * Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. + */ +public final class HorizonDbManager { + private Operations operations; + + private HorizonDbClusters horizonDbClusters; + + private HorizonDbPools horizonDbPools; + + private HorizonDbReplicas horizonDbReplicas; + + private HorizonDbFirewallRules horizonDbFirewallRules; + + private HorizonDbPrivateEndpointConnections horizonDbPrivateEndpointConnections; + + private HorizonDbPrivateLinkResources horizonDbPrivateLinkResources; + + private HorizonDbParameterGroups horizonDbParameterGroups; + + private final HorizonDbManagementClient clientObject; + + private HorizonDbManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new HorizonDbManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of HorizonDb service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HorizonDb service API instance. + */ + public static HorizonDbManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of HorizonDb service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the HorizonDb service API instance. + */ + public static HorizonDbManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new HorizonDbManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create HorizonDbManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HorizonDbManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-horizondb.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of HorizonDb service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HorizonDb service API instance. + */ + public HorizonDbManager 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.horizondb") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new HorizonDbManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of HorizonDbClusters. It manages HorizonDbCluster. + * + * @return Resource collection API of HorizonDbClusters. + */ + public HorizonDbClusters horizonDbClusters() { + if (this.horizonDbClusters == null) { + this.horizonDbClusters = new HorizonDbClustersImpl(clientObject.getHorizonDbClusters(), this); + } + return horizonDbClusters; + } + + /** + * Gets the resource collection API of HorizonDbPools. + * + * @return Resource collection API of HorizonDbPools. + */ + public HorizonDbPools horizonDbPools() { + if (this.horizonDbPools == null) { + this.horizonDbPools = new HorizonDbPoolsImpl(clientObject.getHorizonDbPools(), this); + } + return horizonDbPools; + } + + /** + * Gets the resource collection API of HorizonDbReplicas. It manages HorizonDbReplica. + * + * @return Resource collection API of HorizonDbReplicas. + */ + public HorizonDbReplicas horizonDbReplicas() { + if (this.horizonDbReplicas == null) { + this.horizonDbReplicas = new HorizonDbReplicasImpl(clientObject.getHorizonDbReplicas(), this); + } + return horizonDbReplicas; + } + + /** + * Gets the resource collection API of HorizonDbFirewallRules. It manages HorizonDbFirewallRule. + * + * @return Resource collection API of HorizonDbFirewallRules. + */ + public HorizonDbFirewallRules horizonDbFirewallRules() { + if (this.horizonDbFirewallRules == null) { + this.horizonDbFirewallRules + = new HorizonDbFirewallRulesImpl(clientObject.getHorizonDbFirewallRules(), this); + } + return horizonDbFirewallRules; + } + + /** + * Gets the resource collection API of HorizonDbPrivateEndpointConnections. + * + * @return Resource collection API of HorizonDbPrivateEndpointConnections. + */ + public HorizonDbPrivateEndpointConnections horizonDbPrivateEndpointConnections() { + if (this.horizonDbPrivateEndpointConnections == null) { + this.horizonDbPrivateEndpointConnections = new HorizonDbPrivateEndpointConnectionsImpl( + clientObject.getHorizonDbPrivateEndpointConnections(), this); + } + return horizonDbPrivateEndpointConnections; + } + + /** + * Gets the resource collection API of HorizonDbPrivateLinkResources. + * + * @return Resource collection API of HorizonDbPrivateLinkResources. + */ + public HorizonDbPrivateLinkResources horizonDbPrivateLinkResources() { + if (this.horizonDbPrivateLinkResources == null) { + this.horizonDbPrivateLinkResources + = new HorizonDbPrivateLinkResourcesImpl(clientObject.getHorizonDbPrivateLinkResources(), this); + } + return horizonDbPrivateLinkResources; + } + + /** + * Gets the resource collection API of HorizonDbParameterGroups. It manages HorizonDbParameterGroup. + * + * @return Resource collection API of HorizonDbParameterGroups. + */ + public HorizonDbParameterGroups horizonDbParameterGroups() { + if (this.horizonDbParameterGroups == null) { + this.horizonDbParameterGroups + = new HorizonDbParameterGroupsImpl(clientObject.getHorizonDbParameterGroups(), this); + } + return horizonDbParameterGroups; + } + + /** + * Gets wrapped service client HorizonDbManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client HorizonDbManagementClient. + */ + public HorizonDbManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbClustersClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbClustersClient.java new file mode 100644 index 000000000000..38dc5659b4a2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbClustersClient.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterForPatchUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbClustersClient. + */ +public interface HorizonDbClustersClient { + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 information about a HorizonDb cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName); + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 information about a HorizonDb cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String clusterName); + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 information about a HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbClusterInner> + beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, HorizonDbClusterInner resource); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbClusterInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, HorizonDbClusterInner resource); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbClusterInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, HorizonDbClusterInner resource, Context context); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbClusterInner createOrUpdate(String resourceGroupName, String clusterName, HorizonDbClusterInner resource); + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbClusterInner createOrUpdate(String resourceGroupName, String clusterName, HorizonDbClusterInner resource, + Context context); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbClusterInner> beginUpdateAsync(String resourceGroupName, + String clusterName, HorizonDbClusterForPatchUpdate properties); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbClusterInner> beginUpdate(String resourceGroupName, + String clusterName, HorizonDbClusterForPatchUpdate properties); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbClusterInner> beginUpdate(String resourceGroupName, + String clusterName, HorizonDbClusterForPatchUpdate properties, Context context); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbClusterInner update(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties); + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbClusterInner update(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties, Context context); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbFirewallRulesClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbFirewallRulesClient.java new file mode 100644 index 000000000000..467a3b0f9b27 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbFirewallRulesClient.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbFirewallRulesClient. + */ +public interface HorizonDbFirewallRulesClient { + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName); + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName); + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, Context context); + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbFirewallRuleInner get(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName); + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName, HorizonDbFirewallRuleInner resource); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbFirewallRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + HorizonDbFirewallRuleInner resource); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbFirewallRuleInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + HorizonDbFirewallRuleInner resource); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbFirewallRuleInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + HorizonDbFirewallRuleInner resource, Context context); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, HorizonDbFirewallRuleInner resource); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbFirewallRuleInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, HorizonDbFirewallRuleInner resource); + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbFirewallRuleInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, HorizonDbFirewallRuleInner resource, Context context); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, Context context); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String clusterName, String poolName, String firewallRuleName); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 clusterName, String poolName, String firewallRuleName); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbManagementClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbManagementClient.java new file mode 100644 index 000000000000..42df379887a1 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbManagementClient.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for HorizonDbManagementClient class. + */ +public interface HorizonDbManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the HorizonDbClustersClient object to access its operations. + * + * @return the HorizonDbClustersClient object. + */ + HorizonDbClustersClient getHorizonDbClusters(); + + /** + * Gets the HorizonDbPoolsClient object to access its operations. + * + * @return the HorizonDbPoolsClient object. + */ + HorizonDbPoolsClient getHorizonDbPools(); + + /** + * Gets the HorizonDbReplicasClient object to access its operations. + * + * @return the HorizonDbReplicasClient object. + */ + HorizonDbReplicasClient getHorizonDbReplicas(); + + /** + * Gets the HorizonDbFirewallRulesClient object to access its operations. + * + * @return the HorizonDbFirewallRulesClient object. + */ + HorizonDbFirewallRulesClient getHorizonDbFirewallRules(); + + /** + * Gets the HorizonDbPrivateEndpointConnectionsClient object to access its operations. + * + * @return the HorizonDbPrivateEndpointConnectionsClient object. + */ + HorizonDbPrivateEndpointConnectionsClient getHorizonDbPrivateEndpointConnections(); + + /** + * Gets the HorizonDbPrivateLinkResourcesClient object to access its operations. + * + * @return the HorizonDbPrivateLinkResourcesClient object. + */ + HorizonDbPrivateLinkResourcesClient getHorizonDbPrivateLinkResources(); + + /** + * Gets the HorizonDbParameterGroupsClient object to access its operations. + * + * @return the HorizonDbParameterGroupsClient object. + */ + HorizonDbParameterGroupsClient getHorizonDbParameterGroups(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbParameterGroupsClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbParameterGroupsClient.java new file mode 100644 index 000000000000..a1a3ffccbdd0 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbParameterGroupsClient.java @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupForPatchUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbParameterGroupsClient. + */ +public interface HorizonDbParameterGroupsClient { + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String parameterGroupName); + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String parameterGroupName); + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String parameterGroupName, Context context); + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbParameterGroupInner getByResourceGroup(String resourceGroupName, String parameterGroupName); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String parameterGroupName, HorizonDbParameterGroupInner resource); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbParameterGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupInner resource); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbParameterGroupInner> + beginCreateOrUpdate(String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupInner resource); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbParameterGroupInner> beginCreateOrUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupInner resource, Context context); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbParameterGroupInner createOrUpdate(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource); + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbParameterGroupInner createOrUpdate(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource, Context context); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbParameterGroupInner> beginUpdateAsync( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupForPatchUpdate properties); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbParameterGroupInner> beginUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupForPatchUpdate properties); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbParameterGroupInner> beginUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupForPatchUpdate properties, + Context context); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbParameterGroupInner update(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties); + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbParameterGroupInner update(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties, Context context); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String parameterGroupName, + Context context); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String parameterGroupName, Context context); + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listConnectionsAsync(String resourceGroupName, + String parameterGroupName); + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConnections(String resourceGroupName, + String parameterGroupName); + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConnections(String resourceGroupName, + String parameterGroupName, Context context); + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listVersionsAsync(String resourceGroupName, String parameterGroupName, + Integer version); + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listVersionsAsync(String resourceGroupName, String parameterGroupName); + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String parameterGroupName); + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String parameterGroupName, + Integer version, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPoolsClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPoolsClient.java new file mode 100644 index 000000000000..3acfc1226037 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPoolsClient.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbPoolsClient. + */ +public interface HorizonDbPoolsClient { + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String poolName); + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String clusterName, String poolName); + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + Context context); + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbPoolInner get(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String clusterName); + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateEndpointConnectionsClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..ae550e57aace --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateEndpointConnectionsClient.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbPrivateEndpointConnectionsClient. + */ +public interface HorizonDbPrivateEndpointConnectionsClient { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String clusterName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String clusterName, + String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner get(String resourceGroupName, String clusterName, + String privateEndpointConnectionName); + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String clusterName); + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, + Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, + String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( + String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties, + Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties, Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, + String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointConnectionName, + Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateLinkResourcesClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateLinkResourcesClient.java new file mode 100644 index 000000000000..f6063b80ebbe --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateLinkResourcesClient.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbPrivateLinkResourcesClient. + */ +public interface HorizonDbPrivateLinkResourcesClient { + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String groupName); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String clusterName, String groupName); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, + String groupName, Context context); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbPrivateLinkResourceInner get(String resourceGroupName, String clusterName, String groupName); + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String clusterName); + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, + Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbReplicasClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbReplicasClient.java new file mode 100644 index 000000000000..167767ce8701 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbReplicasClient.java @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaForPatchUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbReplicasClient. + */ +public interface HorizonDbReplicasClient { + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName); + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String clusterName, String poolName, + String replicaName); + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName, Context context); + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbReplicaInner get(String resourceGroupName, String clusterName, String poolName, String replicaName); + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName, HorizonDbReplicaInner resource); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbReplicaInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaInner resource); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbReplicaInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaInner resource); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbReplicaInner> beginCreateOrUpdate(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaInner resource, Context context); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaInner resource); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbReplicaInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaInner resource); + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbReplicaInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaInner resource, Context context); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, HorizonDbReplicaInner> beginUpdateAsync(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbReplicaInner> beginUpdate(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HorizonDbReplicaInner> beginUpdate(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties, + Context context); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaForPatchUpdate properties); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbReplicaInner update(String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaForPatchUpdate properties); + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HorizonDbReplicaInner update(String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaForPatchUpdate properties, Context context); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, String poolName, + String replicaName); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String replicaName); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String replicaName, Context context); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String clusterName, String poolName, String replicaName); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 clusterName, String poolName, String replicaName); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String poolName, String replicaName, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/OperationsClient.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/OperationsClient.java new file mode 100644 index 000000000000..6f1187f9dbbf --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/OperationsClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbClusterInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbClusterInner.java new file mode 100644 index 000000000000..3a61755c76dd --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbClusterInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the HorizonDb cluster. + */ +@Fluent +public final class HorizonDbClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private HorizonDbClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HorizonDbClusterInner class. + */ + public HorizonDbClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HorizonDbClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HorizonDbClusterInner object itself. + */ + public HorizonDbClusterInner withProperties(HorizonDbClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public HorizonDbClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HorizonDbClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbClusterInner 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 HorizonDbClusterInner. + */ + public static HorizonDbClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbClusterInner deserializedHorizonDbClusterInner = new HorizonDbClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHorizonDbClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedHorizonDbClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHorizonDbClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbClusterInner.properties = HorizonDbClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHorizonDbClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbClusterInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbFirewallRuleInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbFirewallRuleInner.java new file mode 100644 index 000000000000..d4842c27f6ee --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbFirewallRuleInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; +import java.io.IOException; + +/** + * Represents the HorizonDb firewall rule. + */ +@Fluent +public final class HorizonDbFirewallRuleInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HorizonDbFirewallRuleProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HorizonDbFirewallRuleInner class. + */ + public HorizonDbFirewallRuleInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HorizonDbFirewallRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HorizonDbFirewallRuleInner object itself. + */ + public HorizonDbFirewallRuleInner withProperties(HorizonDbFirewallRuleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbFirewallRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbFirewallRuleInner 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 HorizonDbFirewallRuleInner. + */ + public static HorizonDbFirewallRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbFirewallRuleInner deserializedHorizonDbFirewallRuleInner = new HorizonDbFirewallRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbFirewallRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHorizonDbFirewallRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbFirewallRuleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbFirewallRuleInner.properties + = HorizonDbFirewallRuleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHorizonDbFirewallRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbFirewallRuleInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupConnectionPropertiesInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupConnectionPropertiesInner.java new file mode 100644 index 000000000000..9af1df964e07 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupConnectionPropertiesInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 java.io.IOException; + +/** + * Connection information for HorizonDb parameter group. + */ +@Immutable +public final class HorizonDbParameterGroupConnectionPropertiesInner + implements JsonSerializable { + /* + * The name of the connected resource. + */ + private String name; + + /* + * The resource ID of the connected resource. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of HorizonDbParameterGroupConnectionPropertiesInner class. + */ + private HorizonDbParameterGroupConnectionPropertiesInner() { + } + + /** + * Get the name property: The name of the connected resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The resource ID of the connected resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbParameterGroupConnectionPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupConnectionPropertiesInner 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 HorizonDbParameterGroupConnectionPropertiesInner. + */ + public static HorizonDbParameterGroupConnectionPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupConnectionPropertiesInner deserializedHorizonDbParameterGroupConnectionPropertiesInner + = new HorizonDbParameterGroupConnectionPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedHorizonDbParameterGroupConnectionPropertiesInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedHorizonDbParameterGroupConnectionPropertiesInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbParameterGroupConnectionPropertiesInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupConnectionPropertiesInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupInner.java new file mode 100644 index 000000000000..246d81b8c053 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupInner.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the HorizonDb parameter group. + */ +@Fluent +public final class HorizonDbParameterGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private HorizonDbParameterGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HorizonDbParameterGroupInner class. + */ + public HorizonDbParameterGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HorizonDbParameterGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HorizonDbParameterGroupInner object itself. + */ + public HorizonDbParameterGroupInner withProperties(HorizonDbParameterGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public HorizonDbParameterGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HorizonDbParameterGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbParameterGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupInner 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 HorizonDbParameterGroupInner. + */ + public static HorizonDbParameterGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupInner deserializedHorizonDbParameterGroupInner = new HorizonDbParameterGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbParameterGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHorizonDbParameterGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbParameterGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedHorizonDbParameterGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHorizonDbParameterGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbParameterGroupInner.properties + = HorizonDbParameterGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHorizonDbParameterGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPoolInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPoolInner.java new file mode 100644 index 000000000000..85df987d05ac --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPoolInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.HorizonDbPoolProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the HorizonDb pool. + */ +@Immutable +public final class HorizonDbPoolInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HorizonDbPoolProperties properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HorizonDbPoolInner class. + */ + private HorizonDbPoolInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HorizonDbPoolProperties properties() { + return this.properties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbPoolInner 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 HorizonDbPoolInner. + */ + public static HorizonDbPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbPoolInner deserializedHorizonDbPoolInner = new HorizonDbPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHorizonDbPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbPoolInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbPoolInner.properties = HorizonDbPoolProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHorizonDbPoolInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedHorizonDbPoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbPoolInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPrivateLinkResourceInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPrivateLinkResourceInner.java new file mode 100644 index 000000000000..3ca4eb2af693 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPrivateLinkResourceInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.PrivateLinkResourceProperties; +import java.io.IOException; + +/** + * Represents the HorizonDb private link resource. + */ +@Immutable +public final class HorizonDbPrivateLinkResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private PrivateLinkResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HorizonDbPrivateLinkResourceInner class. + */ + private HorizonDbPrivateLinkResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbPrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbPrivateLinkResourceInner 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 HorizonDbPrivateLinkResourceInner. + */ + public static HorizonDbPrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbPrivateLinkResourceInner deserializedHorizonDbPrivateLinkResourceInner + = new HorizonDbPrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHorizonDbPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbPrivateLinkResourceInner.properties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHorizonDbPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbReplicaInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbReplicaInner.java new file mode 100644 index 000000000000..1b9b8e31eecc --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbReplicaInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import java.io.IOException; + +/** + * Represents the HorizonDb replica. + */ +@Fluent +public final class HorizonDbReplicaInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HorizonDbReplicaProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HorizonDbReplicaInner class. + */ + public HorizonDbReplicaInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HorizonDbReplicaProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HorizonDbReplicaInner object itself. + */ + public HorizonDbReplicaInner withProperties(HorizonDbReplicaProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbReplicaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbReplicaInner 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 HorizonDbReplicaInner. + */ + public static HorizonDbReplicaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbReplicaInner deserializedHorizonDbReplicaInner = new HorizonDbReplicaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbReplicaInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHorizonDbReplicaInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHorizonDbReplicaInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbReplicaInner.properties = HorizonDbReplicaProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHorizonDbReplicaInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbReplicaInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/OperationInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/OperationInner.java new file mode 100644 index 000000000000..393946eec02b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.models.ActionType; +import com.azure.resourcemanager.horizondb.models.OperationDisplay; +import com.azure.resourcemanager.horizondb.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..81e2cc5a8f1a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProperties; +import java.io.IOException; + +/** + * The private endpoint connection resource. + */ +@Immutable +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * The private endpoint connection properties + */ + private PrivateEndpointConnectionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + private PrivateEndpointConnectionInner() { + } + + /** + * Get the properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.properties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionResourceInner.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionResourceInner.java new file mode 100644 index 000000000000..fd02ec5db0c7 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionResourceInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProperties; +import java.io.IOException; + +/** + * A private endpoint connection resource. + */ +@Immutable +public final class PrivateEndpointConnectionResourceInner extends ProxyResource { + /* + * The private endpoint connection properties + */ + private PrivateEndpointConnectionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionResourceInner class. + */ + private PrivateEndpointConnectionResourceInner() { + } + + /** + * Get the properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionResourceInner 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 PrivateEndpointConnectionResourceInner. + */ + public static PrivateEndpointConnectionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionResourceInner deserializedPrivateEndpointConnectionResourceInner + = new PrivateEndpointConnectionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.properties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionResourceInner; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/package-info.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/package-info.java new file mode 100644 index 000000000000..ddbd11d6f2fe --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for HorizonDb. + * Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. + */ +package com.azure.resourcemanager.horizondb.fluent.models; diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/package-info.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/package-info.java new file mode 100644 index 000000000000..3f33e53b6189 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for HorizonDb. + * Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. + */ +package com.azure.resourcemanager.horizondb.fluent; diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClusterImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClusterImpl.java new file mode 100644 index 000000000000..5a9b261c4120 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClusterImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbCluster; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterProperties; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate; +import java.util.Collections; +import java.util.Map; + +public final class HorizonDbClusterImpl + implements HorizonDbCluster, HorizonDbCluster.Definition, HorizonDbCluster.Update { + private HorizonDbClusterInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public HorizonDbClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HorizonDbClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private HorizonDbClusterForPatchUpdate updateProperties; + + public HorizonDbClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public HorizonDbCluster create() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public HorizonDbCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + HorizonDbClusterImpl(String name, com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = new HorizonDbClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public HorizonDbClusterImpl update() { + this.updateProperties = new HorizonDbClusterForPatchUpdate(); + return this; + } + + public HorizonDbCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbClusters() + .update(resourceGroupName, clusterName, updateProperties, Context.NONE); + return this; + } + + public HorizonDbCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbClusters() + .update(resourceGroupName, clusterName, updateProperties, context); + return this; + } + + HorizonDbClusterImpl(HorizonDbClusterInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public HorizonDbCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public HorizonDbCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public HorizonDbClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public HorizonDbClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public HorizonDbClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public HorizonDbClusterImpl withProperties(HorizonDbClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public HorizonDbClusterImpl withProperties(HorizonDbClusterPropertiesForPatchUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersClientImpl.java new file mode 100644 index 000000000000..ac1e25b6a9e4 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersClientImpl.java @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbClusterListResult; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterForPatchUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbClustersClient. + */ +public final class HorizonDbClustersClientImpl implements HorizonDbClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbClustersService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbClustersClientImpl(HorizonDbManagementClientImpl client) { + this.service + = RestProxy.create(HorizonDbClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbClusters to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbClusters") + public interface HorizonDbClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbClusterInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbClusterInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbClusterForPatchUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbClusterForPatchUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @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("clusterName") String clusterName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters") + @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.HorizonDb/clusters") + @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.HorizonDb/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HorizonDb/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + } + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, HorizonDbClusterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, resource, + Context.NONE); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, resource, context); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbClusterInner> + beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, HorizonDbClusterInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbClusterInner.class, HorizonDbClusterInner.class, + this.client.getContext()); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbClusterInner> + beginCreateOrUpdate(String resourceGroupName, String clusterName, HorizonDbClusterInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, resource); + return this.client.getLroResult(response, + HorizonDbClusterInner.class, HorizonDbClusterInner.class, Context.NONE); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, HorizonDbClusterInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, resource, context); + return this.client.getLroResult(response, + HorizonDbClusterInner.class, HorizonDbClusterInner.class, context); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbClusterInner createOrUpdate(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource) { + return beginCreateOrUpdate(resourceGroupName, clusterName, resource).getFinalResult(); + } + + /** + * Creates a new HorizonDb cluster or updates an existing cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbClusterInner createOrUpdate(String resourceGroupName, String clusterName, + HorizonDbClusterInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, clusterName, resource, context).getFinalResult(); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, properties, + Context.NONE); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, properties, context); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbClusterInner> + beginUpdateAsync(String resourceGroupName, String clusterName, HorizonDbClusterForPatchUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbClusterInner.class, HorizonDbClusterInner.class, + this.client.getContext()); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbClusterInner> beginUpdate(String resourceGroupName, + String clusterName, HorizonDbClusterForPatchUpdate properties) { + Response response = updateWithResponse(resourceGroupName, clusterName, properties); + return this.client.getLroResult(response, + HorizonDbClusterInner.class, HorizonDbClusterInner.class, Context.NONE); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbClusterInner> beginUpdate(String resourceGroupName, + String clusterName, HorizonDbClusterForPatchUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, clusterName, properties, context); + return this.client.getLroResult(response, + HorizonDbClusterInner.class, HorizonDbClusterInner.class, context); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties) { + return beginUpdateAsync(resourceGroupName, clusterName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbClusterInner update(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties) { + return beginUpdate(resourceGroupName, clusterName, properties).getFinalResult(); + } + + /** + * Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbClusterInner update(String resourceGroupName, String clusterName, + HorizonDbClusterForPatchUpdate properties, Context context) { + return beginUpdate(resourceGroupName, clusterName, properties, context).getFinalResult(); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, Context.NONE); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + Response response = deleteWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + beginDelete(resourceGroupName, clusterName).getFinalResult(); + } + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + beginDelete(resourceGroupName, clusterName, context).getFinalResult(); + } + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersImpl.java new file mode 100644 index 000000000000..5c8b4ac5a902 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbClustersClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbCluster; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusters; + +public final class HorizonDbClustersImpl implements HorizonDbClusters { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbClustersImpl.class); + + private final HorizonDbClustersClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbClustersImpl(HorizonDbClustersClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HorizonDbClusterImpl(inner.getValue(), this.manager())); + } + + public HorizonDbCluster getByResourceGroup(String resourceGroupName, String clusterName) { + HorizonDbClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new HorizonDbClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbClusterImpl(inner1, this.manager())); + } + + public HorizonDbCluster 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private HorizonDbClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + public HorizonDbClusterImpl define(String name) { + return new HorizonDbClusterImpl(name, this.manager()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRuleImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRuleImpl.java new file mode 100644 index 000000000000..b9ddc9e190d5 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRuleImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRule; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; + +public final class HorizonDbFirewallRuleImpl + implements HorizonDbFirewallRule, HorizonDbFirewallRule.Definition, HorizonDbFirewallRule.Update { + private HorizonDbFirewallRuleInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public HorizonDbFirewallRuleProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HorizonDbFirewallRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String poolName; + + private String firewallRuleName; + + public HorizonDbFirewallRuleImpl withExistingPool(String resourceGroupName, String clusterName, String poolName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.poolName = poolName; + return this; + } + + public HorizonDbFirewallRule create() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbFirewallRules() + .createOrUpdate(resourceGroupName, clusterName, poolName, firewallRuleName, this.innerModel(), + Context.NONE); + return this; + } + + public HorizonDbFirewallRule create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbFirewallRules() + .createOrUpdate(resourceGroupName, clusterName, poolName, firewallRuleName, this.innerModel(), context); + return this; + } + + HorizonDbFirewallRuleImpl(String name, com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = new HorizonDbFirewallRuleInner(); + this.serviceManager = serviceManager; + this.firewallRuleName = name; + } + + public HorizonDbFirewallRuleImpl update() { + return this; + } + + public HorizonDbFirewallRule apply() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbFirewallRules() + .createOrUpdate(resourceGroupName, clusterName, poolName, firewallRuleName, this.innerModel(), + Context.NONE); + return this; + } + + public HorizonDbFirewallRule apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbFirewallRules() + .createOrUpdate(resourceGroupName, clusterName, poolName, firewallRuleName, this.innerModel(), context); + return this; + } + + HorizonDbFirewallRuleImpl(HorizonDbFirewallRuleInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.poolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pools"); + this.firewallRuleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "firewallRules"); + } + + public HorizonDbFirewallRule refresh() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbFirewallRules() + .getWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, Context.NONE) + .getValue(); + return this; + } + + public HorizonDbFirewallRule refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbFirewallRules() + .getWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, context) + .getValue(); + return this; + } + + public HorizonDbFirewallRuleImpl withProperties(HorizonDbFirewallRuleProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesClientImpl.java new file mode 100644 index 000000000000..58d43fc68a57 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesClientImpl.java @@ -0,0 +1,809 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbFirewallRuleListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbFirewallRulesClient. + */ +public final class HorizonDbFirewallRulesClientImpl implements HorizonDbFirewallRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbFirewallRulesService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbFirewallRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbFirewallRulesClientImpl(HorizonDbManagementClientImpl client) { + this.service = RestProxy.create(HorizonDbFirewallRulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbFirewallRules to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbFirewallRules") + public interface HorizonDbFirewallRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("firewallRuleName") String firewallRuleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("firewallRuleName") String firewallRuleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("firewallRuleName") String firewallRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbFirewallRuleInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("firewallRuleName") String firewallRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbFirewallRuleInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}") + @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("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("firewallRuleName") String firewallRuleName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("firewallRuleName") String firewallRuleName, + 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); + } + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb firewall rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb firewall rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName) { + return getWithResponseAsync(resourceGroupName, clusterName, poolName, firewallRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, firewallRuleName, accept, context); + } + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbFirewallRuleInner get(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName) { + return getWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, Context.NONE).getValue(); + } + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName, String poolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, 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 HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String clusterName, + String poolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, poolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + String poolName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + String poolName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, + String poolName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, poolName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, poolName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, String poolName, String firewallRuleName, HorizonDbFirewallRuleInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName, HorizonDbFirewallRuleInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, contentType, + accept, resource, Context.NONE); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName, HorizonDbFirewallRuleInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, contentType, + accept, resource, context); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbFirewallRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + HorizonDbFirewallRuleInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, poolName, firewallRuleName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbFirewallRuleInner.class, HorizonDbFirewallRuleInner.class, + this.client.getContext()); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbFirewallRuleInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + HorizonDbFirewallRuleInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, resource); + return this.client.getLroResult(response, + HorizonDbFirewallRuleInner.class, HorizonDbFirewallRuleInner.class, Context.NONE); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbFirewallRuleInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + HorizonDbFirewallRuleInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, resource, context); + return this.client.getLroResult(response, + HorizonDbFirewallRuleInner.class, HorizonDbFirewallRuleInner.class, context); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName, HorizonDbFirewallRuleInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, poolName, firewallRuleName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbFirewallRuleInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, HorizonDbFirewallRuleInner resource) { + return beginCreateOrUpdate(resourceGroupName, clusterName, poolName, firewallRuleName, resource) + .getFinalResult(); + } + + /** + * Creates a new HorizonDb firewall rule or updates an existing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbFirewallRuleInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, HorizonDbFirewallRuleInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, clusterName, poolName, firewallRuleName, resource, context) + .getFinalResult(); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, Context.NONE); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, firewallRuleName, context); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, poolName, firewallRuleName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName) { + Response response = deleteWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono deleteAsync(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName) { + return beginDeleteAsync(resourceGroupName, clusterName, poolName, firewallRuleName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String poolName, String firewallRuleName) { + beginDelete(resourceGroupName, clusterName, poolName, firewallRuleName).getFinalResult(); + } + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 clusterName, String poolName, String firewallRuleName, + Context context) { + beginDelete(resourceGroupName, clusterName, poolName, firewallRuleName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesImpl.java new file mode 100644 index 000000000000..ec8935c28e4f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbFirewallRulesClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRule; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRules; + +public final class HorizonDbFirewallRulesImpl implements HorizonDbFirewallRules { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbFirewallRulesImpl.class); + + private final HorizonDbFirewallRulesClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbFirewallRulesImpl(HorizonDbFirewallRulesClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String clusterName, + String poolName, String firewallRuleName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HorizonDbFirewallRuleImpl(inner.getValue(), this.manager())); + } + + public HorizonDbFirewallRule get(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName) { + HorizonDbFirewallRuleInner inner + = this.serviceClient().get(resourceGroupName, clusterName, poolName, firewallRuleName); + if (inner != null) { + return new HorizonDbFirewallRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName, String poolName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, poolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbFirewallRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, poolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbFirewallRuleImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String poolName, String firewallRuleName) { + this.serviceClient().delete(resourceGroupName, clusterName, poolName, firewallRuleName); + } + + public void delete(String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, poolName, firewallRuleName, context); + } + + public HorizonDbFirewallRule 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, poolName, firewallRuleName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + this.delete(resourceGroupName, clusterName, poolName, firewallRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + this.delete(resourceGroupName, clusterName, poolName, firewallRuleName, context); + } + + private HorizonDbFirewallRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + public HorizonDbFirewallRuleImpl define(String name) { + return new HorizonDbFirewallRuleImpl(name, this.manager()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientBuilder.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientBuilder.java new file mode 100644 index 000000000000..8df7acd11928 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the HorizonDbManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { HorizonDbManagementClientImpl.class }) +public final class HorizonDbManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the HorizonDbManagementClientBuilder. + */ + public HorizonDbManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the HorizonDbManagementClientBuilder. + */ + public HorizonDbManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the HorizonDbManagementClientBuilder. + */ + public HorizonDbManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the HorizonDbManagementClientBuilder. + */ + public HorizonDbManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the HorizonDbManagementClientBuilder. + */ + public HorizonDbManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the HorizonDbManagementClientBuilder. + */ + public HorizonDbManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HorizonDbManagementClientImpl with the provided parameters. + * + * @return an instance of HorizonDbManagementClientImpl. + */ + public HorizonDbManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + HorizonDbManagementClientImpl client = new HorizonDbManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientImpl.java new file mode 100644 index 000000000000..f453a7657f8c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientImpl.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbManagementClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient; +import com.azure.resourcemanager.horizondb.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the HorizonDbManagementClientImpl type. + */ +@ServiceClient(builder = HorizonDbManagementClientBuilder.class) +public final class HorizonDbManagementClientImpl implements HorizonDbManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The HorizonDbClustersClient object to access its operations. + */ + private final HorizonDbClustersClient horizonDbClusters; + + /** + * Gets the HorizonDbClustersClient object to access its operations. + * + * @return the HorizonDbClustersClient object. + */ + public HorizonDbClustersClient getHorizonDbClusters() { + return this.horizonDbClusters; + } + + /** + * The HorizonDbPoolsClient object to access its operations. + */ + private final HorizonDbPoolsClient horizonDbPools; + + /** + * Gets the HorizonDbPoolsClient object to access its operations. + * + * @return the HorizonDbPoolsClient object. + */ + public HorizonDbPoolsClient getHorizonDbPools() { + return this.horizonDbPools; + } + + /** + * The HorizonDbReplicasClient object to access its operations. + */ + private final HorizonDbReplicasClient horizonDbReplicas; + + /** + * Gets the HorizonDbReplicasClient object to access its operations. + * + * @return the HorizonDbReplicasClient object. + */ + public HorizonDbReplicasClient getHorizonDbReplicas() { + return this.horizonDbReplicas; + } + + /** + * The HorizonDbFirewallRulesClient object to access its operations. + */ + private final HorizonDbFirewallRulesClient horizonDbFirewallRules; + + /** + * Gets the HorizonDbFirewallRulesClient object to access its operations. + * + * @return the HorizonDbFirewallRulesClient object. + */ + public HorizonDbFirewallRulesClient getHorizonDbFirewallRules() { + return this.horizonDbFirewallRules; + } + + /** + * The HorizonDbPrivateEndpointConnectionsClient object to access its operations. + */ + private final HorizonDbPrivateEndpointConnectionsClient horizonDbPrivateEndpointConnections; + + /** + * Gets the HorizonDbPrivateEndpointConnectionsClient object to access its operations. + * + * @return the HorizonDbPrivateEndpointConnectionsClient object. + */ + public HorizonDbPrivateEndpointConnectionsClient getHorizonDbPrivateEndpointConnections() { + return this.horizonDbPrivateEndpointConnections; + } + + /** + * The HorizonDbPrivateLinkResourcesClient object to access its operations. + */ + private final HorizonDbPrivateLinkResourcesClient horizonDbPrivateLinkResources; + + /** + * Gets the HorizonDbPrivateLinkResourcesClient object to access its operations. + * + * @return the HorizonDbPrivateLinkResourcesClient object. + */ + public HorizonDbPrivateLinkResourcesClient getHorizonDbPrivateLinkResources() { + return this.horizonDbPrivateLinkResources; + } + + /** + * The HorizonDbParameterGroupsClient object to access its operations. + */ + private final HorizonDbParameterGroupsClient horizonDbParameterGroups; + + /** + * Gets the HorizonDbParameterGroupsClient object to access its operations. + * + * @return the HorizonDbParameterGroupsClient object. + */ + public HorizonDbParameterGroupsClient getHorizonDbParameterGroups() { + return this.horizonDbParameterGroups; + } + + /** + * Initializes an instance of HorizonDbManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + HorizonDbManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-01-20-preview"; + this.operations = new OperationsClientImpl(this); + this.horizonDbClusters = new HorizonDbClustersClientImpl(this); + this.horizonDbPools = new HorizonDbPoolsClientImpl(this); + this.horizonDbReplicas = new HorizonDbReplicasClientImpl(this); + this.horizonDbFirewallRules = new HorizonDbFirewallRulesClientImpl(this); + this.horizonDbPrivateEndpointConnections = new HorizonDbPrivateEndpointConnectionsClientImpl(this); + this.horizonDbPrivateLinkResources = new HorizonDbPrivateLinkResourcesClientImpl(this); + this.horizonDbParameterGroups = new HorizonDbParameterGroupsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbManagementClientImpl.class); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupConnectionPropertiesImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupConnectionPropertiesImpl.java new file mode 100644 index 000000000000..8d7c1f847b25 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupConnectionPropertiesImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupConnectionProperties; + +public final class HorizonDbParameterGroupConnectionPropertiesImpl + implements HorizonDbParameterGroupConnectionProperties { + private HorizonDbParameterGroupConnectionPropertiesInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + HorizonDbParameterGroupConnectionPropertiesImpl(HorizonDbParameterGroupConnectionPropertiesInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public HorizonDbParameterGroupConnectionPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupImpl.java new file mode 100644 index 000000000000..b1b714448392 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate; +import java.util.Collections; +import java.util.Map; + +public final class HorizonDbParameterGroupImpl + implements HorizonDbParameterGroup, HorizonDbParameterGroup.Definition, HorizonDbParameterGroup.Update { + private HorizonDbParameterGroupInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public HorizonDbParameterGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HorizonDbParameterGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String parameterGroupName; + + private HorizonDbParameterGroupForPatchUpdate updateProperties; + + public HorizonDbParameterGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public HorizonDbParameterGroup create() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbParameterGroups() + .createOrUpdate(resourceGroupName, parameterGroupName, this.innerModel(), Context.NONE); + return this; + } + + public HorizonDbParameterGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbParameterGroups() + .createOrUpdate(resourceGroupName, parameterGroupName, this.innerModel(), context); + return this; + } + + HorizonDbParameterGroupImpl(String name, com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = new HorizonDbParameterGroupInner(); + this.serviceManager = serviceManager; + this.parameterGroupName = name; + } + + public HorizonDbParameterGroupImpl update() { + this.updateProperties = new HorizonDbParameterGroupForPatchUpdate(); + return this; + } + + public HorizonDbParameterGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbParameterGroups() + .update(resourceGroupName, parameterGroupName, updateProperties, Context.NONE); + return this; + } + + public HorizonDbParameterGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbParameterGroups() + .update(resourceGroupName, parameterGroupName, updateProperties, context); + return this; + } + + HorizonDbParameterGroupImpl(HorizonDbParameterGroupInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.parameterGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "parameterGroups"); + } + + public HorizonDbParameterGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbParameterGroups() + .getByResourceGroupWithResponse(resourceGroupName, parameterGroupName, Context.NONE) + .getValue(); + return this; + } + + public HorizonDbParameterGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbParameterGroups() + .getByResourceGroupWithResponse(resourceGroupName, parameterGroupName, context) + .getValue(); + return this; + } + + public HorizonDbParameterGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public HorizonDbParameterGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public HorizonDbParameterGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public HorizonDbParameterGroupImpl withProperties(HorizonDbParameterGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public HorizonDbParameterGroupImpl withProperties(HorizonDbParameterGroupPropertiesForPatchUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsClientImpl.java new file mode 100644 index 000000000000..696cdf0eac49 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsClientImpl.java @@ -0,0 +1,1582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbParameterGroupConnectionPropertiesListResult; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbParameterGroupListResult; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupForPatchUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbParameterGroupsClient. + */ +public final class HorizonDbParameterGroupsClientImpl implements HorizonDbParameterGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbParameterGroupsService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbParameterGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbParameterGroupsClientImpl(HorizonDbManagementClientImpl client) { + this.service = RestProxy.create(HorizonDbParameterGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbParameterGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbParameterGroups") + public interface HorizonDbParameterGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") HorizonDbParameterGroupInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") HorizonDbParameterGroupInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbParameterGroupForPatchUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbParameterGroupForPatchUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @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("parameterGroupName") String parameterGroupName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups") + @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.HorizonDb/parameterGroups") + @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.HorizonDb/parameterGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HorizonDb/parameterGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConnections( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listConnectionsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @QueryParam("version") Integer version, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVersionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("parameterGroupName") String parameterGroupName, @QueryParam("version") Integer version, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConnectionsNext( + @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 listConnectionsNextSync( + @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> listVersionsNext( + @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 listVersionsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb parameter group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String parameterGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb parameter group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, + String parameterGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, parameterGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String parameterGroupName, Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, accept, context); + } + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbParameterGroupInner getByResourceGroup(String resourceGroupName, String parameterGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, parameterGroupName, Context.NONE).getValue(); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String parameterGroupName, HorizonDbParameterGroupInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, contentType, accept, resource, + Context.NONE); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, contentType, accept, resource, + context); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbParameterGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, parameterGroupName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbParameterGroupInner.class, HorizonDbParameterGroupInner.class, + this.client.getContext()); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbParameterGroupInner> beginCreateOrUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, parameterGroupName, resource); + return this.client.getLroResult(response, + HorizonDbParameterGroupInner.class, HorizonDbParameterGroupInner.class, Context.NONE); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbParameterGroupInner> beginCreateOrUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, parameterGroupName, resource, context); + return this.client.getLroResult(response, + HorizonDbParameterGroupInner.class, HorizonDbParameterGroupInner.class, context); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, parameterGroupName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbParameterGroupInner createOrUpdate(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource) { + return beginCreateOrUpdate(resourceGroupName, parameterGroupName, resource).getFinalResult(); + } + + /** + * Creates a new HorizonDb parameter group or updates an existing parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbParameterGroupInner createOrUpdate(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, parameterGroupName, resource, context).getFinalResult(); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, contentType, accept, properties, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, contentType, accept, properties, + Context.NONE); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, contentType, accept, properties, + context); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbParameterGroupInner> beginUpdateAsync( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupForPatchUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, parameterGroupName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbParameterGroupInner.class, HorizonDbParameterGroupInner.class, + this.client.getContext()); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbParameterGroupInner> beginUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupForPatchUpdate properties) { + Response response = updateWithResponse(resourceGroupName, parameterGroupName, properties); + return this.client.getLroResult(response, + HorizonDbParameterGroupInner.class, HorizonDbParameterGroupInner.class, Context.NONE); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbParameterGroupInner> beginUpdate( + String resourceGroupName, String parameterGroupName, HorizonDbParameterGroupForPatchUpdate properties, + Context context) { + Response response = updateWithResponse(resourceGroupName, parameterGroupName, properties, context); + return this.client.getLroResult(response, + HorizonDbParameterGroupInner.class, HorizonDbParameterGroupInner.class, context); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties) { + return beginUpdateAsync(resourceGroupName, parameterGroupName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbParameterGroupInner update(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties) { + return beginUpdate(resourceGroupName, parameterGroupName, properties).getFinalResult(); + } + + /** + * Updates an existing HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb parameter group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbParameterGroupInner update(String resourceGroupName, String parameterGroupName, + HorizonDbParameterGroupForPatchUpdate properties, Context context) { + return beginUpdate(resourceGroupName, parameterGroupName, properties, context).getFinalResult(); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono>> deleteWithResponseAsync(String resourceGroupName, + String parameterGroupName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String parameterGroupName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, Context.NONE); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String parameterGroupName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, context); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String parameterGroupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, parameterGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String parameterGroupName) { + Response response = deleteWithResponse(resourceGroupName, parameterGroupName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String parameterGroupName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, parameterGroupName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono deleteAsync(String resourceGroupName, String parameterGroupName) { + return beginDeleteAsync(resourceGroupName, parameterGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 parameterGroupName) { + beginDelete(resourceGroupName, parameterGroupName).getFinalResult(); + } + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 parameterGroupName, Context context) { + beginDelete(resourceGroupName, parameterGroupName, context).getFinalResult(); + } + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all connections to a parameter group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listConnectionsSinglePageAsync(String resourceGroupName, String parameterGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listConnections(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, 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())); + } + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all connections to a parameter group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listConnectionsAsync(String resourceGroupName, + String parameterGroupName) { + return new PagedFlux<>(() -> listConnectionsSinglePageAsync(resourceGroupName, parameterGroupName), + nextLink -> listConnectionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all connections to a parameter group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listConnectionsSinglePage(String resourceGroupName, String parameterGroupName) { + final String accept = "application/json"; + Response res + = service.listConnectionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listConnectionsSinglePage(String resourceGroupName, String parameterGroupName, Context context) { + final String accept = "application/json"; + Response res + = service.listConnectionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all connections to a parameter group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConnections(String resourceGroupName, + String parameterGroupName) { + return new PagedIterable<>(() -> listConnectionsSinglePage(resourceGroupName, parameterGroupName), + nextLink -> listConnectionsNextSinglePage(nextLink)); + } + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConnections(String resourceGroupName, + String parameterGroupName, Context context) { + return new PagedIterable<>(() -> listConnectionsSinglePage(resourceGroupName, parameterGroupName, context), + nextLink -> listConnectionsNextSinglePage(nextLink, context)); + } + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync(String resourceGroupName, + String parameterGroupName, Integer version) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, version, 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 parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync(String resourceGroupName, + String parameterGroupName, Integer version) { + return new PagedFlux<>(() -> listVersionsSinglePageAsync(resourceGroupName, parameterGroupName, version), + nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync(String resourceGroupName, + String parameterGroupName) { + final Integer version = null; + return new PagedFlux<>(() -> listVersionsSinglePageAsync(resourceGroupName, parameterGroupName, version), + nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsSinglePage(String resourceGroupName, + String parameterGroupName, Integer version) { + final String accept = "application/json"; + Response res + = service.listVersionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, version, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsSinglePage(String resourceGroupName, + String parameterGroupName, Integer version, Context context) { + final String accept = "application/json"; + Response res + = service.listVersionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parameterGroupName, version, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, + String parameterGroupName) { + final Integer version = null; + return new PagedIterable<>(() -> listVersionsSinglePage(resourceGroupName, parameterGroupName, version), + nextLink -> listVersionsNextSinglePage(nextLink)); + } + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String parameterGroupName, + Integer version, Context context) { + return new PagedIterable<>( + () -> listVersionsSinglePage(resourceGroupName, parameterGroupName, version, context), + nextLink -> listVersionsNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 all connections to a parameter group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listConnectionsNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listConnectionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all connections to a parameter group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listConnectionsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listConnectionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all connections to a parameter group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listConnectionsNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listConnectionsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listVersionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listVersionsNextSync(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/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsImpl.java new file mode 100644 index 000000000000..d2842ae1b475 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsImpl.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.horizondb.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.horizondb.fluent.HorizonDbParameterGroupsClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupConnectionProperties; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroups; + +public final class HorizonDbParameterGroupsImpl implements HorizonDbParameterGroups { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbParameterGroupsImpl.class); + + private final HorizonDbParameterGroupsClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbParameterGroupsImpl(HorizonDbParameterGroupsClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String parameterGroupName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, parameterGroupName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HorizonDbParameterGroupImpl(inner.getValue(), this.manager())); + } + + public HorizonDbParameterGroup getByResourceGroup(String resourceGroupName, String parameterGroupName) { + HorizonDbParameterGroupInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, parameterGroupName); + if (inner != null) { + return new HorizonDbParameterGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String parameterGroupName) { + this.serviceClient().delete(resourceGroupName, parameterGroupName); + } + + public void delete(String resourceGroupName, String parameterGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, parameterGroupName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable listConnections(String resourceGroupName, + String parameterGroupName) { + PagedIterable inner + = this.serviceClient().listConnections(resourceGroupName, parameterGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HorizonDbParameterGroupConnectionPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable listConnections(String resourceGroupName, + String parameterGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listConnections(resourceGroupName, parameterGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HorizonDbParameterGroupConnectionPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable listVersions(String resourceGroupName, String parameterGroupName) { + PagedIterable inner + = this.serviceClient().listVersions(resourceGroupName, parameterGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable listVersions(String resourceGroupName, String parameterGroupName, + Integer version, Context context) { + PagedIterable inner + = this.serviceClient().listVersions(resourceGroupName, parameterGroupName, version, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbParameterGroupImpl(inner1, this.manager())); + } + + public HorizonDbParameterGroup 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 parameterGroupName = ResourceManagerUtils.getValueFromIdByName(id, "parameterGroups"); + if (parameterGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'parameterGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, parameterGroupName, 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 parameterGroupName = ResourceManagerUtils.getValueFromIdByName(id, "parameterGroups"); + if (parameterGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'parameterGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, parameterGroupName, 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 parameterGroupName = ResourceManagerUtils.getValueFromIdByName(id, "parameterGroups"); + if (parameterGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'parameterGroups'.", id))); + } + this.delete(resourceGroupName, parameterGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String parameterGroupName = ResourceManagerUtils.getValueFromIdByName(id, "parameterGroups"); + if (parameterGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'parameterGroups'.", id))); + } + this.delete(resourceGroupName, parameterGroupName, context); + } + + private HorizonDbParameterGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + public HorizonDbParameterGroupImpl define(String name) { + return new HorizonDbParameterGroupImpl(name, this.manager()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolImpl.java new file mode 100644 index 000000000000..214a79c62568 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolImpl.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.horizondb.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbPool; +import com.azure.resourcemanager.horizondb.models.HorizonDbPoolProperties; +import java.util.Collections; +import java.util.Map; + +public final class HorizonDbPoolImpl implements HorizonDbPool { + private HorizonDbPoolInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + HorizonDbPoolImpl(HorizonDbPoolInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager 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 HorizonDbPoolProperties properties() { + return this.innerModel().properties(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HorizonDbPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsClientImpl.java new file mode 100644 index 000000000000..1b5e402ac308 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsClientImpl.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbPoolsClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbPoolListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbPoolsClient. + */ +public final class HorizonDbPoolsClientImpl implements HorizonDbPoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbPoolsService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbPoolsClientImpl(HorizonDbManagementClientImpl client) { + this.service + = RestProxy.create(HorizonDbPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbPools") + public interface HorizonDbPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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); + } + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String poolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String clusterName, String poolName) { + return getWithResponseAsync(resourceGroupName, clusterName, poolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, accept, context); + } + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbPoolInner get(String resourceGroupName, String clusterName, String poolName) { + return getWithResponse(resourceGroupName, clusterName, poolName, Context.NONE).getValue(); + } + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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 HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsImpl.java new file mode 100644 index 000000000000..75becd5a260e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbPoolsClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbPool; +import com.azure.resourcemanager.horizondb.models.HorizonDbPools; + +public final class HorizonDbPoolsImpl implements HorizonDbPools { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbPoolsImpl.class); + + private final HorizonDbPoolsClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbPoolsImpl(HorizonDbPoolsClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, poolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HorizonDbPoolImpl(inner.getValue(), this.manager())); + } + + public HorizonDbPool get(String resourceGroupName, String clusterName, String poolName) { + HorizonDbPoolInner inner = this.serviceClient().get(resourceGroupName, clusterName, poolName); + if (inner != null) { + return new HorizonDbPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbPoolImpl(inner1, this.manager())); + } + + private HorizonDbPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..0ff28ff0bbb2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,777 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.horizondb.implementation.models.PrivateEndpointConnectionResourceListResult; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbPrivateEndpointConnectionsClient. + */ +public final class HorizonDbPrivateEndpointConnectionsClientImpl implements HorizonDbPrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbPrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbPrivateEndpointConnectionsClientImpl(HorizonDbManagementClientImpl client) { + this.service = RestProxy.create(HorizonDbPrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbPrivateEndpointConnections") + public interface HorizonDbPrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/privateEndpointConnections/{privateEndpointConnectionName}") + @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("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, 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); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String clusterName, String privateEndpointConnectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String clusterName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String clusterName, String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, privateEndpointConnectionName, accept, context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner get(String resourceGroupName, String clusterName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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 private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String clusterName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, + String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateEndpointConnectionName, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateEndpointConnectionName, contentType, accept, + properties, Context.NONE); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateEndpointConnectionName, contentType, accept, + properties, context); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( + String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, privateEndpointConnectionName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties) { + Response response + = updateWithResponse(resourceGroupName, privateEndpointConnectionName, properties); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties, + Context context) { + Response response + = updateWithResponse(resourceGroupName, privateEndpointConnectionName, properties, context); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, + String privateEndpointConnectionName, PrivateEndpointConnectionUpdate properties) { + return beginUpdateAsync(resourceGroupName, privateEndpointConnectionName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties) { + return beginUpdate(resourceGroupName, privateEndpointConnectionName, properties).getFinalResult(); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties, Context context) { + return beginUpdate(resourceGroupName, privateEndpointConnectionName, properties, context).getFinalResult(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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) + public Mono>> deleteWithResponseAsync(String resourceGroupName, + String privateEndpointConnectionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateEndpointConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateEndpointConnectionName, Context.NONE); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateEndpointConnectionName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateEndpointConnectionName, context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String privateEndpointConnectionName) { + Response response = deleteWithResponse(resourceGroupName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String privateEndpointConnectionName, Context context) { + Response response = deleteWithResponse(resourceGroupName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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) + public Mono deleteAsync(String resourceGroupName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 privateEndpointConnectionName) { + beginDelete(resourceGroupName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 privateEndpointConnectionName, Context context) { + beginDelete(resourceGroupName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..301aa61305ac --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateEndpointConnections; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnection; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; + +public final class HorizonDbPrivateEndpointConnectionsImpl implements HorizonDbPrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbPrivateEndpointConnectionsImpl.class); + + private final HorizonDbPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbPrivateEndpointConnectionsImpl(HorizonDbPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionResourceImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnectionResource get(String resourceGroupName, String clusterName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionResourceInner inner + = this.serviceClient().get(resourceGroupName, clusterName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionResourceImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties) { + PrivateEndpointConnectionInner inner + = this.serviceClient().update(resourceGroupName, privateEndpointConnectionName, properties); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties, Context context) { + PrivateEndpointConnectionInner inner + = this.serviceClient().update(resourceGroupName, privateEndpointConnectionName, properties, context); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, privateEndpointConnectionName, context); + } + + private HorizonDbPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourceImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourceImpl.java new file mode 100644 index 000000000000..5b45a5d835a5 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateLinkResource; +import com.azure.resourcemanager.horizondb.models.PrivateLinkResourceProperties; + +public final class HorizonDbPrivateLinkResourceImpl implements HorizonDbPrivateLinkResource { + private HorizonDbPrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + HorizonDbPrivateLinkResourceImpl(HorizonDbPrivateLinkResourceInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager 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 PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HorizonDbPrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..c72fb95877b4 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesClientImpl.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbPrivateLinkResourcesClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbPrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbPrivateLinkResourcesClient. + */ +public final class HorizonDbPrivateLinkResourcesClientImpl implements HorizonDbPrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbPrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbPrivateLinkResourcesClientImpl(HorizonDbManagementClientImpl client) { + this.service = RestProxy.create(HorizonDbPrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbPrivateLinkResources") + public interface HorizonDbPrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String clusterName, String groupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, groupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String clusterName, + String groupName) { + return getWithResponseAsync(resourceGroupName, clusterName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String groupName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, groupName, accept, context); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbPrivateLinkResourceInner get(String resourceGroupName, String clusterName, String groupName) { + return getWithResponse(resourceGroupName, clusterName, groupName, Context.NONE).getValue(); + } + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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 private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String clusterName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..82aa93ee9ed3 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbPrivateLinkResourcesClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateLinkResource; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateLinkResources; + +public final class HorizonDbPrivateLinkResourcesImpl implements HorizonDbPrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbPrivateLinkResourcesImpl.class); + + private final HorizonDbPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbPrivateLinkResourcesImpl(HorizonDbPrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String clusterName, + String groupName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, groupName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HorizonDbPrivateLinkResourceImpl(inner.getValue(), this.manager())); + } + + public HorizonDbPrivateLinkResource get(String resourceGroupName, String clusterName, String groupName) { + HorizonDbPrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, clusterName, groupName); + if (inner != null) { + return new HorizonDbPrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HorizonDbPrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HorizonDbPrivateLinkResourceImpl(inner1, this.manager())); + } + + private HorizonDbPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicaImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicaImpl.java new file mode 100644 index 000000000000..b9503a78e8b3 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicaImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate; + +public final class HorizonDbReplicaImpl + implements HorizonDbReplica, HorizonDbReplica.Definition, HorizonDbReplica.Update { + private HorizonDbReplicaInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public HorizonDbReplicaProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HorizonDbReplicaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String poolName; + + private String replicaName; + + private HorizonDbReplicaForPatchUpdate updateProperties; + + public HorizonDbReplicaImpl withExistingPool(String resourceGroupName, String clusterName, String poolName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.poolName = poolName; + return this; + } + + public HorizonDbReplica create() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbReplicas() + .createOrUpdate(resourceGroupName, clusterName, poolName, replicaName, this.innerModel(), Context.NONE); + return this; + } + + public HorizonDbReplica create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbReplicas() + .createOrUpdate(resourceGroupName, clusterName, poolName, replicaName, this.innerModel(), context); + return this; + } + + HorizonDbReplicaImpl(String name, com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = new HorizonDbReplicaInner(); + this.serviceManager = serviceManager; + this.replicaName = name; + } + + public HorizonDbReplicaImpl update() { + this.updateProperties = new HorizonDbReplicaForPatchUpdate(); + return this; + } + + public HorizonDbReplica apply() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbReplicas() + .update(resourceGroupName, clusterName, poolName, replicaName, updateProperties, Context.NONE); + return this; + } + + public HorizonDbReplica apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbReplicas() + .update(resourceGroupName, clusterName, poolName, replicaName, updateProperties, context); + return this; + } + + HorizonDbReplicaImpl(HorizonDbReplicaInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + this.poolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pools"); + this.replicaName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "replicas"); + } + + public HorizonDbReplica refresh() { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbReplicas() + .getWithResponse(resourceGroupName, clusterName, poolName, replicaName, Context.NONE) + .getValue(); + return this; + } + + public HorizonDbReplica refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHorizonDbReplicas() + .getWithResponse(resourceGroupName, clusterName, poolName, replicaName, context) + .getValue(); + return this; + } + + public HorizonDbReplicaImpl withProperties(HorizonDbReplicaProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public HorizonDbReplicaImpl withProperties(HorizonDbReplicaPropertiesForPatchUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasClientImpl.java new file mode 100644 index 000000000000..0941038915cd --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasClientImpl.java @@ -0,0 +1,1023 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbReplicaListResult; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaForPatchUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HorizonDbReplicasClient. + */ +public final class HorizonDbReplicasClientImpl implements HorizonDbReplicasClient { + /** + * The proxy service used to perform REST calls. + */ + private final HorizonDbReplicasService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of HorizonDbReplicasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HorizonDbReplicasClientImpl(HorizonDbManagementClientImpl client) { + this.service + = RestProxy.create(HorizonDbReplicasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientHorizonDbReplicas to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientHorizonDbReplicas") + public interface HorizonDbReplicasService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbReplicaInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbReplicaInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbReplicaForPatchUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HorizonDbReplicaForPatchUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @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("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("poolName") String poolName, @PathParam("replicaName") String replicaName, 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); + } + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb replica along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb replica on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String clusterName, String poolName, + String replicaName) { + return getWithResponseAsync(resourceGroupName, clusterName, poolName, replicaName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String poolName, String replicaName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, replicaName, accept, context); + } + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbReplicaInner get(String resourceGroupName, String clusterName, String poolName, + String replicaName) { + return getWithResponse(resourceGroupName, clusterName, poolName, replicaName, Context.NONE).getValue(); + } + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, + String poolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, 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 HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String clusterName, String poolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, poolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + String poolName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + String poolName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, poolName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String poolName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, poolName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, poolName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, contentType, + accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String poolName, String replicaName, HorizonDbReplicaInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, contentType, accept, + resource, Context.NONE); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String poolName, String replicaName, HorizonDbReplicaInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, contentType, accept, + resource, context); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbReplicaInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, poolName, replicaName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbReplicaInner.class, HorizonDbReplicaInner.class, + this.client.getContext()); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbReplicaInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, poolName, replicaName, resource); + return this.client.getLroResult(response, + HorizonDbReplicaInner.class, HorizonDbReplicaInner.class, Context.NONE); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbReplicaInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, poolName, replicaName, resource, context); + return this.client.getLroResult(response, + HorizonDbReplicaInner.class, HorizonDbReplicaInner.class, context); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName, HorizonDbReplicaInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, poolName, replicaName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbReplicaInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaInner resource) { + return beginCreateOrUpdate(resourceGroupName, clusterName, poolName, replicaName, resource).getFinalResult(); + } + + /** + * Creates a new HorizonDb replica or updates an existing replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbReplicaInner createOrUpdate(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, clusterName, poolName, replicaName, resource, context) + .getFinalResult(); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, contentType, + accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaForPatchUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, contentType, accept, + properties, Context.NONE); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaForPatchUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, contentType, accept, + properties, context); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, HorizonDbReplicaInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String poolName, String replicaName, + HorizonDbReplicaForPatchUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, clusterName, poolName, replicaName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HorizonDbReplicaInner.class, HorizonDbReplicaInner.class, + this.client.getContext()); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbReplicaInner> beginUpdate(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties) { + Response response + = updateWithResponse(resourceGroupName, clusterName, poolName, replicaName, properties); + return this.client.getLroResult(response, + HorizonDbReplicaInner.class, HorizonDbReplicaInner.class, Context.NONE); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HorizonDbReplicaInner> beginUpdate(String resourceGroupName, + String clusterName, String poolName, String replicaName, HorizonDbReplicaForPatchUpdate properties, + Context context) { + Response response + = updateWithResponse(resourceGroupName, clusterName, poolName, replicaName, properties, context); + return this.client.getLroResult(response, + HorizonDbReplicaInner.class, HorizonDbReplicaInner.class, context); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaForPatchUpdate properties) { + return beginUpdateAsync(resourceGroupName, clusterName, poolName, replicaName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbReplicaInner update(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaForPatchUpdate properties) { + return beginUpdate(resourceGroupName, clusterName, poolName, replicaName, properties).getFinalResult(); + } + + /** + * Updates an existing HorizonDb replica (e.g., role). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the HorizonDb replica. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HorizonDbReplicaInner update(String resourceGroupName, String clusterName, String poolName, + String replicaName, HorizonDbReplicaForPatchUpdate properties, Context context) { + return beginUpdate(resourceGroupName, clusterName, poolName, replicaName, properties, context).getFinalResult(); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, Context.NONE); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, poolName, replicaName, context); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String poolName, String replicaName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, clusterName, poolName, replicaName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String replicaName) { + Response response = deleteWithResponse(resourceGroupName, clusterName, poolName, replicaName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String poolName, + String replicaName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, clusterName, poolName, replicaName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono deleteAsync(String resourceGroupName, String clusterName, String poolName, String replicaName) { + return beginDeleteAsync(resourceGroupName, clusterName, poolName, replicaName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String poolName, String replicaName) { + beginDelete(resourceGroupName, clusterName, poolName, replicaName).getFinalResult(); + } + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 clusterName, String poolName, String replicaName, + Context context) { + beginDelete(resourceGroupName, clusterName, poolName, replicaName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasImpl.java new file mode 100644 index 000000000000..2a981612c3ce --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.HorizonDbReplicasClient; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicas; + +public final class HorizonDbReplicasImpl implements HorizonDbReplicas { + private static final ClientLogger LOGGER = new ClientLogger(HorizonDbReplicasImpl.class); + + private final HorizonDbReplicasClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public HorizonDbReplicasImpl(HorizonDbReplicasClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, clusterName, poolName, replicaName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HorizonDbReplicaImpl(inner.getValue(), this.manager())); + } + + public HorizonDbReplica get(String resourceGroupName, String clusterName, String poolName, String replicaName) { + HorizonDbReplicaInner inner = this.serviceClient().get(resourceGroupName, clusterName, poolName, replicaName); + if (inner != null) { + return new HorizonDbReplicaImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName, String poolName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, poolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbReplicaImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, poolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HorizonDbReplicaImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String poolName, String replicaName) { + this.serviceClient().delete(resourceGroupName, clusterName, poolName, replicaName); + } + + public void delete(String resourceGroupName, String clusterName, String poolName, String replicaName, + Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, poolName, replicaName, context); + } + + public HorizonDbReplica 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); + if (replicaName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, poolName, replicaName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); + if (replicaName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, poolName, replicaName, 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 clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); + if (replicaName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + } + this.delete(resourceGroupName, clusterName, poolName, replicaName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); + if (poolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); + } + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); + if (replicaName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + } + this.delete(resourceGroupName, clusterName, poolName, replicaName, context); + } + + private HorizonDbReplicasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } + + public HorizonDbReplicaImpl define(String name) { + return new HorizonDbReplicaImpl(name, this.manager()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationImpl.java new file mode 100644 index 000000000000..ce5613ec0606 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.resourcemanager.horizondb.fluent.models.OperationInner; +import com.azure.resourcemanager.horizondb.models.ActionType; +import com.azure.resourcemanager.horizondb.models.Operation; +import com.azure.resourcemanager.horizondb.models.OperationDisplay; +import com.azure.resourcemanager.horizondb.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsClientImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..7f623cd711b5 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.OperationsClient; +import com.azure.resourcemanager.horizondb.fluent.models.OperationInner; +import com.azure.resourcemanager.horizondb.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final HorizonDbManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HorizonDbManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HorizonDbManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HorizonDbManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.HorizonDb/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.HorizonDb/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsImpl.java new file mode 100644 index 000000000000..11bed1fdd2d0 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.OperationsClient; +import com.azure.resourcemanager.horizondb.fluent.models.OperationInner; +import com.azure.resourcemanager.horizondb.models.Operation; +import com.azure.resourcemanager.horizondb.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..9bce543f72b3 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnection; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProperties; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager 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 PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionResourceImpl.java new file mode 100644 index 000000000000..78e3abf0af86 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionResource; + +public final class PrivateEndpointConnectionResourceImpl implements PrivateEndpointConnectionResource { + private PrivateEndpointConnectionResourceInner innerObject; + + private final com.azure.resourcemanager.horizondb.HorizonDbManager serviceManager; + + PrivateEndpointConnectionResourceImpl(PrivateEndpointConnectionResourceInner innerObject, + com.azure.resourcemanager.horizondb.HorizonDbManager 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 PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.horizondb.HorizonDbManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/ResourceManagerUtils.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..ea7e31436804 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbClusterListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbClusterListResult.java new file mode 100644 index 000000000000..a4587d0b2cb7 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbClusterListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.HorizonDbClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbCluster list operation. + */ +@Immutable +public final class HorizonDbClusterListResult implements JsonSerializable { + /* + * The HorizonDbCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbClusterListResult class. + */ + private HorizonDbClusterListResult() { + } + + /** + * Get the value property: The HorizonDbCluster 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 HorizonDbClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbClusterListResult 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 HorizonDbClusterListResult. + */ + public static HorizonDbClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbClusterListResult deserializedHorizonDbClusterListResult = new HorizonDbClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HorizonDbClusterInner.fromJson(reader1)); + deserializedHorizonDbClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbClusterListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbFirewallRuleListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbFirewallRuleListResult.java new file mode 100644 index 000000000000..2be284751257 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbFirewallRuleListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.HorizonDbFirewallRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbFirewallRule list operation. + */ +@Immutable +public final class HorizonDbFirewallRuleListResult implements JsonSerializable { + /* + * The HorizonDbFirewallRule items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbFirewallRuleListResult class. + */ + private HorizonDbFirewallRuleListResult() { + } + + /** + * Get the value property: The HorizonDbFirewallRule 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 HorizonDbFirewallRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbFirewallRuleListResult 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 HorizonDbFirewallRuleListResult. + */ + public static HorizonDbFirewallRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbFirewallRuleListResult deserializedHorizonDbFirewallRuleListResult + = new HorizonDbFirewallRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HorizonDbFirewallRuleInner.fromJson(reader1)); + deserializedHorizonDbFirewallRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbFirewallRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbFirewallRuleListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupConnectionPropertiesListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupConnectionPropertiesListResult.java new file mode 100644 index 000000000000..e4f653392c66 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupConnectionPropertiesListResult.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbParameterGroupConnectionProperties list operation. + */ +@Immutable +public final class HorizonDbParameterGroupConnectionPropertiesListResult + implements JsonSerializable { + /* + * The HorizonDbParameterGroupConnectionProperties items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbParameterGroupConnectionPropertiesListResult class. + */ + private HorizonDbParameterGroupConnectionPropertiesListResult() { + } + + /** + * Get the value property: The HorizonDbParameterGroupConnectionProperties 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 HorizonDbParameterGroupConnectionPropertiesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupConnectionPropertiesListResult 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 HorizonDbParameterGroupConnectionPropertiesListResult. + */ + public static HorizonDbParameterGroupConnectionPropertiesListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupConnectionPropertiesListResult deserializedHorizonDbParameterGroupConnectionPropertiesListResult + = new HorizonDbParameterGroupConnectionPropertiesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> HorizonDbParameterGroupConnectionPropertiesInner.fromJson(reader1)); + deserializedHorizonDbParameterGroupConnectionPropertiesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbParameterGroupConnectionPropertiesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupConnectionPropertiesListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupListResult.java new file mode 100644 index 000000000000..de7d1e92c626 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.HorizonDbParameterGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbParameterGroup list operation. + */ +@Immutable +public final class HorizonDbParameterGroupListResult implements JsonSerializable { + /* + * The HorizonDbParameterGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbParameterGroupListResult class. + */ + private HorizonDbParameterGroupListResult() { + } + + /** + * Get the value property: The HorizonDbParameterGroup 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 HorizonDbParameterGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupListResult 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 HorizonDbParameterGroupListResult. + */ + public static HorizonDbParameterGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupListResult deserializedHorizonDbParameterGroupListResult + = new HorizonDbParameterGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HorizonDbParameterGroupInner.fromJson(reader1)); + deserializedHorizonDbParameterGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbParameterGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPoolListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPoolListResult.java new file mode 100644 index 000000000000..95ed0dd0e4f2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPoolListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.HorizonDbPoolInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbPool list operation. + */ +@Immutable +public final class HorizonDbPoolListResult implements JsonSerializable { + /* + * The HorizonDbPool items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbPoolListResult class. + */ + private HorizonDbPoolListResult() { + } + + /** + * Get the value property: The HorizonDbPool 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 HorizonDbPoolListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbPoolListResult 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 HorizonDbPoolListResult. + */ + public static HorizonDbPoolListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbPoolListResult deserializedHorizonDbPoolListResult = new HorizonDbPoolListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HorizonDbPoolInner.fromJson(reader1)); + deserializedHorizonDbPoolListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbPoolListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbPoolListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPrivateLinkResourceListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPrivateLinkResourceListResult.java new file mode 100644 index 000000000000..97bb7f3e37b9 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPrivateLinkResourceListResult.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.horizondb.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.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbPrivateLinkResource list operation. + */ +@Immutable +public final class HorizonDbPrivateLinkResourceListResult + implements JsonSerializable { + /* + * The HorizonDbPrivateLinkResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbPrivateLinkResourceListResult class. + */ + private HorizonDbPrivateLinkResourceListResult() { + } + + /** + * Get the value property: The HorizonDbPrivateLinkResource 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 HorizonDbPrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbPrivateLinkResourceListResult 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 HorizonDbPrivateLinkResourceListResult. + */ + public static HorizonDbPrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbPrivateLinkResourceListResult deserializedHorizonDbPrivateLinkResourceListResult + = new HorizonDbPrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HorizonDbPrivateLinkResourceInner.fromJson(reader1)); + deserializedHorizonDbPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbPrivateLinkResourceListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbReplicaListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbReplicaListResult.java new file mode 100644 index 000000000000..3c1314a8f084 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbReplicaListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.HorizonDbReplicaInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HorizonDbReplica list operation. + */ +@Immutable +public final class HorizonDbReplicaListResult implements JsonSerializable { + /* + * The HorizonDbReplica items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HorizonDbReplicaListResult class. + */ + private HorizonDbReplicaListResult() { + } + + /** + * Get the value property: The HorizonDbReplica 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 HorizonDbReplicaListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbReplicaListResult 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 HorizonDbReplicaListResult. + */ + public static HorizonDbReplicaListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbReplicaListResult deserializedHorizonDbReplicaListResult = new HorizonDbReplicaListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HorizonDbReplicaInner.fromJson(reader1)); + deserializedHorizonDbReplicaListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHorizonDbReplicaListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbReplicaListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/OperationListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..5aec7e10c865 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/PrivateEndpointConnectionResourceListResult.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/PrivateEndpointConnectionResourceListResult.java new file mode 100644 index 000000000000..944dc9db5caa --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/models/PrivateEndpointConnectionResourceListResult.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.horizondb.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.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PrivateEndpointConnectionResource list operation. + */ +@Immutable +public final class PrivateEndpointConnectionResourceListResult + implements JsonSerializable { + /* + * The PrivateEndpointConnectionResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionResourceListResult class. + */ + private PrivateEndpointConnectionResourceListResult() { + } + + /** + * Get the value property: The PrivateEndpointConnectionResource 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 PrivateEndpointConnectionResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionResourceListResult 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 PrivateEndpointConnectionResourceListResult. + */ + public static PrivateEndpointConnectionResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionResourceListResult deserializedPrivateEndpointConnectionResourceListResult + = new PrivateEndpointConnectionResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionResourceInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionResourceListResult; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/package-info.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/package-info.java new file mode 100644 index 000000000000..0ea7c31d8008 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for HorizonDb. + * Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. + */ +package com.azure.resourcemanager.horizondb.implementation; diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ActionType.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ActionType.java new file mode 100644 index 000000000000..e03f55b17e4f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModeCluster.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModeCluster.java new file mode 100644 index 000000000000..926d60973b2d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModeCluster.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode to create a new HorizonDb cluster. + */ +public final class CreateModeCluster extends ExpandableStringEnum { + /** + * Create a new cluster. + */ + public static final CreateModeCluster CREATE = fromString("Create"); + + /** + * Update an existing cluster. + */ + public static final CreateModeCluster UPDATE = fromString("Update"); + + /** + * Create cluster from point-in-time restore. + */ + public static final CreateModeCluster POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); + + /** + * Creates a new instance of CreateModeCluster value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CreateModeCluster() { + } + + /** + * Creates or finds a CreateModeCluster from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreateModeCluster. + */ + public static CreateModeCluster fromString(String name) { + return fromString(name, CreateModeCluster.class); + } + + /** + * Gets known CreateModeCluster values. + * + * @return known CreateModeCluster values. + */ + public static Collection values() { + return values(CreateModeCluster.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModePool.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModePool.java new file mode 100644 index 000000000000..bc827f6f1787 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/CreateModePool.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.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode to create a new HorizonDb cluster. + */ +public final class CreateModePool extends ExpandableStringEnum { + /** + * Create a new pool. + */ + public static final CreateModePool CREATE = fromString("Create"); + + /** + * Update an existing pool. + */ + public static final CreateModePool UPDATE = fromString("Update"); + + /** + * Creates a new instance of CreateModePool value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CreateModePool() { + } + + /** + * Creates or finds a CreateModePool from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreateModePool. + */ + public static CreateModePool fromString(String name) { + return fromString(name, CreateModePool.class); + } + + /** + * Gets known CreateModePool values. + * + * @return known CreateModePool values. + */ + public static Collection values() { + return values(CreateModePool.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbCluster.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbCluster.java new file mode 100644 index 000000000000..fe72d48244e2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbCluster.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of HorizonDbCluster. + */ +public interface HorizonDbCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HorizonDbClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner object. + * + * @return the inner object. + */ + HorizonDbClusterInner innerModel(); + + /** + * The entirety of the HorizonDbCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The HorizonDbCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HorizonDbCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the HorizonDbCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the HorizonDbCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the HorizonDbCluster definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + HorizonDbCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HorizonDbCluster create(Context context); + } + + /** + * The stage of the HorizonDbCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the HorizonDbCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(HorizonDbClusterProperties properties); + } + } + + /** + * Begins update for the HorizonDbCluster resource. + * + * @return the stage of resource update. + */ + HorizonDbCluster.Update update(); + + /** + * The template for HorizonDbCluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HorizonDbCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HorizonDbCluster apply(Context context); + } + + /** + * The HorizonDbCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the HorizonDbCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the HorizonDbCluster update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The properties that can be updated for a HorizonDb cluster.. + * + * @param properties The properties that can be updated for a HorizonDb cluster. + * @return the next definition stage. + */ + Update withProperties(HorizonDbClusterPropertiesForPatchUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HorizonDbCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HorizonDbCluster refresh(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterForPatchUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterForPatchUpdate.java new file mode 100644 index 000000000000..25385a6b0f51 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterForPatchUpdate.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.horizondb.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; + +/** + * HorizonDb cluster for update operations. + */ +@Fluent +public final class HorizonDbClusterForPatchUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The properties that can be updated for a HorizonDb cluster. + */ + private HorizonDbClusterPropertiesForPatchUpdate properties; + + /** + * Creates an instance of HorizonDbClusterForPatchUpdate class. + */ + public HorizonDbClusterForPatchUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the HorizonDbClusterForPatchUpdate object itself. + */ + public HorizonDbClusterForPatchUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties that can be updated for a HorizonDb cluster. + * + * @return the properties value. + */ + public HorizonDbClusterPropertiesForPatchUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: The properties that can be updated for a HorizonDb cluster. + * + * @param properties the properties value to set. + * @return the HorizonDbClusterForPatchUpdate object itself. + */ + public HorizonDbClusterForPatchUpdate withProperties(HorizonDbClusterPropertiesForPatchUpdate properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbClusterForPatchUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbClusterForPatchUpdate 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 HorizonDbClusterForPatchUpdate. + */ + public static HorizonDbClusterForPatchUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbClusterForPatchUpdate deserializedHorizonDbClusterForPatchUpdate + = new HorizonDbClusterForPatchUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHorizonDbClusterForPatchUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbClusterForPatchUpdate.properties + = HorizonDbClusterPropertiesForPatchUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbClusterForPatchUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterParameterGroupConnectionProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterParameterGroupConnectionProperties.java new file mode 100644 index 000000000000..ddf3310122e9 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterParameterGroupConnectionProperties.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Connection information for HorizonDb parameter group. + */ +@Fluent +public final class HorizonDbClusterParameterGroupConnectionProperties + implements JsonSerializable { + /* + * The resource ID of the connected parameter group. + */ + private String id; + + /* + * Indication of if parameter group is applied on HorizonDb resource. + */ + private String syncStatus; + + /* + * Indicates whether the parameters should be applied immediately. + */ + private Boolean applyImmediately; + + /** + * Creates an instance of HorizonDbClusterParameterGroupConnectionProperties class. + */ + public HorizonDbClusterParameterGroupConnectionProperties() { + } + + /** + * Get the id property: The resource ID of the connected parameter group. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID of the connected parameter group. + * + * @param id the id value to set. + * @return the HorizonDbClusterParameterGroupConnectionProperties object itself. + */ + public HorizonDbClusterParameterGroupConnectionProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the syncStatus property: Indication of if parameter group is applied on HorizonDb resource. + * + * @return the syncStatus value. + */ + public String syncStatus() { + return this.syncStatus; + } + + /** + * Get the applyImmediately property: Indicates whether the parameters should be applied immediately. + * + * @return the applyImmediately value. + */ + public Boolean applyImmediately() { + return this.applyImmediately; + } + + /** + * Set the applyImmediately property: Indicates whether the parameters should be applied immediately. + * + * @param applyImmediately the applyImmediately value to set. + * @return the HorizonDbClusterParameterGroupConnectionProperties object itself. + */ + public HorizonDbClusterParameterGroupConnectionProperties withApplyImmediately(Boolean applyImmediately) { + this.applyImmediately = applyImmediately; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeBooleanField("applyImmediately", this.applyImmediately); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbClusterParameterGroupConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbClusterParameterGroupConnectionProperties 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 HorizonDbClusterParameterGroupConnectionProperties. + */ + public static HorizonDbClusterParameterGroupConnectionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbClusterParameterGroupConnectionProperties deserializedHorizonDbClusterParameterGroupConnectionProperties + = new HorizonDbClusterParameterGroupConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHorizonDbClusterParameterGroupConnectionProperties.id = reader.getString(); + } else if ("syncStatus".equals(fieldName)) { + deserializedHorizonDbClusterParameterGroupConnectionProperties.syncStatus = reader.getString(); + } else if ("applyImmediately".equals(fieldName)) { + deserializedHorizonDbClusterParameterGroupConnectionProperties.applyImmediately + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbClusterParameterGroupConnectionProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterProperties.java new file mode 100644 index 000000000000..8734e7bf7bf4 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterProperties.java @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Properties of a HorizonDb cluster. + */ +@Fluent +public final class HorizonDbClusterProperties implements JsonSerializable { + /* + * The administrator login name. + */ + private String administratorLogin; + + /* + * The administrator login password. + */ + private String administratorLoginPassword; + + /* + * The version of the HorizonDb cluster. + */ + private String version; + + /* + * The mode to create a new HorizonDb cluster. + */ + private CreateModeCluster createMode; + + /* + * Restore point creation time specifying the time to restore from. + */ + private OffsetDateTime pointInTimeUTC; + + /* + * The source cluster resource ID for restore or replica creation. + */ + private String sourceClusterResourceId; + + /* + * The pool name for restore or replica operations. + */ + private String poolName; + + /* + * Number of replicas. + */ + private Integer replicaCount; + + /* + * Number of vCores. + */ + private Integer vCores; + + /* + * The processor type for the HorizonDb cluster. + */ + private String processorType; + + /* + * The network related info. + */ + private Network network; + + /* + * Current state of the cluster. + */ + private State state; + + /* + * The fully qualified domain name of the cluster. + */ + private String fullyQualifiedDomainName; + + /* + * The fully qualified domain name used for readonly endpoint for the cluster. + */ + private String readonlyEndpoint; + + /* + * The provisioning state of the cluster. + */ + private ProvisioningState provisioningState; + + /* + * Defines how replicas are placed across availability zones. + */ + private ZonePlacementPolicy zonePlacementPolicy; + + /* + * Defines connection to a parameter group. + */ + private HorizonDbClusterParameterGroupConnectionProperties parameterGroup; + + /** + * Creates an instance of HorizonDbClusterProperties class. + */ + public HorizonDbClusterProperties() { + } + + /** + * Get the administratorLogin property: The administrator login name. + * + * @return the administratorLogin value. + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set the administratorLogin property: The administrator login name. + * + * @param administratorLogin the administratorLogin value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get the administratorLoginPassword property: The administrator login password. + * + * @return the administratorLoginPassword value. + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the administratorLoginPassword property: The administrator login password. + * + * @param administratorLoginPassword the administratorLoginPassword value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get the version property: The version of the HorizonDb cluster. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the HorizonDb cluster. + * + * @param version the version value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the createMode property: The mode to create a new HorizonDb cluster. + * + * @return the createMode value. + */ + public CreateModeCluster createMode() { + return this.createMode; + } + + /** + * Set the createMode property: The mode to create a new HorizonDb cluster. + * + * @param createMode the createMode value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withCreateMode(CreateModeCluster createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the pointInTimeUTC property: Restore point creation time specifying the time to restore from. + * + * @return the pointInTimeUTC value. + */ + public OffsetDateTime pointInTimeUTC() { + return this.pointInTimeUTC; + } + + /** + * Set the pointInTimeUTC property: Restore point creation time specifying the time to restore from. + * + * @param pointInTimeUTC the pointInTimeUTC value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withPointInTimeUTC(OffsetDateTime pointInTimeUTC) { + this.pointInTimeUTC = pointInTimeUTC; + return this; + } + + /** + * Get the sourceClusterResourceId property: The source cluster resource ID for restore or replica creation. + * + * @return the sourceClusterResourceId value. + */ + public String sourceClusterResourceId() { + return this.sourceClusterResourceId; + } + + /** + * Set the sourceClusterResourceId property: The source cluster resource ID for restore or replica creation. + * + * @param sourceClusterResourceId the sourceClusterResourceId value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withSourceClusterResourceId(String sourceClusterResourceId) { + this.sourceClusterResourceId = sourceClusterResourceId; + return this; + } + + /** + * Get the poolName property: The pool name for restore or replica operations. + * + * @return the poolName value. + */ + public String poolName() { + return this.poolName; + } + + /** + * Set the poolName property: The pool name for restore or replica operations. + * + * @param poolName the poolName value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withPoolName(String poolName) { + this.poolName = poolName; + return this; + } + + /** + * Get the replicaCount property: Number of replicas. + * + * @return the replicaCount value. + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the replicaCount property: Number of replicas. + * + * @param replicaCount the replicaCount value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get the vCores property: Number of vCores. + * + * @return the vCores value. + */ + public Integer vCores() { + return this.vCores; + } + + /** + * Set the vCores property: Number of vCores. + * + * @param vCores the vCores value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withVCores(Integer vCores) { + this.vCores = vCores; + return this; + } + + /** + * Get the processorType property: The processor type for the HorizonDb cluster. + * + * @return the processorType value. + */ + public String processorType() { + return this.processorType; + } + + /** + * Set the processorType property: The processor type for the HorizonDb cluster. + * + * @param processorType the processorType value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withProcessorType(String processorType) { + this.processorType = processorType; + return this; + } + + /** + * Get the network property: The network related info. + * + * @return the network value. + */ + public Network network() { + return this.network; + } + + /** + * Set the network property: The network related info. + * + * @param network the network value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withNetwork(Network network) { + this.network = network; + return this; + } + + /** + * Get the state property: Current state of the cluster. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the fullyQualifiedDomainName property: The fully qualified domain name of the cluster. + * + * @return the fullyQualifiedDomainName value. + */ + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; + } + + /** + * Get the readonlyEndpoint property: The fully qualified domain name used for readonly endpoint for the cluster. + * + * @return the readonlyEndpoint value. + */ + public String readonlyEndpoint() { + return this.readonlyEndpoint; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the zonePlacementPolicy property: Defines how replicas are placed across availability zones. + * + * @return the zonePlacementPolicy value. + */ + public ZonePlacementPolicy zonePlacementPolicy() { + return this.zonePlacementPolicy; + } + + /** + * Set the zonePlacementPolicy property: Defines how replicas are placed across availability zones. + * + * @param zonePlacementPolicy the zonePlacementPolicy value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties withZonePlacementPolicy(ZonePlacementPolicy zonePlacementPolicy) { + this.zonePlacementPolicy = zonePlacementPolicy; + return this; + } + + /** + * Get the parameterGroup property: Defines connection to a parameter group. + * + * @return the parameterGroup value. + */ + public HorizonDbClusterParameterGroupConnectionProperties parameterGroup() { + return this.parameterGroup; + } + + /** + * Set the parameterGroup property: Defines connection to a parameter group. + * + * @param parameterGroup the parameterGroup value to set. + * @return the HorizonDbClusterProperties object itself. + */ + public HorizonDbClusterProperties + withParameterGroup(HorizonDbClusterParameterGroupConnectionProperties parameterGroup) { + this.parameterGroup = parameterGroup; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("administratorLogin", this.administratorLogin); + jsonWriter.writeStringField("administratorLoginPassword", this.administratorLoginPassword); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeStringField("pointInTimeUTC", + this.pointInTimeUTC == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTimeUTC)); + jsonWriter.writeStringField("sourceClusterResourceId", this.sourceClusterResourceId); + jsonWriter.writeStringField("poolName", this.poolName); + jsonWriter.writeNumberField("replicaCount", this.replicaCount); + jsonWriter.writeNumberField("vCores", this.vCores); + jsonWriter.writeStringField("processorType", this.processorType); + jsonWriter.writeJsonField("network", this.network); + jsonWriter.writeStringField("zonePlacementPolicy", + this.zonePlacementPolicy == null ? null : this.zonePlacementPolicy.toString()); + jsonWriter.writeJsonField("parameterGroup", this.parameterGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbClusterProperties 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 HorizonDbClusterProperties. + */ + public static HorizonDbClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbClusterProperties deserializedHorizonDbClusterProperties = new HorizonDbClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorLogin".equals(fieldName)) { + deserializedHorizonDbClusterProperties.administratorLogin = reader.getString(); + } else if ("administratorLoginPassword".equals(fieldName)) { + deserializedHorizonDbClusterProperties.administratorLoginPassword = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedHorizonDbClusterProperties.version = reader.getString(); + } else if ("createMode".equals(fieldName)) { + deserializedHorizonDbClusterProperties.createMode + = CreateModeCluster.fromString(reader.getString()); + } else if ("pointInTimeUTC".equals(fieldName)) { + deserializedHorizonDbClusterProperties.pointInTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sourceClusterResourceId".equals(fieldName)) { + deserializedHorizonDbClusterProperties.sourceClusterResourceId = reader.getString(); + } else if ("poolName".equals(fieldName)) { + deserializedHorizonDbClusterProperties.poolName = reader.getString(); + } else if ("replicaCount".equals(fieldName)) { + deserializedHorizonDbClusterProperties.replicaCount = reader.getNullable(JsonReader::getInt); + } else if ("vCores".equals(fieldName)) { + deserializedHorizonDbClusterProperties.vCores = reader.getNullable(JsonReader::getInt); + } else if ("processorType".equals(fieldName)) { + deserializedHorizonDbClusterProperties.processorType = reader.getString(); + } else if ("network".equals(fieldName)) { + deserializedHorizonDbClusterProperties.network = Network.fromJson(reader); + } else if ("state".equals(fieldName)) { + deserializedHorizonDbClusterProperties.state = State.fromString(reader.getString()); + } else if ("fullyQualifiedDomainName".equals(fieldName)) { + deserializedHorizonDbClusterProperties.fullyQualifiedDomainName = reader.getString(); + } else if ("readonlyEndpoint".equals(fieldName)) { + deserializedHorizonDbClusterProperties.readonlyEndpoint = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedHorizonDbClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("zonePlacementPolicy".equals(fieldName)) { + deserializedHorizonDbClusterProperties.zonePlacementPolicy + = ZonePlacementPolicy.fromString(reader.getString()); + } else if ("parameterGroup".equals(fieldName)) { + deserializedHorizonDbClusterProperties.parameterGroup + = HorizonDbClusterParameterGroupConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbClusterProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterPropertiesForPatchUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterPropertiesForPatchUpdate.java new file mode 100644 index 000000000000..853f0d661af4 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterPropertiesForPatchUpdate.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Properties of a HorizonDb cluster for update operations. + */ +@Fluent +public final class HorizonDbClusterPropertiesForPatchUpdate + implements JsonSerializable { + /* + * The administrator login password. + */ + private String administratorLoginPassword; + + /* + * Number of vCores. + */ + private Integer vCores; + + /* + * Defines connection to a parameter group. + */ + private HorizonDbClusterParameterGroupConnectionProperties parameterGroup; + + /** + * Creates an instance of HorizonDbClusterPropertiesForPatchUpdate class. + */ + public HorizonDbClusterPropertiesForPatchUpdate() { + } + + /** + * Get the administratorLoginPassword property: The administrator login password. + * + * @return the administratorLoginPassword value. + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the administratorLoginPassword property: The administrator login password. + * + * @param administratorLoginPassword the administratorLoginPassword value to set. + * @return the HorizonDbClusterPropertiesForPatchUpdate object itself. + */ + public HorizonDbClusterPropertiesForPatchUpdate withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get the vCores property: Number of vCores. + * + * @return the vCores value. + */ + public Integer vCores() { + return this.vCores; + } + + /** + * Set the vCores property: Number of vCores. + * + * @param vCores the vCores value to set. + * @return the HorizonDbClusterPropertiesForPatchUpdate object itself. + */ + public HorizonDbClusterPropertiesForPatchUpdate withVCores(Integer vCores) { + this.vCores = vCores; + return this; + } + + /** + * Get the parameterGroup property: Defines connection to a parameter group. + * + * @return the parameterGroup value. + */ + public HorizonDbClusterParameterGroupConnectionProperties parameterGroup() { + return this.parameterGroup; + } + + /** + * Set the parameterGroup property: Defines connection to a parameter group. + * + * @param parameterGroup the parameterGroup value to set. + * @return the HorizonDbClusterPropertiesForPatchUpdate object itself. + */ + public HorizonDbClusterPropertiesForPatchUpdate + withParameterGroup(HorizonDbClusterParameterGroupConnectionProperties parameterGroup) { + this.parameterGroup = parameterGroup; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("administratorLoginPassword", this.administratorLoginPassword); + jsonWriter.writeNumberField("vCores", this.vCores); + jsonWriter.writeJsonField("parameterGroup", this.parameterGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbClusterPropertiesForPatchUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbClusterPropertiesForPatchUpdate 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 HorizonDbClusterPropertiesForPatchUpdate. + */ + public static HorizonDbClusterPropertiesForPatchUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbClusterPropertiesForPatchUpdate deserializedHorizonDbClusterPropertiesForPatchUpdate + = new HorizonDbClusterPropertiesForPatchUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorLoginPassword".equals(fieldName)) { + deserializedHorizonDbClusterPropertiesForPatchUpdate.administratorLoginPassword + = reader.getString(); + } else if ("vCores".equals(fieldName)) { + deserializedHorizonDbClusterPropertiesForPatchUpdate.vCores + = reader.getNullable(JsonReader::getInt); + } else if ("parameterGroup".equals(fieldName)) { + deserializedHorizonDbClusterPropertiesForPatchUpdate.parameterGroup + = HorizonDbClusterParameterGroupConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbClusterPropertiesForPatchUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusters.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusters.java new file mode 100644 index 000000000000..36d1f15ceb88 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbClusters. + */ +public interface HorizonDbClusters { + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a HorizonDb cluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); + + /** + * Gets information about a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @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 information about a HorizonDb cluster. + */ + HorizonDbCluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Deletes a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all HorizonDb clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all HorizonDb clusters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets information about a HorizonDb cluster. + * + * @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 information about a HorizonDb cluster along with {@link Response}. + */ + HorizonDbCluster getById(String id); + + /** + * Gets information about a HorizonDb cluster. + * + * @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 information about a HorizonDb cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a HorizonDb cluster. + * + * @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 HorizonDb cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HorizonDbCluster resource. + * + * @param name resource name. + * @return the first stage of the new HorizonDbCluster definition. + */ + HorizonDbCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRule.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRule.java new file mode 100644 index 000000000000..3775fb052e18 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRule.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner; + +/** + * An immutable client-side representation of HorizonDbFirewallRule. + */ +public interface HorizonDbFirewallRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HorizonDbFirewallRuleProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner object. + * + * @return the inner object. + */ + HorizonDbFirewallRuleInner innerModel(); + + /** + * The entirety of the HorizonDbFirewallRule definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The HorizonDbFirewallRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HorizonDbFirewallRule definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the HorizonDbFirewallRule definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, poolName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @return the next definition stage. + */ + WithCreate withExistingPool(String resourceGroupName, String clusterName, String poolName); + } + + /** + * The stage of the HorizonDbFirewallRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + HorizonDbFirewallRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HorizonDbFirewallRule create(Context context); + } + + /** + * The stage of the HorizonDbFirewallRule definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(HorizonDbFirewallRuleProperties properties); + } + } + + /** + * Begins update for the HorizonDbFirewallRule resource. + * + * @return the stage of resource update. + */ + HorizonDbFirewallRule.Update update(); + + /** + * The template for HorizonDbFirewallRule update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HorizonDbFirewallRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HorizonDbFirewallRule apply(Context context); + } + + /** + * The HorizonDbFirewallRule update stages. + */ + interface UpdateStages { + /** + * The stage of the HorizonDbFirewallRule update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(HorizonDbFirewallRuleProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HorizonDbFirewallRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HorizonDbFirewallRule refresh(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRuleProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRuleProperties.java new file mode 100644 index 000000000000..f03e27357670 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRuleProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Properties of a HorizonDb firewall rule. + */ +@Fluent +public final class HorizonDbFirewallRuleProperties implements JsonSerializable { + /* + * The start IP address of the firewall rule (IPv4). + */ + private String startIpAddress; + + /* + * The end IP address of the firewall rule (IPv4). + */ + private String endIpAddress; + + /* + * The description of the HorizonDb firewall rule. + */ + private String description; + + /* + * The provisioning state of the firewall rule. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HorizonDbFirewallRuleProperties class. + */ + public HorizonDbFirewallRuleProperties() { + } + + /** + * Get the startIpAddress property: The start IP address of the firewall rule (IPv4). + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address of the firewall rule (IPv4). + * + * @param startIpAddress the startIpAddress value to set. + * @return the HorizonDbFirewallRuleProperties object itself. + */ + public HorizonDbFirewallRuleProperties withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address of the firewall rule (IPv4). + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address of the firewall rule (IPv4). + * + * @param endIpAddress the endIpAddress value to set. + * @return the HorizonDbFirewallRuleProperties object itself. + */ + public HorizonDbFirewallRuleProperties withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Get the description property: The description of the HorizonDb firewall rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the HorizonDb firewall rule. + * + * @param description the description value to set. + * @return the HorizonDbFirewallRuleProperties object itself. + */ + public HorizonDbFirewallRuleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the firewall rule. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startIpAddress", this.startIpAddress); + jsonWriter.writeStringField("endIpAddress", this.endIpAddress); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbFirewallRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbFirewallRuleProperties 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 HorizonDbFirewallRuleProperties. + */ + public static HorizonDbFirewallRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbFirewallRuleProperties deserializedHorizonDbFirewallRuleProperties + = new HorizonDbFirewallRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startIpAddress".equals(fieldName)) { + deserializedHorizonDbFirewallRuleProperties.startIpAddress = reader.getString(); + } else if ("endIpAddress".equals(fieldName)) { + deserializedHorizonDbFirewallRuleProperties.endIpAddress = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedHorizonDbFirewallRuleProperties.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedHorizonDbFirewallRuleProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbFirewallRuleProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRules.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRules.java new file mode 100644 index 000000000000..829a70715794 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRules.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbFirewallRules. + */ +public interface HorizonDbFirewallRules { + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + String firewallRuleName, Context context); + + /** + * Gets information about a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 information about a HorizonDb firewall rule. + */ + HorizonDbFirewallRule get(String resourceGroupName, String clusterName, String poolName, String firewallRuleName); + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb firewall rules in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbFirewallRule list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @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 clusterName, String poolName, String firewallRuleName); + + /** + * Deletes a HorizonDb firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param firewallRuleName The name of the HorizonDb firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String poolName, String firewallRuleName, + Context context); + + /** + * Gets information about a HorizonDb firewall rule. + * + * @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 information about a HorizonDb firewall rule along with {@link Response}. + */ + HorizonDbFirewallRule getById(String id); + + /** + * Gets information about a HorizonDb firewall rule. + * + * @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 information about a HorizonDb firewall rule along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a HorizonDb firewall rule. + * + * @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 HorizonDb firewall rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HorizonDbFirewallRule resource. + * + * @param name resource name. + * @return the first stage of the new HorizonDbFirewallRule definition. + */ + HorizonDbFirewallRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroup.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroup.java new file mode 100644 index 000000000000..577ec84040fc --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroup.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of HorizonDbParameterGroup. + */ +public interface HorizonDbParameterGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HorizonDbParameterGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner object. + * + * @return the inner object. + */ + HorizonDbParameterGroupInner innerModel(); + + /** + * The entirety of the HorizonDbParameterGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The HorizonDbParameterGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HorizonDbParameterGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the HorizonDbParameterGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the HorizonDbParameterGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the HorizonDbParameterGroup definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + HorizonDbParameterGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HorizonDbParameterGroup create(Context context); + } + + /** + * The stage of the HorizonDbParameterGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the HorizonDbParameterGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(HorizonDbParameterGroupProperties properties); + } + } + + /** + * Begins update for the HorizonDbParameterGroup resource. + * + * @return the stage of resource update. + */ + HorizonDbParameterGroup.Update update(); + + /** + * The template for HorizonDbParameterGroup update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HorizonDbParameterGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HorizonDbParameterGroup apply(Context context); + } + + /** + * The HorizonDbParameterGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the HorizonDbParameterGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the HorizonDbParameterGroup update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The properties that can be updated for a HorizonDb parameter group.. + * + * @param properties The properties that can be updated for a HorizonDb parameter group. + * @return the next definition stage. + */ + Update withProperties(HorizonDbParameterGroupPropertiesForPatchUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HorizonDbParameterGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HorizonDbParameterGroup refresh(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupConnectionProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupConnectionProperties.java new file mode 100644 index 000000000000..4f5f20f6392a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupConnectionProperties.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; + +/** + * An immutable client-side representation of HorizonDbParameterGroupConnectionProperties. + */ +public interface HorizonDbParameterGroupConnectionProperties { + /** + * Gets the name property: The name of the connected resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The resource ID of the connected resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner + * object. + * + * @return the inner object. + */ + HorizonDbParameterGroupConnectionPropertiesInner innerModel(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupForPatchUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupForPatchUpdate.java new file mode 100644 index 000000000000..bf963e6ba0d6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupForPatchUpdate.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * HorizonDb parameter group for update operations. + */ +@Fluent +public final class HorizonDbParameterGroupForPatchUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The properties that can be updated for a HorizonDb parameter group. + */ + private HorizonDbParameterGroupPropertiesForPatchUpdate properties; + + /** + * Creates an instance of HorizonDbParameterGroupForPatchUpdate class. + */ + public HorizonDbParameterGroupForPatchUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the HorizonDbParameterGroupForPatchUpdate object itself. + */ + public HorizonDbParameterGroupForPatchUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties that can be updated for a HorizonDb parameter group. + * + * @return the properties value. + */ + public HorizonDbParameterGroupPropertiesForPatchUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: The properties that can be updated for a HorizonDb parameter group. + * + * @param properties the properties value to set. + * @return the HorizonDbParameterGroupForPatchUpdate object itself. + */ + public HorizonDbParameterGroupForPatchUpdate + withProperties(HorizonDbParameterGroupPropertiesForPatchUpdate properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbParameterGroupForPatchUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupForPatchUpdate 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 HorizonDbParameterGroupForPatchUpdate. + */ + public static HorizonDbParameterGroupForPatchUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupForPatchUpdate deserializedHorizonDbParameterGroupForPatchUpdate + = new HorizonDbParameterGroupForPatchUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHorizonDbParameterGroupForPatchUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedHorizonDbParameterGroupForPatchUpdate.properties + = HorizonDbParameterGroupPropertiesForPatchUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupForPatchUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupProperties.java new file mode 100644 index 000000000000..5c0159ecd943 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupProperties.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a HorizonDb parameter group. + */ +@Fluent +public final class HorizonDbParameterGroupProperties implements JsonSerializable { + /* + * Parameters in the parameter group. + */ + private List parameters; + + /* + * Description of the parameter group. + */ + private String description; + + /* + * PostgreSQL version for the parameter group. + */ + private Integer pgVersion; + + /* + * Current version of the parameter group. + */ + private Integer version; + + /* + * Indicates whether the parameters should be applied immediately. + */ + private Boolean applyImmediately; + + /* + * The provisioning state of the parameter group. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HorizonDbParameterGroupProperties class. + */ + public HorizonDbParameterGroupProperties() { + } + + /** + * Get the parameters property: Parameters in the parameter group. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters in the parameter group. + * + * @param parameters the parameters value to set. + * @return the HorizonDbParameterGroupProperties object itself. + */ + public HorizonDbParameterGroupProperties withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the description property: Description of the parameter group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the parameter group. + * + * @param description the description value to set. + * @return the HorizonDbParameterGroupProperties object itself. + */ + public HorizonDbParameterGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the pgVersion property: PostgreSQL version for the parameter group. + * + * @return the pgVersion value. + */ + public Integer pgVersion() { + return this.pgVersion; + } + + /** + * Set the pgVersion property: PostgreSQL version for the parameter group. + * + * @param pgVersion the pgVersion value to set. + * @return the HorizonDbParameterGroupProperties object itself. + */ + public HorizonDbParameterGroupProperties withPgVersion(Integer pgVersion) { + this.pgVersion = pgVersion; + return this; + } + + /** + * Get the version property: Current version of the parameter group. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Get the applyImmediately property: Indicates whether the parameters should be applied immediately. + * + * @return the applyImmediately value. + */ + public Boolean applyImmediately() { + return this.applyImmediately; + } + + /** + * Set the applyImmediately property: Indicates whether the parameters should be applied immediately. + * + * @param applyImmediately the applyImmediately value to set. + * @return the HorizonDbParameterGroupProperties object itself. + */ + public HorizonDbParameterGroupProperties withApplyImmediately(Boolean applyImmediately) { + this.applyImmediately = applyImmediately; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the parameter group. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeNumberField("pgVersion", this.pgVersion); + jsonWriter.writeBooleanField("applyImmediately", this.applyImmediately); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbParameterGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupProperties 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 HorizonDbParameterGroupProperties. + */ + public static HorizonDbParameterGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupProperties deserializedHorizonDbParameterGroupProperties + = new HorizonDbParameterGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> ParameterProperties.fromJson(reader1)); + deserializedHorizonDbParameterGroupProperties.parameters = parameters; + } else if ("description".equals(fieldName)) { + deserializedHorizonDbParameterGroupProperties.description = reader.getString(); + } else if ("pgVersion".equals(fieldName)) { + deserializedHorizonDbParameterGroupProperties.pgVersion = reader.getNullable(JsonReader::getInt); + } else if ("version".equals(fieldName)) { + deserializedHorizonDbParameterGroupProperties.version = reader.getNullable(JsonReader::getInt); + } else if ("applyImmediately".equals(fieldName)) { + deserializedHorizonDbParameterGroupProperties.applyImmediately + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedHorizonDbParameterGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupPropertiesForPatchUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupPropertiesForPatchUpdate.java new file mode 100644 index 000000000000..b73ce7d80f1b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupPropertiesForPatchUpdate.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a HorizonDb parameter group for update operations. + */ +@Fluent +public final class HorizonDbParameterGroupPropertiesForPatchUpdate + implements JsonSerializable { + /* + * Parameters in the parameter group. + */ + private List parameters; + + /* + * Description of the parameter group. + */ + private String description; + + /* + * Indicates whether the parameters should be applied immediately. + */ + private Boolean applyImmediately; + + /** + * Creates an instance of HorizonDbParameterGroupPropertiesForPatchUpdate class. + */ + public HorizonDbParameterGroupPropertiesForPatchUpdate() { + } + + /** + * Get the parameters property: Parameters in the parameter group. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters in the parameter group. + * + * @param parameters the parameters value to set. + * @return the HorizonDbParameterGroupPropertiesForPatchUpdate object itself. + */ + public HorizonDbParameterGroupPropertiesForPatchUpdate withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the description property: Description of the parameter group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the parameter group. + * + * @param description the description value to set. + * @return the HorizonDbParameterGroupPropertiesForPatchUpdate object itself. + */ + public HorizonDbParameterGroupPropertiesForPatchUpdate withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the applyImmediately property: Indicates whether the parameters should be applied immediately. + * + * @return the applyImmediately value. + */ + public Boolean applyImmediately() { + return this.applyImmediately; + } + + /** + * Set the applyImmediately property: Indicates whether the parameters should be applied immediately. + * + * @param applyImmediately the applyImmediately value to set. + * @return the HorizonDbParameterGroupPropertiesForPatchUpdate object itself. + */ + public HorizonDbParameterGroupPropertiesForPatchUpdate withApplyImmediately(Boolean applyImmediately) { + this.applyImmediately = applyImmediately; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("applyImmediately", this.applyImmediately); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbParameterGroupPropertiesForPatchUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbParameterGroupPropertiesForPatchUpdate 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 HorizonDbParameterGroupPropertiesForPatchUpdate. + */ + public static HorizonDbParameterGroupPropertiesForPatchUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbParameterGroupPropertiesForPatchUpdate deserializedHorizonDbParameterGroupPropertiesForPatchUpdate + = new HorizonDbParameterGroupPropertiesForPatchUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> ParameterProperties.fromJson(reader1)); + deserializedHorizonDbParameterGroupPropertiesForPatchUpdate.parameters = parameters; + } else if ("description".equals(fieldName)) { + deserializedHorizonDbParameterGroupPropertiesForPatchUpdate.description = reader.getString(); + } else if ("applyImmediately".equals(fieldName)) { + deserializedHorizonDbParameterGroupPropertiesForPatchUpdate.applyImmediately + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbParameterGroupPropertiesForPatchUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroups.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroups.java new file mode 100644 index 000000000000..0081f3a423d9 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroups.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbParameterGroups. + */ +public interface HorizonDbParameterGroups { + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String parameterGroupName, Context context); + + /** + * Gets information about a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 information about a HorizonDb parameter group. + */ + HorizonDbParameterGroup getByResourceGroup(String resourceGroupName, String parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String parameterGroupName); + + /** + * Deletes a HorizonDb parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String parameterGroupName, Context context); + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all HorizonDb parameter groups in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all HorizonDb parameter groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group as paginated response with {@link PagedIterable}. + */ + PagedIterable listConnections(String resourceGroupName, + String parameterGroupName); + + /** + * Gets all connections to a parameter group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @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 all connections to a parameter group as paginated response with {@link PagedIterable}. + */ + PagedIterable listConnections(String resourceGroupName, + String parameterGroupName, Context context); + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listVersions(String resourceGroupName, String parameterGroupName); + + /** + * Lists parameter groups filtered by version number. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameterGroupName The name of the HorizonDb parameter group. + * @param version The version number to filter by. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listVersions(String resourceGroupName, String parameterGroupName, + Integer version, Context context); + + /** + * Gets information about a HorizonDb parameter group. + * + * @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 information about a HorizonDb parameter group along with {@link Response}. + */ + HorizonDbParameterGroup getById(String id); + + /** + * Gets information about a HorizonDb parameter group. + * + * @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 information about a HorizonDb parameter group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a HorizonDb parameter group. + * + * @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 HorizonDb parameter group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HorizonDbParameterGroup resource. + * + * @param name resource name. + * @return the first stage of the new HorizonDbParameterGroup definition. + */ + HorizonDbParameterGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPool.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPool.java new file mode 100644 index 000000000000..5df7b2ff9e50 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPool.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner; +import java.util.Map; + +/** + * An immutable client-side representation of HorizonDbPool. + */ +public interface HorizonDbPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HorizonDbPoolProperties properties(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner object. + * + * @return the inner object. + */ + HorizonDbPoolInner innerModel(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPoolProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPoolProperties.java new file mode 100644 index 000000000000..68ba89755a93 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPoolProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Properties of a HorizonDb pool. + */ +@Immutable +public final class HorizonDbPoolProperties implements JsonSerializable { + /* + * The location of the HorizonDb pool. + */ + private String location; + + /* + * Current state of the pool. + */ + private State state; + + /* + * Number of replicas in the pool. + */ + private Integer replicaCount; + + /* + * The version of the HorizonDb pool. + */ + private String version; + + /* + * The create mode for the pool. + */ + private CreateModePool createMode; + + /* + * The provisioning state of the pool. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HorizonDbPoolProperties class. + */ + private HorizonDbPoolProperties() { + } + + /** + * Get the location property: The location of the HorizonDb pool. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the state property: Current state of the pool. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the replicaCount property: Number of replicas in the pool. + * + * @return the replicaCount value. + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Get the version property: The version of the HorizonDb pool. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the createMode property: The create mode for the pool. + * + * @return the createMode value. + */ + public CreateModePool createMode() { + return this.createMode; + } + + /** + * Get the provisioningState property: The provisioning state of the pool. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbPoolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbPoolProperties 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 HorizonDbPoolProperties. + */ + public static HorizonDbPoolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbPoolProperties deserializedHorizonDbPoolProperties = new HorizonDbPoolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedHorizonDbPoolProperties.location = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedHorizonDbPoolProperties.state = State.fromString(reader.getString()); + } else if ("replicaCount".equals(fieldName)) { + deserializedHorizonDbPoolProperties.replicaCount = reader.getNullable(JsonReader::getInt); + } else if ("version".equals(fieldName)) { + deserializedHorizonDbPoolProperties.version = reader.getString(); + } else if ("createMode".equals(fieldName)) { + deserializedHorizonDbPoolProperties.createMode = CreateModePool.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedHorizonDbPoolProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbPoolProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPools.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPools.java new file mode 100644 index 000000000000..af7ce8b39de5 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPools.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbPools. + */ +public interface HorizonDbPools { + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + Context context); + + /** + * Gets information about a HorizonDb pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @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 information about a HorizonDb pool. + */ + HorizonDbPool get(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists all HorizonDb pools in a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPool list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateEndpointConnections.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateEndpointConnections.java new file mode 100644 index 000000000000..4af404035ff8 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateEndpointConnections.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbPrivateEndpointConnections. + */ +public interface HorizonDbPrivateEndpointConnections { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection. + */ + PrivateEndpointConnectionResource get(String resourceGroupName, String clusterName, + String privateEndpointConnectionName); + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists private endpoint connections in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, + Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + PrivateEndpointConnection update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + PrivateEndpointConnection update(String resourceGroupName, String privateEndpointConnectionName, + PrivateEndpointConnectionUpdate properties, Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 deleteByResourceGroup(String resourceGroupName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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. + */ + void delete(String resourceGroupName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResource.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResource.java new file mode 100644 index 000000000000..e9cd45811e63 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; + +/** + * An immutable client-side representation of HorizonDbPrivateLinkResource. + */ +public interface HorizonDbPrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner object. + * + * @return the inner object. + */ + HorizonDbPrivateLinkResourceInner innerModel(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResources.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResources.java new file mode 100644 index 000000000000..fd1bb46b8460 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResources.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbPrivateLinkResources. + */ +public interface HorizonDbPrivateLinkResources { + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, + String groupName, Context context); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param groupName The name of the private link 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 private link resource. + */ + HorizonDbPrivateLinkResource get(String resourceGroupName, String clusterName, String groupName); + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists private link resources in a HorizonDb cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbPrivateLinkResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplica.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplica.java new file mode 100644 index 000000000000..7b4c9ae753a6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplica.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner; + +/** + * An immutable client-side representation of HorizonDbReplica. + */ +public interface HorizonDbReplica { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HorizonDbReplicaProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner object. + * + * @return the inner object. + */ + HorizonDbReplicaInner innerModel(); + + /** + * The entirety of the HorizonDbReplica definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The HorizonDbReplica definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HorizonDbReplica definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the HorizonDbReplica definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, poolName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @return the next definition stage. + */ + WithCreate withExistingPool(String resourceGroupName, String clusterName, String poolName); + } + + /** + * The stage of the HorizonDbReplica definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + HorizonDbReplica create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HorizonDbReplica create(Context context); + } + + /** + * The stage of the HorizonDbReplica definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(HorizonDbReplicaProperties properties); + } + } + + /** + * Begins update for the HorizonDbReplica resource. + * + * @return the stage of resource update. + */ + HorizonDbReplica.Update update(); + + /** + * The template for HorizonDbReplica update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HorizonDbReplica apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HorizonDbReplica apply(Context context); + } + + /** + * The HorizonDbReplica update stages. + */ + interface UpdateStages { + /** + * The stage of the HorizonDbReplica update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of a HorizonDb replica for update operations.. + * + * @param properties Properties of a HorizonDb replica for update operations. + * @return the next definition stage. + */ + Update withProperties(HorizonDbReplicaPropertiesForPatchUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HorizonDbReplica refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HorizonDbReplica refresh(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaForPatchUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaForPatchUpdate.java new file mode 100644 index 000000000000..e50bb51dde0b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaForPatchUpdate.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * HorizonDb replica for update operations. + */ +@Fluent +public final class HorizonDbReplicaForPatchUpdate implements JsonSerializable { + /* + * Properties of a HorizonDb replica for update operations. + */ + private HorizonDbReplicaPropertiesForPatchUpdate properties; + + /** + * Creates an instance of HorizonDbReplicaForPatchUpdate class. + */ + public HorizonDbReplicaForPatchUpdate() { + } + + /** + * Get the properties property: Properties of a HorizonDb replica for update operations. + * + * @return the properties value. + */ + public HorizonDbReplicaPropertiesForPatchUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a HorizonDb replica for update operations. + * + * @param properties the properties value to set. + * @return the HorizonDbReplicaForPatchUpdate object itself. + */ + public HorizonDbReplicaForPatchUpdate withProperties(HorizonDbReplicaPropertiesForPatchUpdate properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbReplicaForPatchUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbReplicaForPatchUpdate 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 HorizonDbReplicaForPatchUpdate. + */ + public static HorizonDbReplicaForPatchUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbReplicaForPatchUpdate deserializedHorizonDbReplicaForPatchUpdate + = new HorizonDbReplicaForPatchUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedHorizonDbReplicaForPatchUpdate.properties + = HorizonDbReplicaPropertiesForPatchUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbReplicaForPatchUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaProperties.java new file mode 100644 index 000000000000..97e78e9b417c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Properties of a HorizonDb replica. + */ +@Fluent +public final class HorizonDbReplicaProperties implements JsonSerializable { + /* + * Role of the replica. + */ + private ReplicaRole role; + + /* + * Current status of the replica. + */ + private State status; + + /* + * The fully qualified domain name of the replica. + */ + private String fullyQualifiedDomainName; + + /* + * The availability zone of the replica. + */ + private String availabilityZone; + + /* + * The provisioning state of the replica. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HorizonDbReplicaProperties class. + */ + public HorizonDbReplicaProperties() { + } + + /** + * Get the role property: Role of the replica. + * + * @return the role value. + */ + public ReplicaRole role() { + return this.role; + } + + /** + * Set the role property: Role of the replica. + * + * @param role the role value to set. + * @return the HorizonDbReplicaProperties object itself. + */ + public HorizonDbReplicaProperties withRole(ReplicaRole role) { + this.role = role; + return this; + } + + /** + * Get the status property: Current status of the replica. + * + * @return the status value. + */ + public State status() { + return this.status; + } + + /** + * Get the fullyQualifiedDomainName property: The fully qualified domain name of the replica. + * + * @return the fullyQualifiedDomainName value. + */ + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; + } + + /** + * Get the availabilityZone property: The availability zone of the replica. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The availability zone of the replica. + * + * @param availabilityZone the availabilityZone value to set. + * @return the HorizonDbReplicaProperties object itself. + */ + public HorizonDbReplicaProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the replica. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbReplicaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbReplicaProperties 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 HorizonDbReplicaProperties. + */ + public static HorizonDbReplicaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbReplicaProperties deserializedHorizonDbReplicaProperties = new HorizonDbReplicaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedHorizonDbReplicaProperties.role = ReplicaRole.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedHorizonDbReplicaProperties.status = State.fromString(reader.getString()); + } else if ("fullyQualifiedDomainName".equals(fieldName)) { + deserializedHorizonDbReplicaProperties.fullyQualifiedDomainName = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedHorizonDbReplicaProperties.availabilityZone = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedHorizonDbReplicaProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbReplicaProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaPropertiesForPatchUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaPropertiesForPatchUpdate.java new file mode 100644 index 000000000000..9ea3012dde59 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaPropertiesForPatchUpdate.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Properties of a HorizonDb replica for update operations. + */ +@Fluent +public final class HorizonDbReplicaPropertiesForPatchUpdate + implements JsonSerializable { + /* + * Role of the replica. + */ + private ReplicaRole role; + + /** + * Creates an instance of HorizonDbReplicaPropertiesForPatchUpdate class. + */ + public HorizonDbReplicaPropertiesForPatchUpdate() { + } + + /** + * Get the role property: Role of the replica. + * + * @return the role value. + */ + public ReplicaRole role() { + return this.role; + } + + /** + * Set the role property: Role of the replica. + * + * @param role the role value to set. + * @return the HorizonDbReplicaPropertiesForPatchUpdate object itself. + */ + public HorizonDbReplicaPropertiesForPatchUpdate withRole(ReplicaRole role) { + this.role = role; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HorizonDbReplicaPropertiesForPatchUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HorizonDbReplicaPropertiesForPatchUpdate 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 HorizonDbReplicaPropertiesForPatchUpdate. + */ + public static HorizonDbReplicaPropertiesForPatchUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HorizonDbReplicaPropertiesForPatchUpdate deserializedHorizonDbReplicaPropertiesForPatchUpdate + = new HorizonDbReplicaPropertiesForPatchUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedHorizonDbReplicaPropertiesForPatchUpdate.role + = ReplicaRole.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHorizonDbReplicaPropertiesForPatchUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicas.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicas.java new file mode 100644 index 000000000000..77f3e710453d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicas.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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 HorizonDbReplicas. + */ +public interface HorizonDbReplicas { + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, String poolName, + String replicaName, Context context); + + /** + * Gets information about a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 information about a HorizonDb replica. + */ + HorizonDbReplica get(String resourceGroupName, String clusterName, String poolName, String replicaName); + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String poolName); + + /** + * Lists all HorizonDb replicas in a pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HorizonDbReplica list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String poolName, + Context context); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @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 clusterName, String poolName, String replicaName); + + /** + * Deletes a HorizonDb replica. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the HorizonDb cluster. + * @param poolName The name of the HorizonDb pool. + * @param replicaName The name of the HorizonDb replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String poolName, String replicaName, Context context); + + /** + * Gets information about a HorizonDb replica. + * + * @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 information about a HorizonDb replica along with {@link Response}. + */ + HorizonDbReplica getById(String id); + + /** + * Gets information about a HorizonDb replica. + * + * @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 information about a HorizonDb replica along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a HorizonDb replica. + * + * @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 HorizonDb replica. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HorizonDbReplica resource. + * + * @param name resource name. + * @return the first stage of the new HorizonDbReplica definition. + */ + HorizonDbReplica.DefinitionStages.Blank define(String name); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Network.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Network.java new file mode 100644 index 000000000000..aa84d3a8a64c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Network.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Network properties. + */ +@Immutable +public final class Network implements JsonSerializable { + /* + * The flag indicating whether public ip is requested. + */ + private PublicNetworkAccessState publicNetworkAccess; + + /** + * Creates an instance of Network class. + */ + public Network() { + } + + /** + * Get the publicNetworkAccess property: The flag indicating whether public ip is requested. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessState publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Network from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Network 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 Network. + */ + public static Network fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Network deserializedNetwork = new Network(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicNetworkAccess".equals(fieldName)) { + deserializedNetwork.publicNetworkAccess = PublicNetworkAccessState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetwork; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operation.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operation.java new file mode 100644 index 000000000000..236225acf97c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.resourcemanager.horizondb.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OperationDisplay.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OperationDisplay.java new file mode 100644 index 000000000000..ed804b53a189 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operations.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operations.java new file mode 100644 index 000000000000..5ab1771e8b85 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface 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. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OptionalPropertiesUpdateableProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OptionalPropertiesUpdateableProperties.java new file mode 100644 index 000000000000..780374babd70 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/OptionalPropertiesUpdateableProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The template for adding optional properties. + */ +@Fluent +public final class OptionalPropertiesUpdateableProperties + implements JsonSerializable { + /* + * The private endpoint resource. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Creates an instance of OptionalPropertiesUpdateableProperties class. + */ + public OptionalPropertiesUpdateableProperties() { + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the OptionalPropertiesUpdateableProperties object itself. + */ + public OptionalPropertiesUpdateableProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the OptionalPropertiesUpdateableProperties object itself. + */ + public OptionalPropertiesUpdateableProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptionalPropertiesUpdateableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptionalPropertiesUpdateableProperties 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 OptionalPropertiesUpdateableProperties. + */ + public static OptionalPropertiesUpdateableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptionalPropertiesUpdateableProperties deserializedOptionalPropertiesUpdateableProperties + = new OptionalPropertiesUpdateableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateEndpoint".equals(fieldName)) { + deserializedOptionalPropertiesUpdateableProperties.privateEndpoint + = PrivateEndpoint.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedOptionalPropertiesUpdateableProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOptionalPropertiesUpdateableProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Origin.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Origin.java new file mode 100644 index 000000000000..d8f9b3362ee6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ParameterProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ParameterProperties.java new file mode 100644 index 000000000000..b204691314c8 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ParameterProperties.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * Properties of a HorizonDb parameters. + */ +@Fluent +public final class ParameterProperties implements JsonSerializable { + /* + * The name of the parameter. + */ + private String name; + + /* + * The description of the parameter. + */ + private String description; + + /* + * The value of the configuration. + */ + private String value; + + /* + * The data type of the parameter. + */ + private String dataType; + + /* + * The allowed values for the parameter. + */ + private String allowedValues; + + /* + * Whether the parameter can be changed dynamically. + */ + private Boolean isDynamic; + + /* + * Whether the parameter is a read-only parameter. + */ + private Boolean isReadOnly; + + /* + * Link to parameter documentation. + */ + private String documentationLink; + + /* + * The unit of measurement for the parameter. + */ + private String unit; + + /** + * Creates an instance of ParameterProperties class. + */ + public ParameterProperties() { + } + + /** + * Get the name property: The name of the parameter. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the parameter. + * + * @param name the name value to set. + * @return the ParameterProperties object itself. + */ + public ParameterProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description of the parameter. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the value property: The value of the configuration. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the configuration. + * + * @param value the value value to set. + * @return the ParameterProperties object itself. + */ + public ParameterProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the dataType property: The data type of the parameter. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Get the allowedValues property: The allowed values for the parameter. + * + * @return the allowedValues value. + */ + public String allowedValues() { + return this.allowedValues; + } + + /** + * Get the isDynamic property: Whether the parameter can be changed dynamically. + * + * @return the isDynamic value. + */ + public Boolean isDynamic() { + return this.isDynamic; + } + + /** + * Get the isReadOnly property: Whether the parameter is a read-only parameter. + * + * @return the isReadOnly value. + */ + public Boolean isReadOnly() { + return this.isReadOnly; + } + + /** + * Get the documentationLink property: Link to parameter documentation. + * + * @return the documentationLink value. + */ + public String documentationLink() { + return this.documentationLink; + } + + /** + * Get the unit property: The unit of measurement for the parameter. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ParameterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ParameterProperties 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 ParameterProperties. + */ + public static ParameterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ParameterProperties deserializedParameterProperties = new ParameterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedParameterProperties.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedParameterProperties.description = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedParameterProperties.value = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedParameterProperties.dataType = reader.getString(); + } else if ("allowedValues".equals(fieldName)) { + deserializedParameterProperties.allowedValues = reader.getString(); + } else if ("isDynamic".equals(fieldName)) { + deserializedParameterProperties.isDynamic = reader.getNullable(JsonReader::getBoolean); + } else if ("isReadOnly".equals(fieldName)) { + deserializedParameterProperties.isReadOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("documentationLink".equals(fieldName)) { + deserializedParameterProperties.documentationLink = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedParameterProperties.unit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedParameterProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpoint.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpoint.java new file mode 100644 index 000000000000..53942e7f249d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpoint.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * The private endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The resource identifier of the private endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The resource identifier of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint 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 PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnection.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..9fbe9cd51e7f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnection.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..fdcd28109444 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private endpoint connection. + */ +@Immutable +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The private endpoint resource. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + private PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProvisioningState.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..a9ea7d3c664e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProvisioningState.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.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Connection has been provisioned. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Connection is being created. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Connection is being deleted. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Connection provisioning has failed. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionResource.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionResource.java new file mode 100644 index 000000000000..5a66a78fa15c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; + +/** + * An immutable client-side representation of PrivateEndpointConnectionResource. + */ +public interface PrivateEndpointConnectionResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionResourceInner innerModel(); +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionUpdate.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionUpdate.java new file mode 100644 index 000000000000..b4cd32a984c2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionUpdate.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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; + +/** + * PATCH model for private endpoint connections. + */ +@Fluent +public final class PrivateEndpointConnectionUpdate implements JsonSerializable { + /* + * The private endpoint connection properties + */ + private OptionalPropertiesUpdateableProperties properties; + + /** + * Creates an instance of PrivateEndpointConnectionUpdate class. + */ + public PrivateEndpointConnectionUpdate() { + } + + /** + * Get the properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + public OptionalPropertiesUpdateableProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The private endpoint connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionUpdate object itself. + */ + public PrivateEndpointConnectionUpdate withProperties(OptionalPropertiesUpdateableProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionUpdate 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 PrivateEndpointConnectionUpdate. + */ + public static PrivateEndpointConnectionUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionUpdate deserializedPrivateEndpointConnectionUpdate + = new PrivateEndpointConnectionUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionUpdate.properties + = OptionalPropertiesUpdateableProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionUpdate; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointServiceConnectionStatus.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..7f53da8ecc7f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointServiceConnectionStatus.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.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Connection waiting for approval or rejection. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Connection approved. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Connection Rejected. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkResourceProperties.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..dac0654659d9 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkResourceProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Immutable +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + private PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkServiceConnectionState.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..181e5d9e2350 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ProvisioningState.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ProvisioningState.java new file mode 100644 index 000000000000..7e66431f729e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Provisioning completed successfully. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Provisioning failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Provisioning was canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Provisioning is in progress. + */ + public static final ProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Provisioning is in progress. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PublicNetworkAccessState.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PublicNetworkAccessState.java new file mode 100644 index 000000000000..c1a8be35a453 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/PublicNetworkAccessState.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.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates if public network access is enabled or not. + */ +public final class PublicNetworkAccessState extends ExpandableStringEnum { + /** + * Public network access is enabled. + */ + public static final PublicNetworkAccessState ENABLED = fromString("Enabled"); + + /** + * Public network access is disabled. + */ + public static final PublicNetworkAccessState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccessState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccessState() { + } + + /** + * Creates or finds a PublicNetworkAccessState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccessState. + */ + public static PublicNetworkAccessState fromString(String name) { + return fromString(name, PublicNetworkAccessState.class); + } + + /** + * Gets known PublicNetworkAccessState values. + * + * @return known PublicNetworkAccessState values. + */ + public static Collection values() { + return values(PublicNetworkAccessState.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ReplicaRole.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ReplicaRole.java new file mode 100644 index 000000000000..985dbca7d75a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ReplicaRole.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.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Role of the replica. + */ +public final class ReplicaRole extends ExpandableStringEnum { + /** + * Read-only replica. + */ + public static final ReplicaRole READ = fromString("Read"); + + /** + * ReadWrite replica. + */ + public static final ReplicaRole READ_WRITE = fromString("ReadWrite"); + + /** + * Creates a new instance of ReplicaRole value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicaRole() { + } + + /** + * Creates or finds a ReplicaRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicaRole. + */ + public static ReplicaRole fromString(String name) { + return fromString(name, ReplicaRole.class); + } + + /** + * Gets known ReplicaRole values. + * + * @return known ReplicaRole values. + */ + public static Collection values() { + return values(ReplicaRole.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/State.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/State.java new file mode 100644 index 000000000000..ba894c1559b6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/State.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current states. + */ +public final class State extends ExpandableStringEnum { + /** + * Is ready and operational. + */ + public static final State READY = fromString("Ready"); + + /** + * Is being dropped/deleted. + */ + public static final State DROPPING = fromString("Dropping"); + + /** + * Is disabled. + */ + public static final State DISABLED = fromString("Disabled"); + + /** + * Is starting up. + */ + public static final State STARTING = fromString("Starting"); + + /** + * Is stopping. + */ + public static final State STOPPING = fromString("Stopping"); + + /** + * Is stopped. + */ + public static final State STOPPED = fromString("Stopped"); + + /** + * Is being updated. + */ + public static final State UPDATING = fromString("Updating"); + + /** + * Is healthy. + */ + public static final State HEALTHY = fromString("Healthy"); + + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ZonePlacementPolicy.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ZonePlacementPolicy.java new file mode 100644 index 000000000000..0077b318d46e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/ZonePlacementPolicy.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.horizondb.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The zone redundancy option for the cluster. + */ +public final class ZonePlacementPolicy extends ExpandableStringEnum { + /** + * Enforce zonal redundancy. + */ + public static final ZonePlacementPolicy STRICT = fromString("Strict"); + + /** + * Best-effort placement (default). + */ + public static final ZonePlacementPolicy BEST_EFFORT = fromString("BestEffort"); + + /** + * Creates a new instance of ZonePlacementPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZonePlacementPolicy() { + } + + /** + * Creates or finds a ZonePlacementPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZonePlacementPolicy. + */ + public static ZonePlacementPolicy fromString(String name) { + return fromString(name, ZonePlacementPolicy.class); + } + + /** + * Gets known ZonePlacementPolicy values. + * + * @return known ZonePlacementPolicy values. + */ + public static Collection values() { + return values(ZonePlacementPolicy.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/package-info.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/package-info.java new file mode 100644 index 000000000000..4dec7e174d93 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for HorizonDb. + * Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. + */ +package com.azure.resourcemanager.horizondb.models; diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/package-info.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/package-info.java new file mode 100644 index 000000000000..b2f34a2b787a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/com/azure/resourcemanager/horizondb/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for HorizonDb. + * Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall rules. + */ +package com.azure.resourcemanager.horizondb; diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/module-info.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/module-info.java new file mode 100644 index 000000000000..6fd796f37409 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.horizondb { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.horizondb; + exports com.azure.resourcemanager.horizondb.fluent; + exports com.azure.resourcemanager.horizondb.fluent.models; + exports com.azure.resourcemanager.horizondb.models; + + opens com.azure.resourcemanager.horizondb.fluent.models to com.azure.core; + opens com.azure.resourcemanager.horizondb.models to com.azure.core; + opens com.azure.resourcemanager.horizondb.implementation.models to com.azure.core; +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/azure-resourcemanager-horizondb_metadata.json b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/azure-resourcemanager-horizondb_metadata.json new file mode 100644 index 000000000000..a4e1a490b957 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/azure-resourcemanager-horizondb_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.HorizonDb":"2026-01-20-preview"},"crossLanguageDefinitions":{"com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient":"Microsoft.HorizonDb.HorizonDbClusters","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.beginCreateOrUpdate":"Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.beginCreateOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.beginDelete":"Microsoft.HorizonDb.HorizonDbClusters.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.beginDeleteAsync":"Microsoft.HorizonDb.HorizonDbClusters.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.beginUpdate":"Microsoft.HorizonDb.HorizonDbClusters.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.beginUpdateAsync":"Microsoft.HorizonDb.HorizonDbClusters.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.createOrUpdate":"Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.createOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.createOrUpdateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbClusters.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.delete":"Microsoft.HorizonDb.HorizonDbClusters.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.deleteAsync":"Microsoft.HorizonDb.HorizonDbClusters.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.deleteWithResponseAsync":"Microsoft.HorizonDb.HorizonDbClusters.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.getByResourceGroup":"Microsoft.HorizonDb.HorizonDbClusters.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.getByResourceGroupAsync":"Microsoft.HorizonDb.HorizonDbClusters.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.getByResourceGroupWithResponse":"Microsoft.HorizonDb.HorizonDbClusters.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.getByResourceGroupWithResponseAsync":"Microsoft.HorizonDb.HorizonDbClusters.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.list":"Microsoft.HorizonDb.HorizonDbClusters.listBySubscription","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.listAsync":"Microsoft.HorizonDb.HorizonDbClusters.listBySubscription","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.listByResourceGroup":"Microsoft.HorizonDb.HorizonDbClusters.listByResourceGroup","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.listByResourceGroupAsync":"Microsoft.HorizonDb.HorizonDbClusters.listByResourceGroup","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.update":"Microsoft.HorizonDb.HorizonDbClusters.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.updateAsync":"Microsoft.HorizonDb.HorizonDbClusters.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbClustersClient.updateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbClusters.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient":"Microsoft.HorizonDb.HorizonDbFirewallRules","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.beginCreateOrUpdate":"Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.beginCreateOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.beginDelete":"Microsoft.HorizonDb.HorizonDbFirewallRules.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.beginDeleteAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.createOrUpdate":"Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.createOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.createOrUpdateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.delete":"Microsoft.HorizonDb.HorizonDbFirewallRules.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.deleteAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.deleteWithResponseAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.get":"Microsoft.HorizonDb.HorizonDbFirewallRules.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.getAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.getWithResponse":"Microsoft.HorizonDb.HorizonDbFirewallRules.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.getWithResponseAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.list":"Microsoft.HorizonDb.HorizonDbFirewallRules.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbFirewallRulesClient.listAsync":"Microsoft.HorizonDb.HorizonDbFirewallRules.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbManagementClient":"Microsoft.HorizonDb","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient":"Microsoft.HorizonDb.HorizonDbParameterGroups","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.beginCreateOrUpdate":"Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.beginCreateOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.beginDelete":"Microsoft.HorizonDb.HorizonDbParameterGroups.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.beginDeleteAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.beginUpdate":"Microsoft.HorizonDb.HorizonDbParameterGroups.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.beginUpdateAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.createOrUpdate":"Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.createOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.createOrUpdateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.delete":"Microsoft.HorizonDb.HorizonDbParameterGroups.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.deleteAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.deleteWithResponseAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.getByResourceGroup":"Microsoft.HorizonDb.HorizonDbParameterGroups.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.getByResourceGroupAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.getByResourceGroupWithResponse":"Microsoft.HorizonDb.HorizonDbParameterGroups.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.getByResourceGroupWithResponseAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.list":"Microsoft.HorizonDb.HorizonDbParameterGroups.listBySubscription","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.listBySubscription","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listByResourceGroup":"Microsoft.HorizonDb.HorizonDbParameterGroups.listByResourceGroup","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listByResourceGroupAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.listByResourceGroup","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listConnections":"Microsoft.HorizonDb.HorizonDbParameterGroups.listConnections","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listConnectionsAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.listConnections","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listVersions":"Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.listVersionsAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.update":"Microsoft.HorizonDb.HorizonDbParameterGroups.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.updateAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbParameterGroupsClient.updateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbParameterGroups.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient":"Microsoft.HorizonDb.HorizonDbPools","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient.get":"Microsoft.HorizonDb.HorizonDbPools.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient.getAsync":"Microsoft.HorizonDb.HorizonDbPools.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient.getWithResponse":"Microsoft.HorizonDb.HorizonDbPools.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient.getWithResponseAsync":"Microsoft.HorizonDb.HorizonDbPools.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient.list":"Microsoft.HorizonDb.HorizonDbPools.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbPoolsClient.listAsync":"Microsoft.HorizonDb.HorizonDbPools.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.beginDelete":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.beginDeleteAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.beginUpdate":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.beginUpdateAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.delete":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.deleteAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.deleteWithResponseAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.get":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.getAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.getWithResponse":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.getWithResponseAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.list":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.listAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.update":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.updateAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateEndpointConnectionsClient.updateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient.get":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient.getAsync":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient.getWithResponse":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient.getWithResponseAsync":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient.list":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbPrivateLinkResourcesClient.listAsync":"Microsoft.HorizonDb.HorizonDbPrivateLinkResources.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient":"Microsoft.HorizonDb.HorizonDbReplicas","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.beginCreateOrUpdate":"Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.beginCreateOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.beginDelete":"Microsoft.HorizonDb.HorizonDbReplicas.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.beginDeleteAsync":"Microsoft.HorizonDb.HorizonDbReplicas.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.beginUpdate":"Microsoft.HorizonDb.HorizonDbReplicas.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.beginUpdateAsync":"Microsoft.HorizonDb.HorizonDbReplicas.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.createOrUpdate":"Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.createOrUpdateAsync":"Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.createOrUpdateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbReplicas.createOrUpdate","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.delete":"Microsoft.HorizonDb.HorizonDbReplicas.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.deleteAsync":"Microsoft.HorizonDb.HorizonDbReplicas.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.deleteWithResponseAsync":"Microsoft.HorizonDb.HorizonDbReplicas.delete","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.get":"Microsoft.HorizonDb.HorizonDbReplicas.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.getAsync":"Microsoft.HorizonDb.HorizonDbReplicas.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.getWithResponse":"Microsoft.HorizonDb.HorizonDbReplicas.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.getWithResponseAsync":"Microsoft.HorizonDb.HorizonDbReplicas.get","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.list":"Microsoft.HorizonDb.HorizonDbReplicas.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.listAsync":"Microsoft.HorizonDb.HorizonDbReplicas.list","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.update":"Microsoft.HorizonDb.HorizonDbReplicas.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.updateAsync":"Microsoft.HorizonDb.HorizonDbReplicas.update","com.azure.resourcemanager.horizondb.fluent.HorizonDbReplicasClient.updateWithResponseAsync":"Microsoft.HorizonDb.HorizonDbReplicas.update","com.azure.resourcemanager.horizondb.fluent.OperationsClient":"Microsoft.HorizonDb.Operations","com.azure.resourcemanager.horizondb.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.horizondb.fluent.OperationsClient.listAsync":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbClusterInner":"Microsoft.HorizonDb.HorizonDbCluster","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner":"Microsoft.HorizonDb.HorizonDbFirewallRule","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner":"Microsoft.HorizonDb.HorizonDbParameterGroupConnectionProperties","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner":"Microsoft.HorizonDb.HorizonDbParameterGroup","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner":"Microsoft.HorizonDb.HorizonDbPool","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner":"Microsoft.HorizonDb.HorizonDbPrivateLinkResource","com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner":"Microsoft.HorizonDb.HorizonDbReplica","com.azure.resourcemanager.horizondb.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnection","com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner":"Azure.ResourceManager.PrivateEndpointConnectionResource","com.azure.resourcemanager.horizondb.implementation.HorizonDbManagementClientBuilder":"Microsoft.HorizonDb","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbClusterListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbFirewallRuleListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbParameterGroupConnectionPropertiesListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbParameterGroupListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbPoolListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbPrivateLinkResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.HorizonDbReplicaListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.horizondb.implementation.models.PrivateEndpointConnectionResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.horizondb.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.horizondb.models.CreateModeCluster":"Microsoft.HorizonDb.CreateModeCluster","com.azure.resourcemanager.horizondb.models.CreateModePool":"Microsoft.HorizonDb.CreateModePool","com.azure.resourcemanager.horizondb.models.HorizonDbClusterForPatchUpdate":"Microsoft.HorizonDb.HorizonDbClusterForPatchUpdate","com.azure.resourcemanager.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties":"Microsoft.HorizonDb.HorizonDbClusterParameterGroupConnectionProperties","com.azure.resourcemanager.horizondb.models.HorizonDbClusterProperties":"Microsoft.HorizonDb.HorizonDbClusterProperties","com.azure.resourcemanager.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate":"Microsoft.HorizonDb.HorizonDbClusterPropertiesForPatchUpdate","com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties":"Microsoft.HorizonDb.HorizonDbFirewallRuleProperties","com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupForPatchUpdate":"Microsoft.HorizonDb.HorizonDbParameterGroupForPatchUpdate","com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties":"Microsoft.HorizonDb.HorizonDbParameterGroupProperties","com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate":"Microsoft.HorizonDb.HorizonDbParameterGroupPropertiesForPatchUpdate","com.azure.resourcemanager.horizondb.models.HorizonDbPoolProperties":"Microsoft.HorizonDb.HorizonDbPoolProperties","com.azure.resourcemanager.horizondb.models.HorizonDbReplicaForPatchUpdate":"Microsoft.HorizonDb.HorizonDbReplicaForPatchUpdate","com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties":"Microsoft.HorizonDb.HorizonDbReplicaProperties","com.azure.resourcemanager.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate":"Microsoft.HorizonDb.HorizonDbReplicaPropertiesForPatchUpdate","com.azure.resourcemanager.horizondb.models.Network":"Microsoft.HorizonDb.Network","com.azure.resourcemanager.horizondb.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.horizondb.models.OptionalPropertiesUpdateableProperties":"TypeSpec.OptionalProperties","com.azure.resourcemanager.horizondb.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.horizondb.models.ParameterProperties":"Microsoft.HorizonDb.ParameterProperties","com.azure.resourcemanager.horizondb.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProperties":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties","com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate":"Azure.ResourceManager.PrivateEndpointConnectionUpdate","com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.horizondb.models.PrivateLinkResourceProperties":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties","com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.horizondb.models.ProvisioningState":"Microsoft.HorizonDb.ProvisioningState","com.azure.resourcemanager.horizondb.models.PublicNetworkAccessState":"Microsoft.HorizonDb.PublicNetworkAccessState","com.azure.resourcemanager.horizondb.models.ReplicaRole":"Microsoft.HorizonDb.ReplicaRole","com.azure.resourcemanager.horizondb.models.State":"Microsoft.HorizonDb.State","com.azure.resourcemanager.horizondb.models.ZonePlacementPolicy":"Microsoft.HorizonDb.ZonePlacementPolicy"},"generatedFiles":["src/main/java/com/azure/resourcemanager/horizondb/HorizonDbManager.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbClustersClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbFirewallRulesClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbManagementClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbParameterGroupsClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPoolsClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbPrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/HorizonDbReplicasClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbClusterInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbFirewallRuleInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupConnectionPropertiesInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbParameterGroupInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPoolInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbPrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/HorizonDbReplicaInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/PrivateEndpointConnectionResourceInner.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/horizondb/fluent/package-info.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClusterImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbClustersImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRuleImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbFirewallRulesImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbManagementClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupConnectionPropertiesImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbParameterGroupsImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPoolsImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbPrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicaImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/HorizonDbReplicasImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/PrivateEndpointConnectionResourceImpl.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbClusterListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbFirewallRuleListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupConnectionPropertiesListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbParameterGroupListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPoolListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbPrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/HorizonDbReplicaListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/models/PrivateEndpointConnectionResourceListResult.java","src/main/java/com/azure/resourcemanager/horizondb/implementation/package-info.java","src/main/java/com/azure/resourcemanager/horizondb/models/ActionType.java","src/main/java/com/azure/resourcemanager/horizondb/models/CreateModeCluster.java","src/main/java/com/azure/resourcemanager/horizondb/models/CreateModePool.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbCluster.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterForPatchUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterParameterGroupConnectionProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusterPropertiesForPatchUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbClusters.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRule.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRuleProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbFirewallRules.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroup.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupConnectionProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupForPatchUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroupPropertiesForPatchUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbParameterGroups.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPool.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPoolProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPools.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResource.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbPrivateLinkResources.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplica.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaForPatchUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicaPropertiesForPatchUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/HorizonDbReplicas.java","src/main/java/com/azure/resourcemanager/horizondb/models/Network.java","src/main/java/com/azure/resourcemanager/horizondb/models/Operation.java","src/main/java/com/azure/resourcemanager/horizondb/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/horizondb/models/Operations.java","src/main/java/com/azure/resourcemanager/horizondb/models/OptionalPropertiesUpdateableProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/Origin.java","src/main/java/com/azure/resourcemanager/horizondb/models/ParameterProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionResource.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointConnectionUpdate.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/horizondb/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/horizondb/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/horizondb/models/PublicNetworkAccessState.java","src/main/java/com/azure/resourcemanager/horizondb/models/ReplicaRole.java","src/main/java/com/azure/resourcemanager/horizondb/models/State.java","src/main/java/com/azure/resourcemanager/horizondb/models/ZonePlacementPolicy.java","src/main/java/com/azure/resourcemanager/horizondb/models/package-info.java","src/main/java/com/azure/resourcemanager/horizondb/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/proxy-config.json b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/proxy-config.json new file mode 100644 index 000000000000..3ff57c0b9fa9 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.horizondb.implementation.HorizonDbClustersClientImpl$HorizonDbClustersService"],["com.azure.resourcemanager.horizondb.implementation.HorizonDbFirewallRulesClientImpl$HorizonDbFirewallRulesService"],["com.azure.resourcemanager.horizondb.implementation.HorizonDbParameterGroupsClientImpl$HorizonDbParameterGroupsService"],["com.azure.resourcemanager.horizondb.implementation.HorizonDbPoolsClientImpl$HorizonDbPoolsService"],["com.azure.resourcemanager.horizondb.implementation.HorizonDbPrivateEndpointConnectionsClientImpl$HorizonDbPrivateEndpointConnectionsService"],["com.azure.resourcemanager.horizondb.implementation.HorizonDbPrivateLinkResourcesClientImpl$HorizonDbPrivateLinkResourcesService"],["com.azure.resourcemanager.horizondb.implementation.HorizonDbReplicasClientImpl$HorizonDbReplicasService"],["com.azure.resourcemanager.horizondb.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/reflect-config.json b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-horizondb/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/azure-resourcemanager-horizondb.properties b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/azure-resourcemanager-horizondb.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/main/resources/azure-resourcemanager-horizondb.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersCreateOrUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e4e5f7eca05a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersCreateOrUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.CreateModeCluster; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterProperties; +import com.azure.resourcemanager.horizondb.models.ZonePlacementPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbClusters CreateOrUpdate. + */ +public final class HorizonDbClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void createOrUpdateAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters() + .define("examplecluster") + .withRegion("westus2") + .withExistingResourceGroup("exampleresourcegroup") + .withTags(mapOf("env", "dev")) + .withProperties(new HorizonDbClusterProperties().withAdministratorLogin("exampleadministratorlogin") + .withAdministratorLoginPassword("fakeTokenPlaceholder") + .withVersion("17") + .withCreateMode(CreateModeCluster.CREATE) + .withSourceClusterResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/examplesourceresourcegroup/providers/Microsoft.HorizonDb/clusters/examplesourcecluster") + .withReplicaCount(2) + .withVCores(4) + .withZonePlacementPolicy(ZonePlacementPolicy.STRICT)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersDeleteSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersDeleteSamples.java new file mode 100644 index 000000000000..33e9e5813059 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersDeleteSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbClusters Delete. + */ +public final class HorizonDbClustersDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_Delete.json + */ + /** + * Sample code: Delete a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters().delete("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersGetByResourceGroupSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7cdec34ff672 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersGetByResourceGroupSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbClusters GetByResourceGroup. + */ +public final class HorizonDbClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_Get.json + */ + /** + * Sample code: Get a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters() + .getByResourceGroupWithResponse("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListByResourceGroupSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..bef4bc5b09a7 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListByResourceGroupSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbClusters ListByResourceGroup. + */ +public final class HorizonDbClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_ListByResourceGroup.json + */ + /** + * Sample code: List HorizonDb clusters in a resource group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbClustersInAResourceGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters().listByResourceGroup("exampleresourcegroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListSamples.java new file mode 100644 index 000000000000..e6f71358b1d8 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersListSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbClusters List. + */ +public final class HorizonDbClustersListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_ListBySubscription.json + */ + /** + * Sample code: List HorizonDb clusters by subscription. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbClustersBySubscription(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersUpdateSamples.java new file mode 100644 index 000000000000..a64fa78bdf20 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClustersUpdateSamples.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.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.HorizonDbCluster; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbClusters Update. + */ +public final class HorizonDbClustersUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Clusters_Update.json + */ + /** + * Sample code: Update a HorizonDb cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void updateAHorizonDbCluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + HorizonDbCluster resource = manager.horizonDbClusters() + .getByResourceGroupWithResponse("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("team", "updated-data-platform")) + .withProperties( + new HorizonDbClusterPropertiesForPatchUpdate().withAdministratorLoginPassword("fakeTokenPlaceholder") + .withVCores(8)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..423ded35c93b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; + +/** + * Samples for HorizonDbFirewallRules CreateOrUpdate. + */ +public final class HorizonDbFirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb firewall rule. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + createOrUpdateAHorizonDbFirewallRule(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .define("examplefirewallrule") + .withExistingPool("exampleresourcegroup", "examplecluster", "examplepool") + .withProperties(new HorizonDbFirewallRuleProperties().withStartIpAddress("10.0.0.1") + .withEndIpAddress("10.0.0.10") + .withDescription("Allow access from corporate network")) + .create(); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesDeleteSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesDeleteSamples.java new file mode 100644 index 000000000000..fa1c799fdd10 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbFirewallRules Delete. + */ +public final class HorizonDbFirewallRulesDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_Delete.json + */ + /** + * Sample code: Delete a HorizonDb firewall rule. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbFirewallRule(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .delete("exampleresourcegroup", "examplecluster", "examplepool", "examplefirewallrule", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetSamples.java new file mode 100644 index 000000000000..1eb2a947fdd5 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbFirewallRules Get. + */ +public final class HorizonDbFirewallRulesGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_Get.json + */ + /** + * Sample code: Get a HorizonDb firewall rule. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbFirewallRule(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", "examplefirewallrule", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListSamples.java new file mode 100644 index 000000000000..9ddf167d30d6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbFirewallRules List. + */ +public final class HorizonDbFirewallRulesListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/FirewallRules_List.json + */ + /** + * Sample code: List HorizonDb firewall rules in a pool. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void listHorizonDbFirewallRulesInAPool(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbFirewallRules() + .list("exampleresourcegroup", "examplecluster", "examplepool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..32ba2c638a58 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateSamples.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.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbParameterGroups CreateOrUpdate. + */ +public final class HorizonDbParameterGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + createOrUpdateAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .define("exampleparametergroup") + .withRegion("westus2") + .withExistingResourceGroup("exampleresourcegroup") + .withTags(mapOf("env", "dev", "team", "data-platform")) + .withProperties(new HorizonDbParameterGroupProperties() + .withParameters(Arrays.asList(new ParameterProperties().withName("max_connections").withValue("200"), + new ParameterProperties().withName("log_min_error_statement").withValue("error"), + new ParameterProperties().withName("shared_buffers").withValue("2000"))) + .withDescription("Parameter group for high-throughput workloads") + .withPgVersion(17) + .withApplyImmediately(true)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsDeleteSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsDeleteSamples.java new file mode 100644 index 000000000000..14f570502200 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsDeleteSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbParameterGroups Delete. + */ +public final class HorizonDbParameterGroupsDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_Delete.json + */ + /** + * Sample code: Delete a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .delete("exampleresourcegroup", "exampleparametergroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..cfba569dd579 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbParameterGroups GetByResourceGroup. + */ +public final class HorizonDbParameterGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_Get.json + */ + /** + * Sample code: Get a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .getByResourceGroupWithResponse("exampleresourcegroup", "exampleparametergroup", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e5613a922eb7 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbParameterGroups ListByResourceGroup. + */ +public final class HorizonDbParameterGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListByResourceGroup.json + */ + /** + * Sample code: List HorizonDb parameter groups in a resource group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbParameterGroupsInAResourceGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .listByResourceGroup("exampleresourcegroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsSamples.java new file mode 100644 index 000000000000..50685ad500b1 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbParameterGroups ListConnections. + */ +public final class HorizonDbParameterGroupsListConnectionsSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListConnections.json + */ + /** + * Sample code: List connections for a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listConnectionsForAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .listConnections("exampleresourcegroup", "exampleparametergroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListSamples.java new file mode 100644 index 000000000000..e6fe0a4ef379 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbParameterGroups List. + */ +public final class HorizonDbParameterGroupsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListBySubscription.json + */ + /** + * Sample code: List HorizonDb parameter groups in a subscription. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listHorizonDbParameterGroupsInASubscription(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsSamples.java new file mode 100644 index 000000000000..e738e37dd614 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbParameterGroups ListVersions. + */ +public final class HorizonDbParameterGroupsListVersionsSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListVersions.json + */ + /** + * Sample code: List parameter groups filtered by version. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listParameterGroupsFilteredByVersion(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbParameterGroups() + .listVersions("exampleresourcegroup", "exampleparametergroup", 22, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsUpdateSamples.java new file mode 100644 index 000000000000..5e19d5022b4e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HorizonDbParameterGroups Update. + */ +public final class HorizonDbParameterGroupsUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/ParameterGroups_Update.json + */ + /** + * Sample code: Update a HorizonDb parameter group. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void updateAHorizonDbParameterGroup(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + HorizonDbParameterGroup resource = manager.horizonDbParameterGroups() + .getByResourceGroupWithResponse("exampleresourcegroup", "exampleparametergroup", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("team", "updated-data-platform")) + .withProperties(new HorizonDbParameterGroupPropertiesForPatchUpdate() + .withParameters(Arrays.asList(new ParameterProperties().withName("max_connections").withValue("300"), + new ParameterProperties().withName("log_min_error_statement").withValue("warning"))) + .withDescription("Updated parameter group for high-throughput workloads") + .withApplyImmediately(true)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetSamples.java new file mode 100644 index 000000000000..2c24a86eeb84 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbPools Get. + */ +public final class HorizonDbPoolsGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Pools_Get.json + */ + /** + * Sample code: Get a HorizonDb pool. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbPool(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPools() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListSamples.java new file mode 100644 index 000000000000..53d2dbace11d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbPools List. + */ +public final class HorizonDbPoolsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Pools_List.json + */ + /** + * Sample code: List HorizonDb pools in a cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void listHorizonDbPoolsInACluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPools().list("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsDeleteSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..b4bdcc82541d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbPrivateEndpointConnections Delete. + */ +public final class HorizonDbPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete a private endpoint connection. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAPrivateEndpointConnection(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .delete("exampleresourcegroup", "exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..7765c619cf7c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbPrivateEndpointConnections Get. + */ +public final class HorizonDbPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get a private endpoint connection. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAPrivateEndpointConnection(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .getWithResponse("exampleresourcegroup", "examplecluster", + "exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..9a7ce0732b40 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbPrivateEndpointConnections List. + */ +public final class HorizonDbPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_List.json + */ + /** + * Sample code: List all private endpoint connections on a cluster. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listAllPrivateEndpointConnectionsOnACluster(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .list("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateSamples.java new file mode 100644 index 000000000000..fefdd1c0569e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.OptionalPropertiesUpdateableProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState; + +/** + * Samples for HorizonDbPrivateEndpointConnections Update. + */ +public final class HorizonDbPrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Update.json + */ + /** + * Sample code: Approve or reject a private endpoint connection. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + approveOrRejectAPrivateEndpointConnection(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateEndpointConnections() + .update("exampleresourcegroup", "exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", + new PrivateEndpointConnectionUpdate().withProperties(new OptionalPropertiesUpdateableProperties() + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..f5bd0ac2fc3a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbPrivateLinkResources Get. + */ +public final class HorizonDbPrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateLinkResources_Get.json + */ + /** + * Sample code: Gets a private link resource for HorizonDb. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + getsAPrivateLinkResourceForHorizonDb(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateLinkResources() + .getWithResponse("exampleresourcegroup", "examplecluster", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListSamples.java new file mode 100644 index 000000000000..b4b33b7b1a84 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbPrivateLinkResources List. + */ +public final class HorizonDbPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/PrivateLinkResources_List.json + */ + /** + * Sample code: Gets private link resources for HorizonDb. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + getsPrivateLinkResourcesForHorizonDb(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbPrivateLinkResources() + .list("exampleresourcegroup", "examplecluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e24d89c331c7 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; + +/** + * Samples for HorizonDbReplicas CreateOrUpdate. + */ +public final class HorizonDbReplicasCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void createOrUpdateAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .define("examplereplica") + .withExistingPool("exampleresourcegroup", "examplecluster", "examplepool") + .withProperties(new HorizonDbReplicaProperties().withRole(ReplicaRole.READ).withAvailabilityZone("1")) + .create(); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasDeleteSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasDeleteSamples.java new file mode 100644 index 000000000000..91413f2acb1e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbReplicas Delete. + */ +public final class HorizonDbReplicasDeleteSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_Delete.json + */ + /** + * Sample code: Delete a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void deleteAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .delete("exampleresourcegroup", "examplecluster", "examplepool", "examplereplica", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetSamples.java new file mode 100644 index 000000000000..aaa741f20215 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for HorizonDbReplicas Get. + */ +public final class HorizonDbReplicasGetSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_Get.json + */ + /** + * Sample code: Get a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void getAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", "examplereplica", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListSamples.java new file mode 100644 index 000000000000..46075ae5ec07 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListSamples.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.horizondb.generated; + +/** + * Samples for HorizonDbReplicas List. + */ +public final class HorizonDbReplicasListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_List.json + */ + /** + * Sample code: List HorizonDb replicas in a pool. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void listHorizonDbReplicasInAPool(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.horizonDbReplicas() + .list("exampleresourcegroup", "examplecluster", "examplepool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasUpdateSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasUpdateSamples.java new file mode 100644 index 000000000000..f4477dfab8c6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; + +/** + * Samples for HorizonDbReplicas Update. + */ +public final class HorizonDbReplicasUpdateSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Replicas_Update.json + */ + /** + * Sample code: Update a HorizonDb replica. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void updateAHorizonDbReplica(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + HorizonDbReplica resource = manager.horizonDbReplicas() + .getWithResponse("exampleresourcegroup", "examplecluster", "examplepool", "examplereplica", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new HorizonDbReplicaPropertiesForPatchUpdate().withRole(ReplicaRole.READ_WRITE)) + .apply(); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/OperationsListSamples.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/OperationsListSamples.java new file mode 100644 index 000000000000..e6f96e9bec63 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/samples/java/com/azure/resourcemanager/horizondb/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-01-20-preview/Operations_List.json + */ + /** + * Sample code: List operations for Microsoft.HorizonDb. + * + * @param manager Entry point to HorizonDbManager. + */ + public static void + listOperationsForMicrosoftHorizonDb(com.azure.resourcemanager.horizondb.HorizonDbManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClusterParameterGroupConnectionPropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClusterParameterGroupConnectionPropertiesTests.java new file mode 100644 index 000000000000..a41271c68b5e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbClusterParameterGroupConnectionPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbClusterParameterGroupConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbClusterParameterGroupConnectionProperties model + = BinaryData.fromString("{\"id\":\"abifpikxwczbys\",\"syncStatus\":\"pqxu\",\"applyImmediately\":false}") + .toObject(HorizonDbClusterParameterGroupConnectionProperties.class); + Assertions.assertEquals("abifpikxwczbys", model.id()); + Assertions.assertFalse(model.applyImmediately()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbClusterParameterGroupConnectionProperties model + = new HorizonDbClusterParameterGroupConnectionProperties().withId("abifpikxwczbys") + .withApplyImmediately(false); + model = BinaryData.fromObject(model).toObject(HorizonDbClusterParameterGroupConnectionProperties.class); + Assertions.assertEquals("abifpikxwczbys", model.id()); + Assertions.assertFalse(model.applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleInnerTests.java new file mode 100644 index 000000000000..4324c6fcb37b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleInnerTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbFirewallRuleInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbFirewallRuleInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbFirewallRuleInner model = BinaryData.fromString( + "{\"properties\":{\"startIpAddress\":\"swjdkirso\",\"endIpAddress\":\"dqxhcrmnohjtckwh\",\"description\":\"oifiyipjxsqwpgr\",\"provisioningState\":\"InProgress\"},\"id\":\"orcjxvsnby\",\"name\":\"qabnmoc\",\"type\":\"cyshurzafbljjgp\"}") + .toObject(HorizonDbFirewallRuleInner.class); + Assertions.assertEquals("swjdkirso", model.properties().startIpAddress()); + Assertions.assertEquals("dqxhcrmnohjtckwh", model.properties().endIpAddress()); + Assertions.assertEquals("oifiyipjxsqwpgr", model.properties().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbFirewallRuleInner model = new HorizonDbFirewallRuleInner() + .withProperties(new HorizonDbFirewallRuleProperties().withStartIpAddress("swjdkirso") + .withEndIpAddress("dqxhcrmnohjtckwh") + .withDescription("oifiyipjxsqwpgr")); + model = BinaryData.fromObject(model).toObject(HorizonDbFirewallRuleInner.class); + Assertions.assertEquals("swjdkirso", model.properties().startIpAddress()); + Assertions.assertEquals("dqxhcrmnohjtckwh", model.properties().endIpAddress()); + Assertions.assertEquals("oifiyipjxsqwpgr", model.properties().description()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleListResultTests.java new file mode 100644 index 000000000000..99cdba5b0964 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRuleListResultTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbFirewallRuleListResult; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbFirewallRuleListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbFirewallRuleListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"startIpAddress\":\"fepgzgq\",\"endIpAddress\":\"xzlocxscp\",\"description\":\"erhhbcsglumm\",\"provisioningState\":\"Canceled\"},\"id\":\"aodxo\",\"name\":\"nbdxk\",\"type\":\"pxokajionp\"}],\"nextLink\":\"ex\"}") + .toObject(HorizonDbFirewallRuleListResult.class); + Assertions.assertEquals("fepgzgq", model.value().get(0).properties().startIpAddress()); + Assertions.assertEquals("xzlocxscp", model.value().get(0).properties().endIpAddress()); + Assertions.assertEquals("erhhbcsglumm", model.value().get(0).properties().description()); + Assertions.assertEquals("ex", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulePropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulePropertiesTests.java new file mode 100644 index 000000000000..3747914c9f8c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulePropertiesTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbFirewallRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbFirewallRuleProperties model = BinaryData.fromString( + "{\"startIpAddress\":\"toqcjmklja\",\"endIpAddress\":\"bqidtqaj\",\"description\":\"ulpkudjkrl\",\"provisioningState\":\"Canceled\"}") + .toObject(HorizonDbFirewallRuleProperties.class); + Assertions.assertEquals("toqcjmklja", model.startIpAddress()); + Assertions.assertEquals("bqidtqaj", model.endIpAddress()); + Assertions.assertEquals("ulpkudjkrl", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbFirewallRuleProperties model = new HorizonDbFirewallRuleProperties().withStartIpAddress("toqcjmklja") + .withEndIpAddress("bqidtqaj") + .withDescription("ulpkudjkrl"); + model = BinaryData.fromObject(model).toObject(HorizonDbFirewallRuleProperties.class); + Assertions.assertEquals("toqcjmklja", model.startIpAddress()); + Assertions.assertEquals("bqidtqaj", model.endIpAddress()); + Assertions.assertEquals("ulpkudjkrl", model.description()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..73a311fc4f9f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesCreateOrUpdateMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRule; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRuleProperties; +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 HorizonDbFirewallRulesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"startIpAddress\":\"washr\",\"endIpAddress\":\"dtkcnqxwbpokulp\",\"description\":\"jwaa\",\"provisioningState\":\"Succeeded\"},\"id\":\"i\",\"name\":\"obyu\",\"type\":\"erpqlpqwcciuqg\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbFirewallRule response = manager.horizonDbFirewallRules() + .define("tddckcb") + .withExistingPool("smocmbq", "qvmkcxo", "apvhelxprgly") + .withProperties(new HorizonDbFirewallRuleProperties().withStartIpAddress("ejrjxgciqibrho") + .withEndIpAddress("xsdqrhzoymibmrqy") + .withDescription("ahwfluszdtmhrk")) + .create(); + + Assertions.assertEquals("washr", response.properties().startIpAddress()); + Assertions.assertEquals("dtkcnqxwbpokulp", response.properties().endIpAddress()); + Assertions.assertEquals("jwaa", response.properties().description()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetWithResponseMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetWithResponseMockTests.java new file mode 100644 index 000000000000..682ea10395a6 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesGetWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRule; +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 HorizonDbFirewallRulesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"startIpAddress\":\"keqdcvdrhvoods\",\"endIpAddress\":\"tbobz\",\"description\":\"pcjwv\",\"provisioningState\":\"Failed\"},\"id\":\"d\",\"name\":\"mgxcxrslpm\",\"type\":\"twuoegrpkhjwni\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbFirewallRule response = manager.horizonDbFirewallRules() + .getWithResponse("hdlxyjrxsagafcn", "hgw", "apnedgfbcvkc", "q", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("keqdcvdrhvoods", response.properties().startIpAddress()); + Assertions.assertEquals("tbobz", response.properties().endIpAddress()); + Assertions.assertEquals("pcjwv", response.properties().description()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListMockTests.java new file mode 100644 index 000000000000..9fb8842e046c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbFirewallRulesListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbFirewallRule; +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 HorizonDbFirewallRulesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"startIpAddress\":\"hrfou\",\"endIpAddress\":\"ft\",\"description\":\"kcpwiy\",\"provisioningState\":\"InProgress\"},\"id\":\"mnubexkpzksmond\",\"name\":\"mquxvypo\",\"type\":\"gkopkwhojvpajqgx\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.horizonDbFirewallRules() + .list("qsluicp", "ggkzzlvmbmpa", "modfvuefywsbpfvm", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("hrfou", response.iterator().next().properties().startIpAddress()); + Assertions.assertEquals("ft", response.iterator().next().properties().endIpAddress()); + Assertions.assertEquals("kcpwiy", response.iterator().next().properties().description()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesInnerTests.java new file mode 100644 index 000000000000..4aea3703d285 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupConnectionPropertiesInner; + +public final class HorizonDbParameterGroupConnectionPropertiesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupConnectionPropertiesInner model + = BinaryData.fromString("{\"name\":\"gylgqgitxmedjvcs\",\"id\":\"n\",\"type\":\"wncwzzhxgktrmg\"}") + .toObject(HorizonDbParameterGroupConnectionPropertiesInner.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesListResultTests.java new file mode 100644 index 000000000000..eda2fb206566 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupConnectionPropertiesListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbParameterGroupConnectionPropertiesListResult; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbParameterGroupConnectionPropertiesListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupConnectionPropertiesListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"uwaboekqvke\",\"id\":\"smv\",\"type\":\"wyjsflhhcaalnjix\"},{\"name\":\"xyawj\",\"id\":\"aq\",\"type\":\"lyjpk\"},{\"name\":\"dzyexznelixh\",\"id\":\"ztfolhbnxk\",\"type\":\"laulppg\"}],\"nextLink\":\"tpnapnyiropuhpig\"}") + .toObject(HorizonDbParameterGroupConnectionPropertiesListResult.class); + Assertions.assertEquals("tpnapnyiropuhpig", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupForPatchUpdateTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupForPatchUpdateTests.java new file mode 100644 index 000000000000..26963ad1f3f4 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupForPatchUpdateTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbParameterGroupForPatchUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupForPatchUpdate model = BinaryData.fromString( + "{\"tags\":{\"nbtkcxywnytnr\":\"pbh\"},\"properties\":{\"parameters\":[{\"name\":\"idybyxczf\",\"description\":\"haaxdbabphl\",\"value\":\"qlfktsths\",\"dataType\":\"ocmnyyazttbtwwrq\",\"allowedValues\":\"edckzywbiexzfey\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"xujwbhqwalmuzyo\",\"unit\":\"epdkzja\"},{\"name\":\"ux\",\"description\":\"d\",\"value\":\"avxbniwdjswztsdb\",\"dataType\":\"nxytxh\",\"allowedValues\":\"xbzpfzab\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"wtctyqi\",\"unit\":\"bbovplwzbhvgyugu\"}],\"description\":\"vmkfssxqu\",\"applyImmediately\":false}}") + .toObject(HorizonDbParameterGroupForPatchUpdate.class); + Assertions.assertEquals("pbh", model.tags().get("nbtkcxywnytnr")); + Assertions.assertEquals("idybyxczf", model.properties().parameters().get(0).name()); + Assertions.assertEquals("qlfktsths", model.properties().parameters().get(0).value()); + Assertions.assertEquals("vmkfssxqu", model.properties().description()); + Assertions.assertFalse(model.properties().applyImmediately()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbParameterGroupForPatchUpdate model = new HorizonDbParameterGroupForPatchUpdate() + .withTags(mapOf("nbtkcxywnytnr", "pbh")) + .withProperties(new HorizonDbParameterGroupPropertiesForPatchUpdate() + .withParameters(Arrays.asList(new ParameterProperties().withName("idybyxczf").withValue("qlfktsths"), + new ParameterProperties().withName("ux").withValue("avxbniwdjswztsdb"))) + .withDescription("vmkfssxqu") + .withApplyImmediately(false)); + model = BinaryData.fromObject(model).toObject(HorizonDbParameterGroupForPatchUpdate.class); + Assertions.assertEquals("pbh", model.tags().get("nbtkcxywnytnr")); + Assertions.assertEquals("idybyxczf", model.properties().parameters().get(0).name()); + Assertions.assertEquals("qlfktsths", model.properties().parameters().get(0).value()); + Assertions.assertEquals("vmkfssxqu", model.properties().description()); + Assertions.assertFalse(model.properties().applyImmediately()); + } + + // 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/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupInnerTests.java new file mode 100644 index 000000000000..a8b905df5da1 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupInnerTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbParameterGroupInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbParameterGroupInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupInner model = BinaryData.fromString( + "{\"properties\":{\"parameters\":[{\"name\":\"vleggzfbuhfmvfax\",\"description\":\"feiithlvmez\",\"value\":\"shxmzsbbzoggigrx\",\"dataType\":\"ur\",\"allowedValues\":\"xxjnspydptk\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"knvudwtiukb\",\"unit\":\"ngkpocipazy\"},{\"name\":\"egukgjnpiucg\",\"description\":\"evqzntypmrbp\",\"value\":\"c\",\"dataType\":\"qjsdpydnfyhxdeo\",\"allowedValues\":\"zi\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"ttgzfbis\",\"unit\":\"bkh\"}],\"description\":\"deyeamdphagalpbu\",\"pgVersion\":605545221,\"version\":9013568,\"applyImmediately\":true,\"provisioningState\":\"Provisioning\"},\"location\":\"wkgshwa\",\"tags\":{\"rywn\":\"xzbinjeputt\",\"lwh\":\"zoqftiyqzrnkcqvy\",\"ryavwhheunmmqh\":\"lsicohoqqnwv\",\"noc\":\"yxzk\"},\"id\":\"koklya\",\"name\":\"uconuqszfkbey\",\"type\":\"ewrmjmwvvjektc\"}") + .toObject(HorizonDbParameterGroupInner.class); + Assertions.assertEquals("wkgshwa", model.location()); + Assertions.assertEquals("xzbinjeputt", model.tags().get("rywn")); + Assertions.assertEquals("vleggzfbuhfmvfax", model.properties().parameters().get(0).name()); + Assertions.assertEquals("shxmzsbbzoggigrx", model.properties().parameters().get(0).value()); + Assertions.assertEquals("deyeamdphagalpbu", model.properties().description()); + Assertions.assertEquals(605545221, model.properties().pgVersion()); + Assertions.assertTrue(model.properties().applyImmediately()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbParameterGroupInner model = new HorizonDbParameterGroupInner().withLocation("wkgshwa") + .withTags(mapOf("rywn", "xzbinjeputt", "lwh", "zoqftiyqzrnkcqvy", "ryavwhheunmmqh", "lsicohoqqnwv", "noc", + "yxzk")) + .withProperties(new HorizonDbParameterGroupProperties() + .withParameters( + Arrays.asList(new ParameterProperties().withName("vleggzfbuhfmvfax").withValue("shxmzsbbzoggigrx"), + new ParameterProperties().withName("egukgjnpiucg").withValue("c"))) + .withDescription("deyeamdphagalpbu") + .withPgVersion(605545221) + .withApplyImmediately(true)); + model = BinaryData.fromObject(model).toObject(HorizonDbParameterGroupInner.class); + Assertions.assertEquals("wkgshwa", model.location()); + Assertions.assertEquals("xzbinjeputt", model.tags().get("rywn")); + Assertions.assertEquals("vleggzfbuhfmvfax", model.properties().parameters().get(0).name()); + Assertions.assertEquals("shxmzsbbzoggigrx", model.properties().parameters().get(0).value()); + Assertions.assertEquals("deyeamdphagalpbu", model.properties().description()); + Assertions.assertEquals(605545221, model.properties().pgVersion()); + Assertions.assertTrue(model.properties().applyImmediately()); + } + + // 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/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupListResultTests.java new file mode 100644 index 000000000000..367683b85b41 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupListResultTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbParameterGroupListResult; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbParameterGroupListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"parameters\":[{\"name\":\"xuutkncwscwsv\",\"description\":\"otogtwrupqs\",\"value\":\"nmic\",\"dataType\":\"vce\",\"allowedValues\":\"eil\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"fj\",\"unit\":\"njbkcnxdhbttkph\"},{\"name\":\"pnvjtoqnermclf\",\"description\":\"phoxus\",\"value\":\"pabgyeps\",\"dataType\":\"tazqugxywpmueefj\",\"allowedValues\":\"fqkquj\",\"isDynamic\":true,\"isReadOnly\":false,\"documentationLink\":\"nobglaocq\",\"unit\":\"ccm\"},{\"name\":\"udxytlmoyrx\",\"description\":\"fudwpznt\",\"value\":\"dzhlrq\",\"dataType\":\"hckfrlhrx\",\"allowedValues\":\"kyv\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"z\",\"unit\":\"zka\"}],\"description\":\"uwbc\",\"pgVersion\":946722582,\"version\":1666097242,\"applyImmediately\":false,\"provisioningState\":\"Provisioning\"},\"location\":\"yvjusrtslhsp\",\"tags\":{\"elmqk\":\"emaofmxagkvt\",\"hcdhmdual\":\"hahvljuahaq\",\"vfadmws\":\"exq\",\"lf\":\"crgvxpvgom\"},\"id\":\"isgwbnbbeldawkz\",\"name\":\"ali\",\"type\":\"urqhaka\"},{\"properties\":{\"parameters\":[{\"name\":\"sfwxosowzxc\",\"description\":\"i\",\"value\":\"ooxdjebwpuc\",\"dataType\":\"fvovbvmeuecivy\",\"allowedValues\":\"ce\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"wjue\",\"unit\":\"twm\"},{\"name\":\"ytdxwit\",\"description\":\"rjaw\",\"value\":\"wgxhn\",\"dataType\":\"kxfbkpycgklwndn\",\"allowedValues\":\"dauwhvylwzbtd\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"bm\",\"unit\":\"wuwprzqlv\"},{\"name\":\"alupjm\",\"description\":\"fxobbcsws\",\"value\":\"jriplrbpbewtghf\",\"dataType\":\"lcgwxzvlvqh\",\"allowedValues\":\"begibtnmxiebwwa\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"gwrtzju\",\"unit\":\"wyzmhtxon\"},{\"name\":\"ts\",\"description\":\"jcbpwxqpsrknft\",\"value\":\"vriuhprwmdyvx\",\"dataType\":\"ayriwwroyqbexrm\",\"allowedValues\":\"ibycno\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"fqsgzvahapjy\",\"unit\":\"pvgqzcjrvxdjzlm\"}],\"description\":\"xkvugfhzov\",\"pgVersion\":1008490621,\"version\":1089613815,\"applyImmediately\":false,\"provisioningState\":\"Failed\"},\"location\":\"hnnpr\",\"tags\":{\"tskzbbtdzumveek\":\"peilpjzuaejxdu\"},\"id\":\"pwo\",\"name\":\"uh\",\"type\":\"fpbsjyofdxl\"}],\"nextLink\":\"sd\"}") + .toObject(HorizonDbParameterGroupListResult.class); + Assertions.assertEquals("yvjusrtslhsp", model.value().get(0).location()); + Assertions.assertEquals("emaofmxagkvt", model.value().get(0).tags().get("elmqk")); + Assertions.assertEquals("xuutkncwscwsv", model.value().get(0).properties().parameters().get(0).name()); + Assertions.assertEquals("nmic", model.value().get(0).properties().parameters().get(0).value()); + Assertions.assertEquals("uwbc", model.value().get(0).properties().description()); + Assertions.assertEquals(946722582, model.value().get(0).properties().pgVersion()); + Assertions.assertFalse(model.value().get(0).properties().applyImmediately()); + Assertions.assertEquals("sd", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesForPatchUpdateTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesForPatchUpdateTests.java new file mode 100644 index 000000000000..5a4e419b3463 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesForPatchUpdateTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbParameterGroupPropertiesForPatchUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupPropertiesForPatchUpdate model = BinaryData.fromString( + "{\"parameters\":[{\"name\":\"mg\",\"description\":\"nkjzkdeslpvlop\",\"value\":\"yighxpk\",\"dataType\":\"zb\",\"allowedValues\":\"uebbaumnyqup\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"a\",\"unit\":\"khsmtxpsiebt\"}],\"description\":\"vpesapskrdqmhjjd\",\"applyImmediately\":true}") + .toObject(HorizonDbParameterGroupPropertiesForPatchUpdate.class); + Assertions.assertEquals("mg", model.parameters().get(0).name()); + Assertions.assertEquals("yighxpk", model.parameters().get(0).value()); + Assertions.assertEquals("vpesapskrdqmhjjd", model.description()); + Assertions.assertTrue(model.applyImmediately()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbParameterGroupPropertiesForPatchUpdate model = new HorizonDbParameterGroupPropertiesForPatchUpdate() + .withParameters(Arrays.asList(new ParameterProperties().withName("mg").withValue("yighxpk"))) + .withDescription("vpesapskrdqmhjjd") + .withApplyImmediately(true); + model = BinaryData.fromObject(model).toObject(HorizonDbParameterGroupPropertiesForPatchUpdate.class); + Assertions.assertEquals("mg", model.parameters().get(0).name()); + Assertions.assertEquals("yighxpk", model.parameters().get(0).value()); + Assertions.assertEquals("vpesapskrdqmhjjd", model.description()); + Assertions.assertTrue(model.applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesTests.java new file mode 100644 index 000000000000..450a10cbc9c2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupPropertiesTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbParameterGroupPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbParameterGroupProperties model = BinaryData.fromString( + "{\"parameters\":[{\"name\":\"hwlrsf\",\"description\":\"zpwv\",\"value\":\"dqgbiqylihkaetc\",\"dataType\":\"vfcivfsnkymuc\",\"allowedValues\":\"hjfbebrjcxe\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"ttxfvjr\",\"unit\":\"rp\"},{\"name\":\"epcyvahfnlj\",\"description\":\"qxj\",\"value\":\"ujqgidok\",\"dataType\":\"ljyoxgvcltb\",\"allowedValues\":\"ncghkje\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"jhtxfvgxbfsmxne\",\"unit\":\"pvecxgodeb\"}],\"description\":\"kk\",\"pgVersion\":1961052031,\"version\":1171229778,\"applyImmediately\":false,\"provisioningState\":\"InProgress\"}") + .toObject(HorizonDbParameterGroupProperties.class); + Assertions.assertEquals("hwlrsf", model.parameters().get(0).name()); + Assertions.assertEquals("dqgbiqylihkaetc", model.parameters().get(0).value()); + Assertions.assertEquals("kk", model.description()); + Assertions.assertEquals(1961052031, model.pgVersion()); + Assertions.assertFalse(model.applyImmediately()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbParameterGroupProperties model = new HorizonDbParameterGroupProperties() + .withParameters(Arrays.asList(new ParameterProperties().withName("hwlrsf").withValue("dqgbiqylihkaetc"), + new ParameterProperties().withName("epcyvahfnlj").withValue("ujqgidok"))) + .withDescription("kk") + .withPgVersion(1961052031) + .withApplyImmediately(false); + model = BinaryData.fromObject(model).toObject(HorizonDbParameterGroupProperties.class); + Assertions.assertEquals("hwlrsf", model.parameters().get(0).name()); + Assertions.assertEquals("dqgbiqylihkaetc", model.parameters().get(0).value()); + Assertions.assertEquals("kk", model.description()); + Assertions.assertEquals(1961052031, model.pgVersion()); + Assertions.assertFalse(model.applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..0dd27aef714d --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsCreateOrUpdateMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupProperties; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HorizonDbParameterGroupsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"parameters\":[{\"name\":\"kyhkobopg\",\"description\":\"dkow\",\"value\":\"bqpc\",\"dataType\":\"kbwcc\",\"allowedValues\":\"jvcdwxlpqekf\",\"isDynamic\":false,\"isReadOnly\":false,\"documentationLink\":\"syingwfqatmtdht\",\"unit\":\"vypgikdg\"},{\"name\":\"ywkbirryuzhlhkjo\",\"description\":\"vqqaatjinrvgo\",\"value\":\"mfiibfggj\",\"dataType\":\"olvrw\",\"allowedValues\":\"v\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"qwjygvja\",\"unit\":\"blmhvkzuhb\"},{\"name\":\"vyhgs\",\"description\":\"byrqufeg\",\"value\":\"vwz\",\"dataType\":\"nhlmctlpdng\",\"allowedValues\":\"vgbmhr\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"ijejvegrhbpn\",\"unit\":\"xexccbdreaxhcexd\"}],\"description\":\"vqahqkghtpwi\",\"pgVersion\":205565987,\"version\":1759061120,\"applyImmediately\":false,\"provisioningState\":\"Succeeded\"},\"location\":\"xzb\",\"tags\":{\"ronzmyhgfip\":\"owvrvmtgjqppyos\",\"waekrrjreafxtsgu\":\"sxkm\"},\"id\":\"hjglikk\",\"name\":\"wslolbqp\",\"type\":\"uzlm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbParameterGroup response = manager.horizonDbParameterGroups() + .define("rgz") + .withRegion("sccyajguqf") + .withExistingResourceGroup("rjqc") + .withTags(mapOf("emdwzrmuhapfc", "gzlvdnkfxu")) + .withProperties(new HorizonDbParameterGroupProperties() + .withParameters( + Arrays.asList(new ParameterProperties().withName("zszrnwoiindfpw").withValue("vfbgofeljagrqmqh"), + new ParameterProperties().withName("wspughftqsxhqx").withValue("uufzdmsyqtfihw"))) + .withDescription("p") + .withPgVersion(219155482) + .withApplyImmediately(true)) + .create(); + + Assertions.assertEquals("xzb", response.location()); + Assertions.assertEquals("owvrvmtgjqppyos", response.tags().get("ronzmyhgfip")); + Assertions.assertEquals("kyhkobopg", response.properties().parameters().get(0).name()); + Assertions.assertEquals("bqpc", response.properties().parameters().get(0).value()); + Assertions.assertEquals("vqahqkghtpwi", response.properties().description()); + Assertions.assertEquals(205565987, response.properties().pgVersion()); + Assertions.assertFalse(response.properties().applyImmediately()); + } + + // 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/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupWithResponseMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..2e0d5f77c219 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsGetByResourceGroupWithResponseMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +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 HorizonDbParameterGroupsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"parameters\":[{\"name\":\"uhpkxkgymar\",\"description\":\"n\",\"value\":\"xqugjhkycubedd\",\"dataType\":\"sofwqmzqalkrmnji\",\"allowedValues\":\"xacqqudfnbyx\",\"isDynamic\":true,\"isReadOnly\":false,\"documentationLink\":\"yvayffimrzr\",\"unit\":\"zqogse\"},{\"name\":\"evfdnwnwm\",\"description\":\"zsyyceuzso\",\"value\":\"judpfrxt\",\"dataType\":\"hzv\",\"allowedValues\":\"tdwkqbrq\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"exiili\",\"unit\":\"dtiirqt\"}],\"description\":\"oaxoruzfgsqu\",\"pgVersion\":1674082550,\"version\":1000095286,\"applyImmediately\":false,\"provisioningState\":\"Canceled\"},\"location\":\"ramxjezwlwnw\",\"tags\":{\"atdooaojkniod\":\"lcvydy\",\"bw\":\"oo\"},\"id\":\"ujhemmsbvdkcrodt\",\"name\":\"infwjlfltkacjve\",\"type\":\"kdlfoa\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbParameterGroup response = manager.horizonDbParameterGroups() + .getByResourceGroupWithResponse("wdmjsjqbjhhyx", "rw", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ramxjezwlwnw", response.location()); + Assertions.assertEquals("lcvydy", response.tags().get("atdooaojkniod")); + Assertions.assertEquals("uhpkxkgymar", response.properties().parameters().get(0).name()); + Assertions.assertEquals("xqugjhkycubedd", response.properties().parameters().get(0).value()); + Assertions.assertEquals("oaxoruzfgsqu", response.properties().description()); + Assertions.assertEquals(1674082550, response.properties().pgVersion()); + Assertions.assertFalse(response.properties().applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..4e2585d5a346 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListByResourceGroupMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +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 HorizonDbParameterGroupsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"parameters\":[{\"name\":\"lsyxkqjnsjervt\",\"description\":\"gxsds\",\"value\":\"e\",\"dataType\":\"sbzkf\",\"allowedValues\":\"eyvpnqicvinvkj\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"uukzclewyhmlw\",\"unit\":\"ztzp\"}],\"description\":\"ncckw\",\"pgVersion\":2069096730,\"version\":407754161,\"applyImmediately\":false,\"provisioningState\":\"Canceled\"},\"location\":\"yq\",\"tags\":{\"or\":\"feqztppriol\",\"ncwsob\":\"altol\",\"pfuvglsbjjca\":\"wcsdbnwdcfhucq\"},\"id\":\"vxb\",\"name\":\"t\",\"type\":\"udutnco\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.horizonDbParameterGroups().listByResourceGroup("ggkfpagaowpul", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("yq", response.iterator().next().location()); + Assertions.assertEquals("feqztppriol", response.iterator().next().tags().get("or")); + Assertions.assertEquals("lsyxkqjnsjervt", response.iterator().next().properties().parameters().get(0).name()); + Assertions.assertEquals("e", response.iterator().next().properties().parameters().get(0).value()); + Assertions.assertEquals("ncckw", response.iterator().next().properties().description()); + Assertions.assertEquals(2069096730, response.iterator().next().properties().pgVersion()); + Assertions.assertFalse(response.iterator().next().properties().applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsMockTests.java new file mode 100644 index 000000000000..b602382c6973 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListConnectionsMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroupConnectionProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HorizonDbParameterGroupsListConnectionsMockTests { + @Test + public void testListConnections() throws Exception { + String responseStr = "{\"value\":[{\"name\":\"maequiahxicslfa\",\"id\":\"z\",\"type\":\"yylhalnswhccsp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.horizonDbParameterGroups().listConnections("l", "zqhof", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListMockTests.java new file mode 100644 index 000000000000..6346bbbb551e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +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 HorizonDbParameterGroupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"parameters\":[{\"name\":\"qtvcofudflvkgj\",\"description\":\"gdknnqv\",\"value\":\"znqntoru\",\"dataType\":\"gsahmkycgrauw\",\"allowedValues\":\"etaebu\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"vsmzlxwab\",\"unit\":\"oefki\"},{\"name\":\"vtpuqujmqlgk\",\"description\":\"tndoaongbjc\",\"value\":\"ujitcjedftww\",\"dataType\":\"zkoj\",\"allowedValues\":\"c\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"uicybxarzgszuf\",\"unit\":\"ciqopidoa\"},{\"name\":\"iodhkhazxkhnz\",\"description\":\"nlwntoe\",\"value\":\"kdwbwhkszz\",\"dataType\":\"rvexztvb\",\"allowedValues\":\"gsfraoyzkoow\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"xawqaldsyuuxim\",\"unit\":\"qfobwyz\"}],\"description\":\"bykutw\",\"pgVersion\":1229081734,\"version\":237488555,\"applyImmediately\":false,\"provisioningState\":\"Canceled\"},\"location\":\"kdsnfdsdoakgtdl\",\"tags\":{\"l\":\"zev\",\"ejdcngqqmoakuf\":\"ewpusdsttwvogvb\",\"zr\":\"m\",\"enuuzkopbm\":\"rdgrtw\"},\"id\":\"nrfdw\",\"name\":\"yuhhziu\",\"type\":\"efozbhdms\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.horizonDbParameterGroups().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("kdsnfdsdoakgtdl", response.iterator().next().location()); + Assertions.assertEquals("zev", response.iterator().next().tags().get("l")); + Assertions.assertEquals("qtvcofudflvkgj", response.iterator().next().properties().parameters().get(0).name()); + Assertions.assertEquals("znqntoru", response.iterator().next().properties().parameters().get(0).value()); + Assertions.assertEquals("bykutw", response.iterator().next().properties().description()); + Assertions.assertEquals(1229081734, response.iterator().next().properties().pgVersion()); + Assertions.assertFalse(response.iterator().next().properties().applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsMockTests.java new file mode 100644 index 000000000000..77d9dcd6ea21 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbParameterGroupsListVersionsMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbParameterGroup; +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 HorizonDbParameterGroupsListVersionsMockTests { + @Test + public void testListVersions() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"parameters\":[{\"name\":\"ai\",\"description\":\"brgz\",\"value\":\"msweypqwdxggicc\",\"dataType\":\"xqhuexm\",\"allowedValues\":\"tlstvlzywem\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"dtclusiypb\",\"unit\":\"gytguslfead\"},{\"name\":\"gq\",\"description\":\"yhejhzisxgfp\",\"value\":\"olppvksrpqvujz\",\"dataType\":\"ehtwdwrft\",\"allowedValues\":\"iby\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"shfwpracstwity\",\"unit\":\"evxccedcp\"},{\"name\":\"dyodnwzxltj\",\"description\":\"nhltiugcxn\",\"value\":\"vwxqibyqunyo\",\"dataType\":\"wlmdjrkv\",\"allowedValues\":\"bvfvpdbod\",\"isDynamic\":true,\"isReadOnly\":false,\"documentationLink\":\"q\",\"unit\":\"krribdeibqi\"},{\"name\":\"kghv\",\"description\":\"dzwmkrefajpj\",\"value\":\"wkqnyhg\",\"dataType\":\"j\",\"allowedValues\":\"ivfxzsjabibsyst\",\"isDynamic\":true,\"isReadOnly\":true,\"documentationLink\":\"pvkvpbjxbk\",\"unit\":\"zkdvncja\"}],\"description\":\"durgkakmokz\",\"pgVersion\":523614486,\"version\":615814676,\"applyImmediately\":false,\"provisioningState\":\"Provisioning\"},\"location\":\"uwqlgzrfzeey\",\"tags\":{\"ayuhqlbjbsy\":\"zi\",\"pgvmpipaslthaqfx\":\"bqwrvtldgm\",\"hneuyowqkd\":\"smwutwbdsrezpd\"},\"id\":\"ytisibir\",\"name\":\"gpikpzimejza\",\"type\":\"lfzxiavrmbzonoki\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.horizonDbParameterGroups() + .listVersions("kaivwit", "scywuggwoluhc", 219242582, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("uwqlgzrfzeey", response.iterator().next().location()); + Assertions.assertEquals("zi", response.iterator().next().tags().get("ayuhqlbjbsy")); + Assertions.assertEquals("ai", response.iterator().next().properties().parameters().get(0).name()); + Assertions.assertEquals("msweypqwdxggicc", response.iterator().next().properties().parameters().get(0).value()); + Assertions.assertEquals("durgkakmokz", response.iterator().next().properties().description()); + Assertions.assertEquals(523614486, response.iterator().next().properties().pgVersion()); + Assertions.assertFalse(response.iterator().next().properties().applyImmediately()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolInnerTests.java new file mode 100644 index 000000000000..7d20ae68bd29 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPoolInner; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbPoolInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbPoolInner model = BinaryData.fromString( + "{\"properties\":{\"location\":\"wyahuxinpmqnja\",\"state\":\"Healthy\",\"replicaCount\":1052966015,\"version\":\"prozvcputegjvwmf\",\"createMode\":\"Create\",\"provisioningState\":\"Failed\"},\"tags\":{\"kjozkrwfnd\":\"vpjhulsuuv\",\"vwryoqpso\":\"odjpslwejd\",\"yffdfdos\":\"cctazakljlahbc\",\"hcrzevd\":\"gexpaojakhmsbz\"},\"id\":\"lxaolthqtrgqjbp\",\"name\":\"zfsinzgvf\",\"type\":\"jrwzox\"}") + .toObject(HorizonDbPoolInner.class); + Assertions.assertEquals("wyahuxinpmqnja", model.properties().location()); + Assertions.assertEquals("vpjhulsuuv", model.tags().get("kjozkrwfnd")); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolListResultTests.java new file mode 100644 index 000000000000..347371119102 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolListResultTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbPoolListResult; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbPoolListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbPoolListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"location\":\"pini\",\"state\":\"Disabled\",\"replicaCount\":861239752,\"version\":\"ybb\",\"createMode\":\"Update\",\"provisioningState\":\"Canceled\"},\"tags\":{\"zxtheotusivyevcc\":\"oginuvamiheognar\",\"nhungbw\":\"qi\",\"gxg\":\"zrnf\"},\"id\":\"pemvtzfkufubljof\",\"name\":\"qeof\",\"type\":\"aeqjhqjbasvms\"},{\"properties\":{\"location\":\"ulngsntn\",\"state\":\"Stopped\",\"replicaCount\":1557726477,\"version\":\"cwrwclxxwrljdous\",\"createMode\":\"Create\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"wtnhxbnjbiksqr\":\"rcjd\"},\"id\":\"ssainqpjwnzll\",\"name\":\"fmppe\",\"type\":\"bvmgxsabkyqduuji\"},{\"properties\":{\"location\":\"czdzev\",\"state\":\"Dropping\",\"replicaCount\":2049933545,\"version\":\"pdappds\",\"createMode\":\"Update\",\"provisioningState\":\"Provisioning\"},\"tags\":{\"tjelt\":\"jfeusnh\",\"hugjzzdatqxhoc\":\"rl\",\"ozwyiftyhxhuro\":\"geablgphuticndvk\",\"wcukjfkgiawxk\":\"ftyxolniw\"},\"id\":\"ypl\",\"name\":\"ckbasyypndd\",\"type\":\"sgcbac\"}],\"nextLink\":\"ejk\"}") + .toObject(HorizonDbPoolListResult.class); + Assertions.assertEquals("pini", model.value().get(0).properties().location()); + Assertions.assertEquals("oginuvamiheognar", model.value().get(0).tags().get("zxtheotusivyevcc")); + Assertions.assertEquals("ejk", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolPropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolPropertiesTests.java new file mode 100644 index 000000000000..bd0082ade0ce --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolPropertiesTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbPoolProperties; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbPoolPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbPoolProperties model = BinaryData.fromString( + "{\"location\":\"tfell\",\"state\":\"Disabled\",\"replicaCount\":348508366,\"version\":\"onpeqfpjkjlxofp\",\"createMode\":\"Create\",\"provisioningState\":\"Failed\"}") + .toObject(HorizonDbPoolProperties.class); + Assertions.assertEquals("tfell", model.location()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetWithResponseMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetWithResponseMockTests.java new file mode 100644 index 000000000000..29735aa684d9 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbPool; +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 HorizonDbPoolsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"location\":\"uvwbhsqfs\",\"state\":\"Stopping\",\"replicaCount\":540005244,\"version\":\"irx\",\"createMode\":\"Update\",\"provisioningState\":\"Canceled\"},\"tags\":{\"twss\":\"bjf\",\"tpvjzbexilzznfqq\":\"t\",\"taruoujmkcj\":\"vwpm\",\"ervnaenqpehi\":\"wqytjrybnwjewgdr\"},\"id\":\"oygmift\",\"name\":\"nzdndslgna\",\"type\":\"qig\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbPool response = manager.horizonDbPools() + .getWithResponse("pe", "wwfbkrvrnsvshq", "ohxcrsbfova", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("uvwbhsqfs", response.properties().location()); + Assertions.assertEquals("bjf", response.tags().get("twss")); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListMockTests.java new file mode 100644 index 000000000000..4318a67f4ec5 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPoolsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbPool; +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 HorizonDbPoolsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"location\":\"ertgccymva\",\"state\":\"Stopping\",\"replicaCount\":10940345,\"version\":\"qlfmmdnbb\",\"createMode\":\"Update\",\"provisioningState\":\"Canceled\"},\"tags\":{\"bzmnvdfznud\":\"ydmcwyhzdxssa\",\"xzb\":\"od\",\"dzu\":\"cblylpstdbhhxsr\"},\"id\":\"rsc\",\"name\":\"ntnev\",\"type\":\"iwjmygtdssls\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.horizonDbPools().list("nduhavhqlkthum", "qolbgyc", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ertgccymva", response.iterator().next().properties().location()); + Assertions.assertEquals("ydmcwyhzdxssa", response.iterator().next().tags().get("bzmnvdfznud")); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..f175e9ff35ee --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +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 HorizonDbPrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"kkpwdreqnovvq\",\"ovljxywsu\"],\"privateEndpoint\":{\"id\":\"rsndsytgadgvra\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"e\",\"actionsRequired\":\"zar\"},\"provisioningState\":\"Failed\"},\"id\":\"uu\",\"name\":\"jfqka\",\"type\":\"e\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnectionResource response = manager.horizonDbPrivateEndpointConnections() + .getWithResponse("dbutauvfbtkuwhh", "hykojoxafnndlpic", "koymkcd", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("e", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("zar", response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListMockTests.java new file mode 100644 index 000000000000..20a1345e0a93 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsListMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +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 HorizonDbPrivateEndpointConnectionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupIds\":[\"vpuvks\",\"plsaknynfsynljph\",\"op\",\"odlqiyntor\"],\"privateEndpoint\":{\"id\":\"leosjswsrms\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"pzbchck\",\"actionsRequired\":\"zqioxiysuii\"},\"provisioningState\":\"Failed\"},\"id\":\"edyatrwyhqmibzyh\",\"name\":\"itsmypyyn\",\"type\":\"cdpu\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.horizonDbPrivateEndpointConnections() + .list("iipfpubj", "bwwift", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.iterator().next().properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("pzbchck", + response.iterator().next().properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("zqioxiysuii", + response.iterator().next().properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateMockTests.java new file mode 100644 index 000000000000..65b89f6b362f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateEndpointConnectionsUpdateMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.OptionalPropertiesUpdateableProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpoint; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnection; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState; +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 HorizonDbPrivateEndpointConnectionsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"gjltdtbnnhado\",\"crkvcikhnv\",\"amqgxqquezikyw\",\"gxk\"],\"privateEndpoint\":{\"id\":\"atmelwui\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"jzkzi\",\"actionsRequired\":\"vvcnayr\"},\"provisioningState\":\"Succeeded\"},\"id\":\"xxmueedn\",\"name\":\"rdvstkwqqtch\",\"type\":\"alm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.horizonDbPrivateEndpointConnections() + .update("nzgmwznmabik", "sorgj", + new PrivateEndpointConnectionUpdate().withProperties( + new OptionalPropertiesUpdateableProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("ok") + .withActionsRequired("llxdyhgs"))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("jzkzi", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("vvcnayr", response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..635768e17f3b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbPrivateLinkResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbPrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbPrivateLinkResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupId\":\"asxazjpqyegualhb\",\"requiredMembers\":[\"e\",\"jzzvdud\"],\"requiredZoneNames\":[\"slfhotwm\",\"ynpwlbj\",\"pgacftadehxnlty\"]},\"id\":\"oppusuesnzw\",\"name\":\"ej\",\"type\":\"avo\"}") + .toObject(HorizonDbPrivateLinkResourceInner.class); + Assertions.assertEquals("slfhotwm", model.properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceListResultTests.java new file mode 100644 index 000000000000..c827343d8c7c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourceListResultTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbPrivateLinkResourceListResult; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbPrivateLinkResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbPrivateLinkResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"yexfwh\",\"requiredMembers\":[\"i\",\"vyvdcs\",\"tynnaamdectehfi\",\"scjeypv\"],\"requiredZoneNames\":[\"rkgqhcjrefo\",\"gm\",\"qsl\",\"yyvxyqjpkcattpn\"]},\"id\":\"cr\",\"name\":\"czsqpjhvm\",\"type\":\"ajvnysounqe\"},{\"properties\":{\"groupId\":\"oaeupfhyhltrpmo\",\"requiredMembers\":[\"cma\",\"u\",\"kthfui\",\"aodsfcpkv\"],\"requiredZoneNames\":[\"puozmyzydag\",\"uaxbezyiuokkt\"]},\"id\":\"rdxwzywqsm\",\"name\":\"surex\",\"type\":\"moryocfsfksym\"},{\"properties\":{\"groupId\":\"stkiiuxhqyud\",\"requiredMembers\":[\"rq\",\"b\",\"oczvy\",\"fqrvkdvjsllrmvvd\"],\"requiredZoneNames\":[\"t\",\"pnpulexxbczwtru\"]},\"id\":\"qzbqjvsov\",\"name\":\"yokacspkw\",\"type\":\"hzdobpxjmflbvvnc\"},{\"properties\":{\"groupId\":\"cciw\",\"requiredMembers\":[\"uqkhrsajiwku\"],\"requiredZoneNames\":[\"skghsauuimj\"]},\"id\":\"xieduugidyjrr\",\"name\":\"byao\",\"type\":\"v\"}],\"nextLink\":\"csonpclhoco\"}") + .toObject(HorizonDbPrivateLinkResourceListResult.class); + Assertions.assertEquals("rkgqhcjrefo", model.value().get(0).properties().requiredZoneNames().get(0)); + Assertions.assertEquals("csonpclhoco", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetWithResponseMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..3d613cbf17f1 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateLinkResource; +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 HorizonDbPrivateLinkResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"xepxgyqagvrvmn\",\"requiredMembers\":[\"kghimdblxgwimfnj\",\"fjxwmsz\",\"kfoqreyfkzikfj\"],\"requiredZoneNames\":[\"eaivxwczel\"]},\"id\":\"irels\",\"name\":\"eae\",\"type\":\"wabfatkl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbPrivateLinkResource response = manager.horizonDbPrivateLinkResources() + .getWithResponse("mtdaa", "gdv", "vgpiohgwxrt", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("eaivxwczel", response.properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListMockTests.java new file mode 100644 index 000000000000..8fcd3c5df07b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbPrivateLinkResourcesListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbPrivateLinkResource; +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 HorizonDbPrivateLinkResourcesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"vimjwos\",\"requiredMembers\":[\"itc\"],\"requiredZoneNames\":[\"cktqumiekkezzi\",\"hlyfjhdgqgg\",\"bdunygaeqid\"]},\"id\":\"fatpxllrxcyjmoa\",\"name\":\"su\",\"type\":\"arm\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.horizonDbPrivateLinkResources() + .list("dxbjhwuaanozj", "sphyoulpjrvxa", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("cktqumiekkezzi", response.iterator().next().properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaForPatchUpdateTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaForPatchUpdateTests.java new file mode 100644 index 000000000000..09eaec68dfc2 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaForPatchUpdateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbReplicaForPatchUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbReplicaForPatchUpdate model = BinaryData.fromString("{\"properties\":{\"role\":\"ReadWrite\"}}") + .toObject(HorizonDbReplicaForPatchUpdate.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.properties().role()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbReplicaForPatchUpdate model = new HorizonDbReplicaForPatchUpdate() + .withProperties(new HorizonDbReplicaPropertiesForPatchUpdate().withRole(ReplicaRole.READ_WRITE)); + model = BinaryData.fromObject(model).toObject(HorizonDbReplicaForPatchUpdate.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.properties().role()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaInnerTests.java new file mode 100644 index 000000000000..632998c1e3d1 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaInnerTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.HorizonDbReplicaInner; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbReplicaInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbReplicaInner model = BinaryData.fromString( + "{\"properties\":{\"role\":\"ReadWrite\",\"status\":\"Dropping\",\"fullyQualifiedDomainName\":\"ulzndlikwyqk\",\"availabilityZone\":\"gibma\",\"provisioningState\":\"Canceled\"},\"id\":\"eqsrxybzqqedqyt\",\"name\":\"ciqfou\",\"type\":\"lmmnkzsmodmglo\"}") + .toObject(HorizonDbReplicaInner.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.properties().role()); + Assertions.assertEquals("gibma", model.properties().availabilityZone()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbReplicaInner model = new HorizonDbReplicaInner().withProperties( + new HorizonDbReplicaProperties().withRole(ReplicaRole.READ_WRITE).withAvailabilityZone("gibma")); + model = BinaryData.fromObject(model).toObject(HorizonDbReplicaInner.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.properties().role()); + Assertions.assertEquals("gibma", model.properties().availabilityZone()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaListResultTests.java new file mode 100644 index 000000000000..3f31138063be --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaListResultTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.HorizonDbReplicaListResult; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbReplicaListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbReplicaListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"role\":\"ReadWrite\",\"status\":\"Disabled\",\"fullyQualifiedDomainName\":\"bmdg\",\"availabilityZone\":\"jfddgmbmbe\",\"provisioningState\":\"InProgress\"},\"id\":\"htqqrolfp\",\"name\":\"psalgbqux\",\"type\":\"gjyjgzjaoyfhrtxi\"},{\"properties\":{\"role\":\"Read\",\"status\":\"Starting\",\"fullyQualifiedDomainName\":\"ysvlejuvf\",\"availabilityZone\":\"wrlyxwjkcprb\",\"provisioningState\":\"Provisioning\"},\"id\":\"gjvtbv\",\"name\":\"ysszdnrujqguh\",\"type\":\"uouq\"},{\"properties\":{\"role\":\"ReadWrite\",\"status\":\"Stopped\",\"fullyQualifiedDomainName\":\"nguitnwuizgazxu\",\"availabilityZone\":\"zuckyfi\",\"provisioningState\":\"Failed\"},\"id\":\"dfvzwdzuhty\",\"name\":\"wisdkft\",\"type\":\"wxmnteiwao\"},{\"properties\":{\"role\":\"ReadWrite\",\"status\":\"Updating\",\"fullyQualifiedDomainName\":\"mmxdcu\",\"availabilityZone\":\"fsrpymzidnse\",\"provisioningState\":\"Failed\"},\"id\":\"bzsgfyccsne\",\"name\":\"mdwzjeiachboo\",\"type\":\"flnrosfqpteehzz\"}],\"nextLink\":\"pyqr\"}") + .toObject(HorizonDbReplicaListResult.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.value().get(0).properties().role()); + Assertions.assertEquals("jfddgmbmbe", model.value().get(0).properties().availabilityZone()); + Assertions.assertEquals("pyqr", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesForPatchUpdateTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesForPatchUpdateTests.java new file mode 100644 index 000000000000..a178deb9396f --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesForPatchUpdateTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbReplicaPropertiesForPatchUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbReplicaPropertiesForPatchUpdate model = BinaryData.fromString("{\"role\":\"ReadWrite\"}") + .toObject(HorizonDbReplicaPropertiesForPatchUpdate.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.role()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbReplicaPropertiesForPatchUpdate model + = new HorizonDbReplicaPropertiesForPatchUpdate().withRole(ReplicaRole.READ_WRITE); + model = BinaryData.fromObject(model).toObject(HorizonDbReplicaPropertiesForPatchUpdate.class); + Assertions.assertEquals(ReplicaRole.READ_WRITE, model.role()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesTests.java new file mode 100644 index 000000000000..882af2f0d56c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicaPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +import org.junit.jupiter.api.Assertions; + +public final class HorizonDbReplicaPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HorizonDbReplicaProperties model = BinaryData.fromString( + "{\"role\":\"Read\",\"status\":\"Healthy\",\"fullyQualifiedDomainName\":\"tmut\",\"availabilityZone\":\"qktapspwgcuert\",\"provisioningState\":\"Canceled\"}") + .toObject(HorizonDbReplicaProperties.class); + Assertions.assertEquals(ReplicaRole.READ, model.role()); + Assertions.assertEquals("qktapspwgcuert", model.availabilityZone()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HorizonDbReplicaProperties model + = new HorizonDbReplicaProperties().withRole(ReplicaRole.READ).withAvailabilityZone("qktapspwgcuert"); + model = BinaryData.fromObject(model).toObject(HorizonDbReplicaProperties.class); + Assertions.assertEquals(ReplicaRole.READ, model.role()); + Assertions.assertEquals("qktapspwgcuert", model.availabilityZone()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..8d604b73c516 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasCreateOrUpdateMockTests.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.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplicaProperties; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +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 HorizonDbReplicasCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"role\":\"Read\",\"status\":\"Disabled\",\"fullyQualifiedDomainName\":\"dsjnka\",\"availabilityZone\":\"utiiswacf\",\"provisioningState\":\"Succeeded\"},\"id\":\"zzewkfvhqcrai\",\"name\":\"vpnpp\",\"type\":\"uflrwd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbReplica response = manager.horizonDbReplicas() + .define("bmnzbtbhjpgl") + .withExistingPool("u", "lauwzizxbmpgcjef", "zmuvpbttdumorppx") + .withProperties(new HorizonDbReplicaProperties().withRole(ReplicaRole.READ).withAvailabilityZone("hsd")) + .create(); + + Assertions.assertEquals(ReplicaRole.READ, response.properties().role()); + Assertions.assertEquals("utiiswacf", response.properties().availabilityZone()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetWithResponseMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetWithResponseMockTests.java new file mode 100644 index 000000000000..5f05a2c69a43 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasGetWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +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 HorizonDbReplicasGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"role\":\"Read\",\"status\":\"Stopped\",\"fullyQualifiedDomainName\":\"bmwmbesldnkw\",\"availabilityZone\":\"pp\",\"provisioningState\":\"InProgress\"},\"id\":\"xogaokonzmnsikv\",\"name\":\"kqze\",\"type\":\"qkdltfz\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HorizonDbReplica response = manager.horizonDbReplicas() + .getWithResponse("tmweriofzpyq", "emwabnet", "hhszh", "d", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(ReplicaRole.READ, response.properties().role()); + Assertions.assertEquals("pp", response.properties().availabilityZone()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListMockTests.java new file mode 100644 index 000000000000..a502ab16e06a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/HorizonDbReplicasListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.HorizonDbReplica; +import com.azure.resourcemanager.horizondb.models.ReplicaRole; +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 HorizonDbReplicasListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"role\":\"ReadWrite\",\"status\":\"Stopping\",\"fullyQualifiedDomainName\":\"kzgxhurip\",\"availabilityZone\":\"podxunkb\",\"provisioningState\":\"Provisioning\"},\"id\":\"ubyyntw\",\"name\":\"rbqtkoie\",\"type\":\"seotgqrllt\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.horizonDbReplicas() + .list("mhhv", "gureodkwobdag", "tibqdxbxwakb", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(ReplicaRole.READ_WRITE, response.iterator().next().properties().role()); + Assertions.assertEquals("podxunkb", response.iterator().next().properties().availabilityZone()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/NetworkTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/NetworkTests.java new file mode 100644 index 000000000000..6dcfbe374728 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/NetworkTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.Network; + +public final class NetworkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Network model = BinaryData.fromString("{\"publicNetworkAccess\":\"Disabled\"}").toObject(Network.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Network model = new Network(); + model = BinaryData.fromObject(model).toObject(Network.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationDisplayTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..320547db1cbe --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationInnerTests.java new file mode 100644 index 000000000000..3a608cb931df --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationListResultTests.java new file mode 100644 index 000000000000..3c7cba372eb8 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationsListMockTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..57628a22e2ec --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.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.horizondb.HorizonDbManager; +import com.azure.resourcemanager.horizondb.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"napkteoellw\",\"isDataAction\":true,\"display\":{\"provider\":\"gpfqbuace\",\"resource\":\"zfq\",\"operation\":\"huaoppp\",\"description\":\"eqx\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HorizonDbManager manager = HorizonDbManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OptionalPropertiesUpdateablePropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OptionalPropertiesUpdateablePropertiesTests.java new file mode 100644 index 000000000000..7c71f744413a --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/OptionalPropertiesUpdateablePropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.OptionalPropertiesUpdateableProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpoint; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class OptionalPropertiesUpdateablePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OptionalPropertiesUpdateableProperties model = BinaryData.fromString( + "{\"privateEndpoint\":{\"id\":\"ivkwlzuvccfwnfnb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"nlebxetqgtzxd\",\"actionsRequired\":\"qbqqwxr\"}}") + .toObject(OptionalPropertiesUpdateableProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("nlebxetqgtzxd", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("qbqqwxr", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OptionalPropertiesUpdateableProperties model + = new OptionalPropertiesUpdateableProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("nlebxetqgtzxd") + .withActionsRequired("qbqqwxr")); + model = BinaryData.fromObject(model).toObject(OptionalPropertiesUpdateableProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("nlebxetqgtzxd", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("qbqqwxr", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/ParameterPropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/ParameterPropertiesTests.java new file mode 100644 index 000000000000..942ceec76118 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/ParameterPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.ParameterProperties; +import org.junit.jupiter.api.Assertions; + +public final class ParameterPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ParameterProperties model = BinaryData.fromString( + "{\"name\":\"flz\",\"description\":\"bxzpuzycisp\",\"value\":\"zahmgkbrpyydhibn\",\"dataType\":\"qkpikadrgvtqagnb\",\"allowedValues\":\"nhijggmebfsi\",\"isDynamic\":false,\"isReadOnly\":true,\"documentationLink\":\"cvpnazzmhjrunmpx\",\"unit\":\"dbhrbnlankxm\"}") + .toObject(ParameterProperties.class); + Assertions.assertEquals("flz", model.name()); + Assertions.assertEquals("zahmgkbrpyydhibn", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ParameterProperties model = new ParameterProperties().withName("flz").withValue("zahmgkbrpyydhibn"); + model = BinaryData.fromObject(model).toObject(ParameterProperties.class); + Assertions.assertEquals("flz", model.name()); + Assertions.assertEquals("zahmgkbrpyydhibn", model.value()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..c644ba8e528b --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionInnerTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"groupIds\":[\"llnwsubi\"],\"privateEndpoint\":{\"id\":\"ampmngnz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"qwoochcbon\",\"actionsRequired\":\"pkvlrxn\"},\"provisioningState\":\"Succeeded\"},\"id\":\"eipheoflokeyy\",\"name\":\"enjbdlwtgrhp\",\"type\":\"jp\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("qwoochcbon", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("pkvlrxn", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..030477a466e0 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionPropertiesTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"groupIds\":[\"jnxqbzvddntwn\",\"eic\",\"twnpzaoqvuhrhcf\"],\"privateEndpoint\":{\"id\":\"ddglm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qkwpyeicxmqc\",\"actionsRequired\":\"q\"},\"provisioningState\":\"Failed\"}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("qkwpyeicxmqc", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("q", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceInnerTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceInnerTests.java new file mode 100644 index 000000000000..8950ab0bec1c --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceInnerTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupIds\":[\"gcpo\"],\"privateEndpoint\":{\"id\":\"aajrm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"zrlovmclwhijcoej\",\"actionsRequired\":\"bzaqsqsycbkbfk\"},\"provisioningState\":\"Creating\"},\"id\":\"kexxppof\",\"name\":\"xaxcfjpgddtocjjx\",\"type\":\"vpmouexhdzxib\"}") + .toObject(PrivateEndpointConnectionResourceInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("zrlovmclwhijcoej", + model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("bzaqsqsycbkbfk", + model.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceListResultTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceListResultTests.java new file mode 100644 index 000000000000..f502d9b6860e --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionResourceListResultTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.implementation.models.PrivateEndpointConnectionResourceListResult; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupIds\":[\"z\",\"yvvtpgvdfgio\"],\"privateEndpoint\":{\"id\":\"tutqxlngxlefgug\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"xdqmidtthzrvqdra\",\"actionsRequired\":\"jybige\"},\"provisioningState\":\"Creating\"},\"id\":\"bowsk\",\"name\":\"nyktzlcuiy\",\"type\":\"gqywgndrv\"}],\"nextLink\":\"hzgpphrcgyncocpe\"}") + .toObject(PrivateEndpointConnectionResourceListResult.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.value().get(0).properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xdqmidtthzrvqdra", + model.value().get(0).properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("jybige", + model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("hzgpphrcgyncocpe", model.nextLink()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionUpdateTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionUpdateTests.java new file mode 100644 index 000000000000..ef8ba602f244 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointConnectionUpdateTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.OptionalPropertiesUpdateableProperties; +import com.azure.resourcemanager.horizondb.models.PrivateEndpoint; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointConnectionUpdate; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionUpdate model = BinaryData.fromString( + "{\"properties\":{\"privateEndpoint\":{\"id\":\"mcoo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"evgbmqjq\",\"actionsRequired\":\"c\"}}}") + .toObject(PrivateEndpointConnectionUpdate.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("evgbmqjq", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("c", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionUpdate model + = new PrivateEndpointConnectionUpdate() + .withProperties(new OptionalPropertiesUpdateableProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("evgbmqjq") + .withActionsRequired("c"))); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionUpdate.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("evgbmqjq", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("c", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..e56bb6542903 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateEndpointTests.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.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.PrivateEndpoint; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"ixuigdtopbobj\"}").toObject(PrivateEndpoint.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint(); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkResourcePropertiesTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkResourcePropertiesTests.java new file mode 100644 index 000000000000..940f4f8f8b51 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkResourcePropertiesTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.PrivateLinkResourceProperties; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceProperties model = BinaryData.fromString( + "{\"groupId\":\"zdmohctbqvu\",\"requiredMembers\":[\"dndnvow\"],\"requiredZoneNames\":[\"jugwdkcglhsl\",\"zj\",\"yggdtjixh\",\"kuofqweykhme\"]}") + .toObject(PrivateLinkResourceProperties.class); + Assertions.assertEquals("jugwdkcglhsl", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..22b7ff365115 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/src/test/java/com/azure/resourcemanager/horizondb/generated/PrivateLinkServiceConnectionStateTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.horizondb.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.horizondb.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.horizondb.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkServiceConnectionState model + = BinaryData.fromString("{\"status\":\"Approved\",\"description\":\"e\",\"actionsRequired\":\"a\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("e", model.description()); + Assertions.assertEquals("a", model.actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkServiceConnectionState model + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("e") + .withActionsRequired("a"); + model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("e", model.description()); + Assertions.assertEquals("a", model.actionsRequired()); + } +} diff --git a/sdk/horizondb/azure-resourcemanager-horizondb/tsp-location.yaml b/sdk/horizondb/azure-resourcemanager-horizondb/tsp-location.yaml new file mode 100644 index 000000000000..fe9da6a788f7 --- /dev/null +++ b/sdk/horizondb/azure-resourcemanager-horizondb/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb +commit: f6e1fbd6268be7712bf96a516ba846f7d42e2baa +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/horizondb/ci.yml b/sdk/horizondb/ci.yml new file mode 100644 index 000000000000..cab871ace1b5 --- /dev/null +++ b/sdk/horizondb/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/horizondb/ci.yml + - sdk/horizondb/azure-resourcemanager-horizondb/ + exclude: + - sdk/horizondb/pom.xml + - sdk/horizondb/azure-resourcemanager-horizondb/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/horizondb/ci.yml + - sdk/horizondb/azure-resourcemanager-horizondb/ + exclude: + - sdk/horizondb/pom.xml + - sdk/horizondb/azure-resourcemanager-horizondb/pom.xml + +parameters: + - name: release_azureresourcemanagerhorizondb + displayName: azure-resourcemanager-horizondb + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: horizondb + Artifacts: + - name: azure-resourcemanager-horizondb + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhorizondb + releaseInBatch: ${{ parameters.release_azureresourcemanagerhorizondb }} diff --git a/sdk/horizondb/pom.xml b/sdk/horizondb/pom.xml new file mode 100644 index 000000000000..cc9ac5b2d15b --- /dev/null +++ b/sdk/horizondb/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-horizondb-service + pom + 1.0.0 + + + azure-resourcemanager-horizondb + +