diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 8e04955187aa6..9fd396b200a03 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -324,6 +324,7 @@ com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.1;1.0.0-b
com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0.0-beta.2
+com.azure.resourcemanager:azure-resourcemanager-postgresqlhsc;1.0.0-beta.1;1.0.0-beta.1
com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
diff --git a/pom.xml b/pom.xml
index bf7a714e06c42..07435d1f22f9e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -804,6 +804,7 @@
sdk/policyinsightssdk/postgresqlsdk/postgresqlflexibleserver
+ sdk/postgresqlhscsdk/powerbidedicatedsdk/purviewsdk/quantum
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/CHANGELOG.md b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/CHANGELOG.md
new file mode 100644
index 0000000000000..66e90afced14f
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 1.0.0-beta.1 (2021-12-10)
+
+- Azure Resource Manager postgresqlhsc client library for Java. This package contains Microsoft Azure SDK for postgresqlhsc Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations. Package tag package-2020-10-05-privatepreview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/README.md b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/README.md
new file mode 100644
index 0000000000000..90ff8775383ad
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/README.md
@@ -0,0 +1,102 @@
+# Azure Resource Manager postgresqlhsc client library for Java
+
+Azure Resource Manager postgresqlhsc client library for Java.
+
+This package contains Microsoft Azure SDK for postgresqlhsc Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations. Package tag package-2020-10-05-privatepreview. 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-postgresqlhsc;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-postgresqlhsc
+ 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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
+
+### Authentication
+
+By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
+
+- `AZURE_CLIENT_ID` for Azure client ID.
+- `AZURE_TENANT_ID` for Azure tenant ID.
+- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+
+In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
+
+With above configuration, `azure` client can be authenticated by following code:
+
+```java
+AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+TokenCredential credential = new DefaultAzureCredentialBuilder()
+ .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
+ .build();
+PostgresqlhscManager manager = PostgresqlhscManager
+ .authenticate(credential, profile);
+```
+
+The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` 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/postgresqlhsc/azure-resourcemanager-postgresqlhsc/SAMPLE.md)
+
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://docs.microsoft.com/java/azure/jdk/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
+[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
+[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
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/SAMPLE.md b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/SAMPLE.md
new file mode 100644
index 0000000000000..e758f7d43b89e
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/SAMPLE.md
@@ -0,0 +1,827 @@
+# Code snippets and samples
+
+
+## Configurations
+
+- [Get](#configurations_get)
+- [ListByServer](#configurations_listbyserver)
+- [ListByServerGroup](#configurations_listbyservergroup)
+- [Update](#configurations_update)
+
+## FirewallRules
+
+- [CreateOrUpdate](#firewallrules_createorupdate)
+- [Delete](#firewallrules_delete)
+- [Get](#firewallrules_get)
+- [ListByServerGroup](#firewallrules_listbyservergroup)
+
+## Operations
+
+- [List](#operations_list)
+
+## Roles
+
+- [Create](#roles_create)
+- [Delete](#roles_delete)
+- [ListByServerGroup](#roles_listbyservergroup)
+
+## ServerGroups
+
+- [CheckNameAvailability](#servergroups_checknameavailability)
+- [CreateOrUpdate](#servergroups_createorupdate)
+- [Delete](#servergroups_delete)
+- [GetByResourceGroup](#servergroups_getbyresourcegroup)
+- [List](#servergroups_list)
+- [ListByResourceGroup](#servergroups_listbyresourcegroup)
+- [Restart](#servergroups_restart)
+- [Start](#servergroups_start)
+- [Stop](#servergroups_stop)
+- [Update](#servergroups_update)
+
+## Servers
+
+- [Get](#servers_get)
+- [ListByServerGroup](#servers_listbyservergroup)
+### Configurations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Configurations Get. */
+public final class ConfigurationsGetSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ConfigurationGet.json
+ */
+ /**
+ * Sample code: Get single configuration of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void getSingleConfigurationOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.configurations().getWithResponse("TestResourceGroup", "hsctestsg", "array_nulls", Context.NONE);
+ }
+}
+```
+
+### Configurations_ListByServer
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Configurations ListByServer. */
+public final class ConfigurationsListByServerSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ConfigurationListByServer.json
+ */
+ /**
+ * Sample code: List configurations of the server that in the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listConfigurationsOfTheServerThatInTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.configurations().listByServer("TestResourceGroup", "hsctestsg", "testserver", Context.NONE);
+ }
+}
+```
+
+### Configurations_ListByServerGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Configurations ListByServerGroup. */
+public final class ConfigurationsListByServerGroupSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ConfigurationListByServerGroup.json
+ */
+ /**
+ * Sample code: List configurations of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listConfigurationsOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.configurations().listByServerGroup("TestResourceGroup", "hsctestsg", Context.NONE);
+ }
+}
+```
+
+### Configurations_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerGroupConfigurationInner;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRole;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroupConfiguration;
+import java.util.Arrays;
+
+/** Samples for Configurations Update. */
+public final class ConfigurationsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ConfigurationUpdate.json
+ */
+ /**
+ * Sample code: Update single configuration of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void updateSingleConfigurationOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .configurations()
+ .update(
+ "TestResourceGroup",
+ "hsctestsg",
+ "array_nulls",
+ new ServerGroupConfigurationInner()
+ .withServerRoleGroupConfigurations(
+ Arrays
+ .asList(
+ new ServerRoleGroupConfiguration().withRole(ServerRole.COORDINATOR).withValue("on"),
+ new ServerRoleGroupConfiguration().withRole(ServerRole.WORKER).withValue("off"))),
+ Context.NONE);
+ }
+}
+```
+
+### FirewallRules_CreateOrUpdate
+
+```java
+/** Samples for FirewallRules CreateOrUpdate. */
+public final class FirewallRulesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/FirewallRuleCreate.json
+ */
+ /**
+ * Sample code: Create a firewall rule of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void createAFirewallRuleOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .firewallRules()
+ .define("rule1")
+ .withExistingServerGroupsv2("TestGroup", "pgtestsvc4")
+ .withStartIpAddress("0.0.0.0")
+ .withEndIpAddress("255.255.255.255")
+ .create();
+ }
+}
+```
+
+### FirewallRules_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallRules Delete. */
+public final class FirewallRulesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/FirewallRuleDelete.json
+ */
+ /**
+ * Sample code: Delete the firewall rule of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void deleteTheFirewallRuleOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.firewallRules().delete("TestGroup", "pgtestsvc4", "rule1", Context.NONE);
+ }
+}
+```
+
+### FirewallRules_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallRules Get. */
+public final class FirewallRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/FirewallRuleGet.json
+ */
+ /**
+ * Sample code: Get the firewall rule of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void getTheFirewallRuleOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.firewallRules().getWithResponse("TestGroup", "pgtestsvc4", "rule1", Context.NONE);
+ }
+}
+```
+
+### FirewallRules_ListByServerGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for FirewallRules ListByServerGroup. */
+public final class FirewallRulesListByServerGroupSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/FirewallRuleListByServerGroup.json
+ */
+ /**
+ * Sample code: List firewall rules of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listFirewallRulesOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.firewallRules().listByServerGroup("TestGroup", "pgtestsvc4", Context.NONE);
+ }
+}
+```
+
+### Operations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/OperationList.json
+ */
+ /**
+ * Sample code: List all available operations.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listAllAvailableOperations(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.operations().list(Context.NONE);
+ }
+}
+```
+
+### Roles_Create
+
+```java
+/** Samples for Roles Create. */
+public final class RolesCreateSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/RoleCreate.json
+ */
+ /**
+ * Sample code: RoleCreate.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void roleCreate(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .roles()
+ .define("role1")
+ .withExistingServerGroupsv2("TestGroup", "pgtestsvc4")
+ .withPassword("secret")
+ .create();
+ }
+}
+```
+
+### Roles_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Roles Delete. */
+public final class RolesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/RoleDelete.json
+ */
+ /**
+ * Sample code: RoleDelete.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void roleDelete(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.roles().delete("TestGroup", "pgtestsvc4", "role1", Context.NONE);
+ }
+}
+```
+
+### Roles_ListByServerGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Roles ListByServerGroup. */
+public final class RolesListByServerGroupSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/RoleListByServerGroup.json
+ */
+ /**
+ * Sample code: RoleList.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void roleList(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.roles().listByServerGroup("TestGroup", "pgtestsvc4", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_CheckNameAvailability
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlhsc.models.NameAvailabilityRequest;
+
+/** Samples for ServerGroups CheckNameAvailability. */
+public final class ServerGroupsCheckNameAvailabilitySamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/CheckNameAvailability.json
+ */
+ /**
+ * Sample code: Check name availability.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void checkNameAvailability(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .serverGroups()
+ .checkNameAvailabilityWithResponse(new NameAvailabilityRequest().withName("name1"), Context.NONE);
+ }
+}
+```
+
+### ServerGroups_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.postgresqlhsc.models.CitusVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.CreateMode;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerEdition;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupPropertiesDelegatedSubnetArguments;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupPropertiesPrivateDnsZoneArguments;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRole;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroup;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ServerGroups CreateOrUpdate. */
+public final class ServerGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupCreateReadReplica.json
+ */
+ /**
+ * Sample code: Create a new server group as a read replica.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void createANewServerGroupAsAReadReplica(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .serverGroups()
+ .define("hsctestsg")
+ .withRegion("westus")
+ .withExistingResourceGroup("TestGroup")
+ .withCreateMode(CreateMode.READ_REPLICA)
+ .withSourceSubscriptionId("dddddddd-dddd-dddd-dddd-dddddddddddd")
+ .withSourceResourceGroupName("SourceGroup")
+ .withSourceServerGroupName("pgtests-source-server-group")
+ .withSourceLocation("eastus")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupCreate.json
+ */
+ /**
+ * Sample code: Create a new server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void createANewServerGroup(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .serverGroups()
+ .define("hsctestsg")
+ .withRegion("westus")
+ .withExistingResourceGroup("TestGroup")
+ .withTags(mapOf("ElasticServer", "1"))
+ .withAdministratorLogin("citus")
+ .withAdministratorLoginPassword("password")
+ .withBackupRetentionDays(35)
+ .withPostgresqlVersion(PostgreSqlVersion.ONE_TWO)
+ .withCitusVersion(CitusVersion.NINE_FIVE)
+ .withEnableMx(true)
+ .withEnableZfs(false)
+ .withServerRoleGroups(
+ Arrays
+ .asList(
+ new ServerRoleGroup()
+ .withServerEdition(ServerEdition.GENERAL_PURPOSE)
+ .withStorageQuotaInMb(524288L)
+ .withVCores(4L)
+ .withEnableHa(true)
+ .withName("")
+ .withRole(ServerRole.COORDINATOR)
+ .withServerCount(1),
+ new ServerRoleGroup()
+ .withServerEdition(ServerEdition.MEMORY_OPTIMIZED)
+ .withStorageQuotaInMb(524288L)
+ .withVCores(4L)
+ .withEnableHa(false)
+ .withName("")
+ .withRole(ServerRole.WORKER)
+ .withServerCount(3)))
+ .withAvailabilityZone("1")
+ .withStandbyAvailabilityZone("2")
+ .withDelegatedSubnetArguments(
+ new ServerGroupPropertiesDelegatedSubnetArguments()
+ .withSubnetArmResourceId(
+ "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"))
+ .withPrivateDnsZoneArguments(
+ new ServerGroupPropertiesPrivateDnsZoneArguments()
+ .withPrivateDnsZoneArmResourceId(
+ "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupCreatePITR.json
+ */
+ /**
+ * Sample code: Create a new server group as a point in time restore.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void createANewServerGroupAsAPointInTimeRestore(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager
+ .serverGroups()
+ .define("hsctestsg")
+ .withRegion("westus")
+ .withExistingResourceGroup("TestGroup")
+ .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE)
+ .withEnableMx(true)
+ .withEnableZfs(false)
+ .withSourceSubscriptionId("dddddddd-dddd-dddd-dddd-dddddddddddd")
+ .withSourceResourceGroupName("SourceGroup")
+ .withSourceServerGroupName("pgtests-source-server-group")
+ .withSourceLocation("eastus")
+ .withPointInTimeUtc(OffsetDateTime.parse("2017-12-14T00:00:37.467Z"))
+ .create();
+ }
+
+ @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;
+ }
+}
+```
+
+### ServerGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups Delete. */
+public final class ServerGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupDelete.json
+ */
+ /**
+ * Sample code: Delete the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void deleteTheServerGroup(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().delete("TestGroup", "testservergroup", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups GetByResourceGroup. */
+public final class ServerGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupGet.json
+ */
+ /**
+ * Sample code: Get the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void getTheServerGroup(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().getByResourceGroupWithResponse("TestGroup", "hsctestsg1", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups List. */
+public final class ServerGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupList.json
+ */
+ /**
+ * Sample code: List all the server groups.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listAllTheServerGroups(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().list(Context.NONE);
+ }
+}
+```
+
+### ServerGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups ListByResourceGroup. */
+public final class ServerGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupListByResourceGroup.json
+ */
+ /**
+ * Sample code: List the server groups by resource group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listTheServerGroupsByResourceGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().listByResourceGroup("TestGroup", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_Restart
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups Restart. */
+public final class ServerGroupsRestartSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupRestart.json
+ */
+ /**
+ * Sample code: Restart all servers in the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void restartAllServersInTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().restart("TestGroup", "hsctestsg1", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_Start
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups Start. */
+public final class ServerGroupsStartSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupStart.json
+ */
+ /**
+ * Sample code: Start all servers in the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void startAllServersInTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().start("TestGroup", "hsctestsg1", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_Stop
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ServerGroups Stop. */
+public final class ServerGroupsStopSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupStop.json
+ */
+ /**
+ * Sample code: Stop all servers in the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void stopAllServersInTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.serverGroups().stop("TestGroup", "hsctestsg1", Context.NONE);
+ }
+}
+```
+
+### ServerGroups_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlhsc.models.MaintenanceWindow;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerEdition;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroup;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRole;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroup;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ServerGroups Update. */
+public final class ServerGroupsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupScaleStorage.json
+ */
+ /**
+ * Sample code: Scale storage.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void scaleStorage(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ ServerGroup resource =
+ manager.serverGroups().getByResourceGroupWithResponse("TestGroup", "hsctestsg", Context.NONE).getValue();
+ resource
+ .update()
+ .withServerRoleGroups(
+ Arrays
+ .asList(
+ new ServerRoleGroup().withStorageQuotaInMb(8388608L).withName("").withRole(ServerRole.WORKER)))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupAddNode.json
+ */
+ /**
+ * Sample code: Add new worker nodes.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void addNewWorkerNodes(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ ServerGroup resource =
+ manager.serverGroups().getByResourceGroupWithResponse("TestGroup", "hsctestsg", Context.NONE).getValue();
+ resource
+ .update()
+ .withServerRoleGroups(
+ Arrays.asList(new ServerRoleGroup().withName("").withRole(ServerRole.WORKER).withServerCount(10)))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupUpdateMaintenanceWindow.json
+ */
+ /**
+ * Sample code: Update customer maintenance window.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void updateCustomerMaintenanceWindow(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ ServerGroup resource =
+ manager.serverGroups().getByResourceGroupWithResponse("TestGroup", "hsctestsg", Context.NONE).getValue();
+ resource
+ .update()
+ .withMaintenanceWindow(
+ new MaintenanceWindow()
+ .withCustomWindow("Enabled")
+ .withStartHour(8)
+ .withStartMinute(0)
+ .withDayOfWeek(0))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupScaleCompute.json
+ */
+ /**
+ * Sample code: Scale compute.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void scaleCompute(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ ServerGroup resource =
+ manager.serverGroups().getByResourceGroupWithResponse("TestGroup", "hsctestsg", Context.NONE).getValue();
+ resource
+ .update()
+ .withServerRoleGroups(
+ Arrays.asList(new ServerRoleGroup().withVCores(16L).withName("").withRole(ServerRole.COORDINATOR)))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupUpdate.json
+ */
+ /**
+ * Sample code: Update the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void updateTheServerGroup(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ ServerGroup resource =
+ manager.serverGroups().getByResourceGroupWithResponse("TestGroup", "hsctestsg", Context.NONE).getValue();
+ resource
+ .update()
+ .withTags(mapOf("ElasticServer", "2"))
+ .withAdministratorLoginPassword("secret")
+ .withBackupRetentionDays(30)
+ .withPostgresqlVersion(PostgreSqlVersion.ONE_TWO)
+ .withServerRoleGroups(
+ Arrays
+ .asList(
+ new ServerRoleGroup()
+ .withServerEdition(ServerEdition.GENERAL_PURPOSE)
+ .withStorageQuotaInMb(1048576L)
+ .withVCores(8L)
+ .withEnableHa(false)
+ .withName("")
+ .withRole(ServerRole.COORDINATOR)
+ .withServerCount(1),
+ new ServerRoleGroup()
+ .withServerEdition(ServerEdition.MEMORY_OPTIMIZED)
+ .withStorageQuotaInMb(524288L)
+ .withVCores(4L)
+ .withEnableHa(true)
+ .withName("")
+ .withRole(ServerRole.WORKER)
+ .withServerCount(4)))
+ .apply();
+ }
+
+ @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;
+ }
+}
+```
+
+### Servers_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Servers Get. */
+public final class ServersGetSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGet.json
+ */
+ /**
+ * Sample code: Get the server of server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void getTheServerOfServerGroup(com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.servers().getWithResponse("TestGroup", "hsctestsg1", "hsctestsg1-c", Context.NONE);
+ }
+}
+```
+
+### Servers_ListByServerGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Servers ListByServerGroup. */
+public final class ServersListByServerGroupSamples {
+ /*
+ * x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerListByServerGroup.json
+ */
+ /**
+ * Sample code: List servers of the server group.
+ *
+ * @param manager Entry point to PostgresqlhscManager.
+ */
+ public static void listServersOfTheServerGroup(
+ com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager) {
+ manager.servers().listByServerGroup("TestGroup", "hsctestsg1", Context.NONE);
+ }
+}
+```
+
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/pom.xml b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/pom.xml
new file mode 100644
index 0000000000000..4ccda36583b10
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/pom.xml
@@ -0,0 +1,81 @@
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-postgresqlhsc
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for postgresqlhsc Management
+ This package contains Microsoft Azure SDK for postgresqlhsc Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations. Package tag package-2020-10-05-privatepreview.
+ 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
+ true
+ false
+
+
+
+
+
+ com.azure
+ azure-core
+ 1.23.1
+
+
+ com.azure
+ azure-core-management
+ 1.4.4
+
+
+
+
+
+ org.revapi
+ revapi-maven-plugin
+ 0.11.2
+
+
+
+
+ java.method.addedToInterface
+
+
+ true
+ .*
+ com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)*
+
+
+
+
+
+
+
+
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/PostgresqlhscManager.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/PostgresqlhscManager.java
new file mode 100644
index 0000000000000..baf6d7f5764da
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/PostgresqlhscManager.java
@@ -0,0 +1,306 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc;
+
+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.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.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.fluent.MicrosoftPostgreSqlHyperscale;
+import com.azure.resourcemanager.postgresqlhsc.implementation.ConfigurationsImpl;
+import com.azure.resourcemanager.postgresqlhsc.implementation.FirewallRulesImpl;
+import com.azure.resourcemanager.postgresqlhsc.implementation.MicrosoftPostgreSqlHyperscaleBuilder;
+import com.azure.resourcemanager.postgresqlhsc.implementation.OperationsImpl;
+import com.azure.resourcemanager.postgresqlhsc.implementation.RolesImpl;
+import com.azure.resourcemanager.postgresqlhsc.implementation.ServerGroupsImpl;
+import com.azure.resourcemanager.postgresqlhsc.implementation.ServersImpl;
+import com.azure.resourcemanager.postgresqlhsc.models.Configurations;
+import com.azure.resourcemanager.postgresqlhsc.models.FirewallRules;
+import com.azure.resourcemanager.postgresqlhsc.models.Operations;
+import com.azure.resourcemanager.postgresqlhsc.models.Roles;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroups;
+import com.azure.resourcemanager.postgresqlhsc.models.Servers;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * Entry point to PostgresqlhscManager. The Microsoft Azure management API provides create, read, update, and delete
+ * functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall
+ * rules, VNET rules, security alert policies, log files and configurations.
+ */
+public final class PostgresqlhscManager {
+ private ServerGroups serverGroups;
+
+ private Servers servers;
+
+ private Configurations configurations;
+
+ private FirewallRules firewallRules;
+
+ private Roles roles;
+
+ private Operations operations;
+
+ private final MicrosoftPostgreSqlHyperscale clientObject;
+
+ private PostgresqlhscManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ this.clientObject =
+ new MicrosoftPostgreSqlHyperscaleBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
+ }
+
+ /**
+ * Creates an instance of postgresqlhsc service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the postgresqlhsc service API instance.
+ */
+ public static PostgresqlhscManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return configure().authenticate(credential, profile);
+ }
+
+ /**
+ * Gets a Configurable instance that can be used to create PostgresqlhscManager with optional configuration.
+ *
+ * @return the Configurable instance allowing configurations.
+ */
+ public static Configurable configure() {
+ return new PostgresqlhscManager.Configurable();
+ }
+
+ /** The Configurable allowing configurations to be set. */
+ public static final class Configurable {
+ private final ClientLogger logger = new ClientLogger(Configurable.class);
+
+ private HttpClient httpClient;
+ private HttpLogOptions httpLogOptions;
+ private final List policies = new ArrayList<>();
+ private final List scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ 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 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, "'retryPolicy' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of postgresqlhsc service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the postgresqlhsc service API instance.
+ */
+ public PostgresqlhscManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.postgresqlhsc")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ 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 ArmChallengeAuthenticationPolicy(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 PostgresqlhscManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /** @return Resource collection API of ServerGroups. */
+ public ServerGroups serverGroups() {
+ if (this.serverGroups == null) {
+ this.serverGroups = new ServerGroupsImpl(clientObject.getServerGroups(), this);
+ }
+ return serverGroups;
+ }
+
+ /** @return Resource collection API of Servers. */
+ public Servers servers() {
+ if (this.servers == null) {
+ this.servers = new ServersImpl(clientObject.getServers(), this);
+ }
+ return servers;
+ }
+
+ /** @return Resource collection API of Configurations. */
+ public Configurations configurations() {
+ if (this.configurations == null) {
+ this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this);
+ }
+ return configurations;
+ }
+
+ /** @return Resource collection API of FirewallRules. */
+ public FirewallRules firewallRules() {
+ if (this.firewallRules == null) {
+ this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this);
+ }
+ return firewallRules;
+ }
+
+ /** @return Resource collection API of Roles. */
+ public Roles roles() {
+ if (this.roles == null) {
+ this.roles = new RolesImpl(clientObject.getRoles(), this);
+ }
+ return roles;
+ }
+
+ /** @return Resource collection API of Operations. */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * @return Wrapped service client MicrosoftPostgreSqlHyperscale providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ */
+ public MicrosoftPostgreSqlHyperscale serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ConfigurationsClient.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ConfigurationsClient.java
new file mode 100644
index 0000000000000..adfdbd1c5c434
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ConfigurationsClient.java
@@ -0,0 +1,187 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerConfigurationInner;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerGroupConfigurationInner;
+
+/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */
+public interface ConfigurationsClient {
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServer(
+ String resourceGroupName, String serverGroupName, String serverName);
+
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServer(
+ String resourceGroupName, String serverGroupName, String serverName, Context context);
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName);
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ServerGroupConfigurationInner> beginUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters);
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ServerGroupConfigurationInner> beginUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context);
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupConfigurationInner update(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters);
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupConfigurationInner update(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context);
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupConfigurationInner get(String resourceGroupName, String serverGroupName, String configurationName);
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String configurationName, Context context);
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/FirewallRulesClient.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/FirewallRulesClient.java
new file mode 100644
index 0000000000000..c227fba9bec54
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/FirewallRulesClient.java
@@ -0,0 +1,207 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.FirewallRuleInner;
+
+/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */
+public interface FirewallRulesClient {
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, FirewallRuleInner> beginCreateOrUpdate(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, FirewallRuleInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FirewallRuleInner createOrUpdate(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FirewallRuleInner createOrUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context);
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String serverGroupName, String firewallRuleName);
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context);
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 serverGroupName, String firewallRuleName);
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 serverGroupName, String firewallRuleName, Context context);
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FirewallRuleInner get(String resourceGroupName, String serverGroupName, String firewallRuleName);
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context);
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName);
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context);
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/MicrosoftPostgreSqlHyperscale.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/MicrosoftPostgreSqlHyperscale.java
new file mode 100644
index 0000000000000..50a2c829e0954
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/MicrosoftPostgreSqlHyperscale.java
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for MicrosoftPostgreSqlHyperscale class. */
+public interface MicrosoftPostgreSqlHyperscale {
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the ServerGroupsClient object to access its operations.
+ *
+ * @return the ServerGroupsClient object.
+ */
+ ServerGroupsClient getServerGroups();
+
+ /**
+ * Gets the ServersClient object to access its operations.
+ *
+ * @return the ServersClient object.
+ */
+ ServersClient getServers();
+
+ /**
+ * Gets the ConfigurationsClient object to access its operations.
+ *
+ * @return the ConfigurationsClient object.
+ */
+ ConfigurationsClient getConfigurations();
+
+ /**
+ * Gets the FirewallRulesClient object to access its operations.
+ *
+ * @return the FirewallRulesClient object.
+ */
+ FirewallRulesClient getFirewallRules();
+
+ /**
+ * Gets the RolesClient object to access its operations.
+ *
+ * @return the RolesClient object.
+ */
+ RolesClient getRoles();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/OperationsClient.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..c79d237d7eaa3
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/OperationsClient.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Lists all of the available REST API operations.
+ *
+ * @throws com.azure.core.management.exception.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 resource provider operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all of the available REST API operations.
+ *
+ * @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 resource provider operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/RolesClient.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/RolesClient.java
new file mode 100644
index 0000000000000..32aececc6d293
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/RolesClient.java
@@ -0,0 +1,165 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.RoleInner;
+
+/** An instance of this class provides access to all the operations defined in RolesClient. */
+public interface RolesClient {
+ /**
+ * Creates a new role or updates an existing role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @param parameters The required parameters for creating or updating a role.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a server group role.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RoleInner> beginCreate(
+ String resourceGroupName, String serverGroupName, String roleName, RoleInner parameters);
+
+ /**
+ * Creates a new role or updates an existing role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @param parameters The required parameters for creating or updating a role.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a server group role.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RoleInner> beginCreate(
+ String resourceGroupName, String serverGroupName, String roleName, RoleInner parameters, Context context);
+
+ /**
+ * Creates a new role or updates an existing role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @param parameters The required parameters for creating or updating a role.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a server group role.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RoleInner create(String resourceGroupName, String serverGroupName, String roleName, RoleInner parameters);
+
+ /**
+ * Creates a new role or updates an existing role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @param parameters The required parameters for creating or updating a role.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a server group role.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RoleInner create(
+ String resourceGroupName, String serverGroupName, String roleName, RoleInner parameters, Context context);
+
+ /**
+ * Deletes a server group role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String serverGroupName, String roleName);
+
+ /**
+ * Deletes a server group role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String serverGroupName, String roleName, Context context);
+
+ /**
+ * Deletes a server group role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 serverGroupName, String roleName);
+
+ /**
+ * Deletes a server group role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param roleName The name of the server group role name.
+ * @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 serverGroupName, String roleName, Context context);
+
+ /**
+ * List all the roles in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of roles.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName);
+
+ /**
+ * List all the roles in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of roles.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName, Context context);
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ServerGroupsClient.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ServerGroupsClient.java
new file mode 100644
index 0000000000000..40c9034cb6d86
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ServerGroupsClient.java
@@ -0,0 +1,455 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.NameAvailabilityInner;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerGroupInner;
+import com.azure.resourcemanager.postgresqlhsc.models.NameAvailabilityRequest;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupForUpdate;
+
+/** An instance of this class provides access to all the operations defined in ServerGroupsClient. */
+public interface ServerGroupsClient {
+ /**
+ * List all the server groups in a given 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 a list of server groups.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List all the server groups in a given 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 a list of server groups.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * List all the server groups in a given 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 a list of server groups.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List all the server groups in a given 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 a list of server groups.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Creates a new server group with servers.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The required parameters for creating or updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ServerGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String serverGroupName, ServerGroupInner parameters);
+
+ /**
+ * Creates a new server group with servers.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The required parameters for creating or updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ServerGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String serverGroupName, ServerGroupInner parameters, Context context);
+
+ /**
+ * Creates a new server group with servers.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The required parameters for creating or updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupInner createOrUpdate(String resourceGroupName, String serverGroupName, ServerGroupInner parameters);
+
+ /**
+ * Creates a new server group with servers.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The required parameters for creating or updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupInner createOrUpdate(
+ String resourceGroupName, String serverGroupName, ServerGroupInner parameters, Context context);
+
+ /**
+ * Gets information about a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupInner getByResourceGroup(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Gets information about a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Deletes a server group together with servers in it.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Deletes a server group together with servers in it.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Deletes a server group together with servers in it.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 serverGroupName);
+
+ /**
+ * Deletes a server group together with servers in it.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 serverGroupName, Context context);
+
+ /**
+ * Updates an existing server group. The request body can contain one to many of the properties present in the
+ * normal server group definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The parameters for updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ServerGroupInner> beginUpdate(
+ String resourceGroupName, String serverGroupName, ServerGroupForUpdate parameters);
+
+ /**
+ * Updates an existing server group. The request body can contain one to many of the properties present in the
+ * normal server group definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The parameters for updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ServerGroupInner> beginUpdate(
+ String resourceGroupName, String serverGroupName, ServerGroupForUpdate parameters, Context context);
+
+ /**
+ * Updates an existing server group. The request body can contain one to many of the properties present in the
+ * normal server group definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The parameters for updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupInner update(String resourceGroupName, String serverGroupName, ServerGroupForUpdate parameters);
+
+ /**
+ * Updates an existing server group. The request body can contain one to many of the properties present in the
+ * normal server group definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param parameters The parameters for updating a server 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 represents a server group for create.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupInner update(
+ String resourceGroupName, String serverGroupName, ServerGroupForUpdate parameters, Context context);
+
+ /**
+ * Restarts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Restarts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Restarts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 restart(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Restarts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 restart(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Starts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStart(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Starts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStart(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Starts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 start(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Starts the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 start(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Stops the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStop(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Stops the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStop(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Stops the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 stop(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Stops the server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 stop(String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Check the availability of name for resource.
+ *
+ * @param nameAvailabilityRequest The required parameters for checking if resource name is available.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a resource name availability.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ NameAvailabilityInner checkNameAvailability(NameAvailabilityRequest nameAvailabilityRequest);
+
+ /**
+ * Check the availability of name for resource.
+ *
+ * @param nameAvailabilityRequest The required parameters for checking if resource name is available.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents a resource name availability.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkNameAvailabilityWithResponse(
+ NameAvailabilityRequest nameAvailabilityRequest, Context context);
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ServersClient.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ServersClient.java
new file mode 100644
index 0000000000000..29751998877e0
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/ServersClient.java
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerGroupServerInner;
+
+/** An instance of this class provides access to all the operations defined in ServersClient. */
+public interface ServersClient {
+ /**
+ * Lists servers of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of servers in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName);
+
+ /**
+ * Lists servers of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of servers in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context);
+
+ /**
+ * Gets information about a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 server in server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ServerGroupServerInner get(String resourceGroupName, String serverGroupName, String serverName);
+
+ /**
+ * Gets information about a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @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 server in server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String serverName, Context context);
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/FirewallRuleInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/FirewallRuleInner.java
new file mode 100644
index 0000000000000..bed61451ae04b
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/FirewallRuleInner.java
@@ -0,0 +1,110 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Represents a server group firewall rule. */
+@Fluent
+public final class FirewallRuleInner extends ProxyResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleInner.class);
+
+ /*
+ * The system metadata relating to this resource
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * The properties of a firewall rule.
+ */
+ @JsonProperty(value = "properties", required = true)
+ private FirewallRuleProperties innerProperties = new FirewallRuleProperties();
+
+ /**
+ * Get the systemData property: The system metadata relating to this resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the innerProperties property: The properties of a firewall rule.
+ *
+ * @return the innerProperties value.
+ */
+ private FirewallRuleProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the startIpAddress property: The start IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @return the startIpAddress value.
+ */
+ public String startIpAddress() {
+ return this.innerProperties() == null ? null : this.innerProperties().startIpAddress();
+ }
+
+ /**
+ * Set the startIpAddress property: The start IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @param startIpAddress the startIpAddress value to set.
+ * @return the FirewallRuleInner object itself.
+ */
+ public FirewallRuleInner withStartIpAddress(String startIpAddress) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FirewallRuleProperties();
+ }
+ this.innerProperties().withStartIpAddress(startIpAddress);
+ return this;
+ }
+
+ /**
+ * Get the endIpAddress property: The end IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @return the endIpAddress value.
+ */
+ public String endIpAddress() {
+ return this.innerProperties() == null ? null : this.innerProperties().endIpAddress();
+ }
+
+ /**
+ * Set the endIpAddress property: The end IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @param endIpAddress the endIpAddress value to set.
+ * @return the FirewallRuleInner object itself.
+ */
+ public FirewallRuleInner withEndIpAddress(String endIpAddress) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FirewallRuleProperties();
+ }
+ this.innerProperties().withEndIpAddress(endIpAddress);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property innerProperties in model FirewallRuleInner"));
+ } else {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/FirewallRuleProperties.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/FirewallRuleProperties.java
new file mode 100644
index 0000000000000..38a8314754150
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/FirewallRuleProperties.java
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of a server group firewall rule. */
+@Fluent
+public final class FirewallRuleProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleProperties.class);
+
+ /*
+ * The start IP address of the server group firewall rule. Must be IPv4
+ * format.
+ */
+ @JsonProperty(value = "startIpAddress", required = true)
+ private String startIpAddress;
+
+ /*
+ * The end IP address of the server group firewall rule. Must be IPv4
+ * format.
+ */
+ @JsonProperty(value = "endIpAddress", required = true)
+ private String endIpAddress;
+
+ /**
+ * Get the startIpAddress property: The start IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @return the startIpAddress value.
+ */
+ public String startIpAddress() {
+ return this.startIpAddress;
+ }
+
+ /**
+ * Set the startIpAddress property: The start IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @param startIpAddress the startIpAddress value to set.
+ * @return the FirewallRuleProperties object itself.
+ */
+ public FirewallRuleProperties withStartIpAddress(String startIpAddress) {
+ this.startIpAddress = startIpAddress;
+ return this;
+ }
+
+ /**
+ * Get the endIpAddress property: The end IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @return the endIpAddress value.
+ */
+ public String endIpAddress() {
+ return this.endIpAddress;
+ }
+
+ /**
+ * Set the endIpAddress property: The end IP address of the server group firewall rule. Must be IPv4 format.
+ *
+ * @param endIpAddress the endIpAddress value to set.
+ * @return the FirewallRuleProperties object itself.
+ */
+ public FirewallRuleProperties withEndIpAddress(String endIpAddress) {
+ this.endIpAddress = endIpAddress;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (startIpAddress() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property startIpAddress in model FirewallRuleProperties"));
+ }
+ if (endIpAddress() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property endIpAddress in model FirewallRuleProperties"));
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/NameAvailabilityInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/NameAvailabilityInner.java
new file mode 100644
index 0000000000000..41d38bcd64e7e
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/NameAvailabilityInner.java
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Represents a resource name availability. */
+@Fluent
+public final class NameAvailabilityInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class);
+
+ /*
+ * Error Message.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /*
+ * Indicates whether the resource name is available.
+ */
+ @JsonProperty(value = "nameAvailable")
+ private Boolean nameAvailable;
+
+ /*
+ * name of the PostgreSQL server.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * type of the server
+ */
+ @JsonProperty(value = "type")
+ private String type;
+
+ /**
+ * Get the message property: Error Message.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message property: Error Message.
+ *
+ * @param message the message value to set.
+ * @return the NameAvailabilityInner object itself.
+ */
+ public NameAvailabilityInner withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Get the nameAvailable property: Indicates whether the resource name is available.
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Set the nameAvailable property: Indicates whether the resource name is available.
+ *
+ * @param nameAvailable the nameAvailable value to set.
+ * @return the NameAvailabilityInner object itself.
+ */
+ public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) {
+ this.nameAvailable = nameAvailable;
+ return this;
+ }
+
+ /**
+ * Get the name property: name of the PostgreSQL server.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: name of the PostgreSQL server.
+ *
+ * @param name the name value to set.
+ * @return the NameAvailabilityInner object itself.
+ */
+ public NameAvailabilityInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the type property: type of the server.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: type of the server.
+ *
+ * @param type the type value to set.
+ * @return the NameAvailabilityInner object itself.
+ */
+ public NameAvailabilityInner withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/OperationInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..15c9010f2d882
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/OperationInner.java
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.OperationDisplay;
+import com.azure.resourcemanager.postgresqlhsc.models.OperationOrigin;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** REST API operation definition. */
+@Fluent
+public final class OperationInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class);
+
+ /*
+ * The name of the operation being performed on this particular object.
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * The localized display information for this particular operation or
+ * action.
+ */
+ @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY)
+ private OperationDisplay display;
+
+ /*
+ * Indicates whether the operation is a data action
+ */
+ @JsonProperty(value = "isDataAction")
+ private Boolean isDataAction;
+
+ /*
+ * The intended executor of the operation.
+ */
+ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
+ private OperationOrigin origin;
+
+ /*
+ * Additional descriptions for the operation.
+ */
+ @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY)
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map properties;
+
+ /**
+ * Get the name property: The name of the operation being performed on this particular object.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the display property: The localized display information for this particular operation or action.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Get the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Set the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @param isDataAction the isDataAction value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withIsDataAction(Boolean isDataAction) {
+ this.isDataAction = isDataAction;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation.
+ *
+ * @return the origin value.
+ */
+ public OperationOrigin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the properties property: Additional descriptions for the operation.
+ *
+ * @return the properties value.
+ */
+ public Map properties() {
+ return this.properties;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/RoleInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/RoleInner.java
new file mode 100644
index 0000000000000..7a5aef5c398bf
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/RoleInner.java
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Represents a server group role. */
+@Fluent
+public final class RoleInner extends ProxyResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInner.class);
+
+ /*
+ * The system metadata relating to this resource
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * The properties of a role.
+ */
+ @JsonProperty(value = "properties")
+ private RoleProperties innerProperties;
+
+ /**
+ * Get the systemData property: The system metadata relating to this resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the innerProperties property: The properties of a role.
+ *
+ * @return the innerProperties value.
+ */
+ private RoleProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the password property: The password of the server group role.
+ *
+ * @return the password value.
+ */
+ public String password() {
+ return this.innerProperties() == null ? null : this.innerProperties().password();
+ }
+
+ /**
+ * Set the password property: The password of the server group role.
+ *
+ * @param password the password value to set.
+ * @return the RoleInner object itself.
+ */
+ public RoleInner withPassword(String password) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new RoleProperties();
+ }
+ this.innerProperties().withPassword(password);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/RoleProperties.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/RoleProperties.java
new file mode 100644
index 0000000000000..86386f91bee3a
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/RoleProperties.java
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of a server group role. */
+@Fluent
+public final class RoleProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleProperties.class);
+
+ /*
+ * The password of the server group role.
+ */
+ @JsonProperty(value = "password", required = true)
+ private String password;
+
+ /**
+ * Get the password property: The password of the server group role.
+ *
+ * @return the password value.
+ */
+ public String password() {
+ return this.password;
+ }
+
+ /**
+ * Set the password property: The password of the server group role.
+ *
+ * @param password the password value to set.
+ * @return the RoleProperties object itself.
+ */
+ public RoleProperties withPassword(String password) {
+ this.password = password;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (password() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property password in model RoleProperties"));
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerConfigurationInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerConfigurationInner.java
new file mode 100644
index 0000000000000..ed022c69551d4
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerConfigurationInner.java
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.ConfigurationDataType;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Represents a configuration. */
+@Fluent
+public final class ServerConfigurationInner extends ProxyResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerConfigurationInner.class);
+
+ /*
+ * The system metadata relating to this resource
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * The properties of a configuration.
+ */
+ @JsonProperty(value = "properties")
+ private ServerConfigurationProperties innerProperties;
+
+ /**
+ * Get the systemData property: The system metadata relating to this resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the innerProperties property: The properties of a configuration.
+ *
+ * @return the innerProperties value.
+ */
+ private ServerConfigurationProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the value property: Value of the configuration.
+ *
+ * @return the value value.
+ */
+ public String value() {
+ return this.innerProperties() == null ? null : this.innerProperties().value();
+ }
+
+ /**
+ * Set the value property: Value of the configuration.
+ *
+ * @param value the value value to set.
+ * @return the ServerConfigurationInner object itself.
+ */
+ public ServerConfigurationInner withValue(String value) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerConfigurationProperties();
+ }
+ this.innerProperties().withValue(value);
+ return this;
+ }
+
+ /**
+ * Get the source property: Source of the configuration.
+ *
+ * @return the source value.
+ */
+ public String source() {
+ return this.innerProperties() == null ? null : this.innerProperties().source();
+ }
+
+ /**
+ * Get the description property: Description of the configuration.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.innerProperties() == null ? null : this.innerProperties().description();
+ }
+
+ /**
+ * Get the defaultValue property: Default value of the configuration.
+ *
+ * @return the defaultValue value.
+ */
+ public String defaultValue() {
+ return this.innerProperties() == null ? null : this.innerProperties().defaultValue();
+ }
+
+ /**
+ * Get the dataType property: Data type of the configuration.
+ *
+ * @return the dataType value.
+ */
+ public ConfigurationDataType dataType() {
+ return this.innerProperties() == null ? null : this.innerProperties().dataType();
+ }
+
+ /**
+ * Get the allowedValues property: Allowed values of the configuration.
+ *
+ * @return the allowedValues value.
+ */
+ public String allowedValues() {
+ return this.innerProperties() == null ? null : this.innerProperties().allowedValues();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerConfigurationProperties.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerConfigurationProperties.java
new file mode 100644
index 0000000000000..7a557ed420845
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerConfigurationProperties.java
@@ -0,0 +1,132 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.ConfigurationDataType;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of a configuration. */
+@Fluent
+public final class ServerConfigurationProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerConfigurationProperties.class);
+
+ /*
+ * Value of the configuration.
+ */
+ @JsonProperty(value = "value", required = true)
+ private String value;
+
+ /*
+ * Source of the configuration.
+ */
+ @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY)
+ private String source;
+
+ /*
+ * Description of the configuration.
+ */
+ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
+ private String description;
+
+ /*
+ * Default value of the configuration.
+ */
+ @JsonProperty(value = "defaultValue", access = JsonProperty.Access.WRITE_ONLY)
+ private String defaultValue;
+
+ /*
+ * Data type of the configuration.
+ */
+ @JsonProperty(value = "dataType", access = JsonProperty.Access.WRITE_ONLY)
+ private ConfigurationDataType dataType;
+
+ /*
+ * Allowed values of the configuration.
+ */
+ @JsonProperty(value = "allowedValues", access = JsonProperty.Access.WRITE_ONLY)
+ private String allowedValues;
+
+ /**
+ * Get the value property: Value of the configuration.
+ *
+ * @return the value value.
+ */
+ public String value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: Value of the configuration.
+ *
+ * @param value the value value to set.
+ * @return the ServerConfigurationProperties object itself.
+ */
+ public ServerConfigurationProperties withValue(String value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Get the source property: Source of the configuration.
+ *
+ * @return the source value.
+ */
+ public String source() {
+ return this.source;
+ }
+
+ /**
+ * Get the description property: Description of the configuration.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Get the defaultValue property: Default value of the configuration.
+ *
+ * @return the defaultValue value.
+ */
+ public String defaultValue() {
+ return this.defaultValue;
+ }
+
+ /**
+ * Get the dataType property: Data type of the configuration.
+ *
+ * @return the dataType value.
+ */
+ public ConfigurationDataType dataType() {
+ return this.dataType;
+ }
+
+ /**
+ * Get the allowedValues property: Allowed values of the configuration.
+ *
+ * @return the allowedValues value.
+ */
+ public String allowedValues() {
+ return this.allowedValues;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property value in model ServerConfigurationProperties"));
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupConfigurationInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupConfigurationInner.java
new file mode 100644
index 0000000000000..2ca7e1bfe7381
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupConfigurationInner.java
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.ConfigurationDataType;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroupConfiguration;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Represents the configuration list of server role groups in a server group. */
+@Fluent
+public final class ServerGroupConfigurationInner extends ProxyResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupConfigurationInner.class);
+
+ /*
+ * The system metadata relating to this resource
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * The properties of server group configuration.
+ */
+ @JsonProperty(value = "properties")
+ private ServerGroupConfigurationProperties innerProperties;
+
+ /**
+ * Get the systemData property: The system metadata relating to this resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the innerProperties property: The properties of server group configuration.
+ *
+ * @return the innerProperties value.
+ */
+ private ServerGroupConfigurationProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the description property: Description of the configuration.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.innerProperties() == null ? null : this.innerProperties().description();
+ }
+
+ /**
+ * Get the dataType property: Data type of the configuration.
+ *
+ * @return the dataType value.
+ */
+ public ConfigurationDataType dataType() {
+ return this.innerProperties() == null ? null : this.innerProperties().dataType();
+ }
+
+ /**
+ * Get the allowedValues property: Allowed values of the configuration.
+ *
+ * @return the allowedValues value.
+ */
+ public String allowedValues() {
+ return this.innerProperties() == null ? null : this.innerProperties().allowedValues();
+ }
+
+ /**
+ * Get the serverRoleGroupConfigurations property: The list of server role group configuration values.
+ *
+ * @return the serverRoleGroupConfigurations value.
+ */
+ public List serverRoleGroupConfigurations() {
+ return this.innerProperties() == null ? null : this.innerProperties().serverRoleGroupConfigurations();
+ }
+
+ /**
+ * Set the serverRoleGroupConfigurations property: The list of server role group configuration values.
+ *
+ * @param serverRoleGroupConfigurations the serverRoleGroupConfigurations value to set.
+ * @return the ServerGroupConfigurationInner object itself.
+ */
+ public ServerGroupConfigurationInner withServerRoleGroupConfigurations(
+ List serverRoleGroupConfigurations) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupConfigurationProperties();
+ }
+ this.innerProperties().withServerRoleGroupConfigurations(serverRoleGroupConfigurations);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupConfigurationProperties.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupConfigurationProperties.java
new file mode 100644
index 0000000000000..2f3ac27197c9b
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupConfigurationProperties.java
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.ConfigurationDataType;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroupConfiguration;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The properties of server group configuration. */
+@Fluent
+public final class ServerGroupConfigurationProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupConfigurationProperties.class);
+
+ /*
+ * Description of the configuration.
+ */
+ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
+ private String description;
+
+ /*
+ * Data type of the configuration.
+ */
+ @JsonProperty(value = "dataType", access = JsonProperty.Access.WRITE_ONLY)
+ private ConfigurationDataType dataType;
+
+ /*
+ * Allowed values of the configuration.
+ */
+ @JsonProperty(value = "allowedValues", access = JsonProperty.Access.WRITE_ONLY)
+ private String allowedValues;
+
+ /*
+ * The list of server role group configuration values.
+ */
+ @JsonProperty(value = "serverRoleGroupConfigurations", required = true)
+ private List serverRoleGroupConfigurations;
+
+ /**
+ * Get the description property: Description of the configuration.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Get the dataType property: Data type of the configuration.
+ *
+ * @return the dataType value.
+ */
+ public ConfigurationDataType dataType() {
+ return this.dataType;
+ }
+
+ /**
+ * Get the allowedValues property: Allowed values of the configuration.
+ *
+ * @return the allowedValues value.
+ */
+ public String allowedValues() {
+ return this.allowedValues;
+ }
+
+ /**
+ * Get the serverRoleGroupConfigurations property: The list of server role group configuration values.
+ *
+ * @return the serverRoleGroupConfigurations value.
+ */
+ public List serverRoleGroupConfigurations() {
+ return this.serverRoleGroupConfigurations;
+ }
+
+ /**
+ * Set the serverRoleGroupConfigurations property: The list of server role group configuration values.
+ *
+ * @param serverRoleGroupConfigurations the serverRoleGroupConfigurations value to set.
+ * @return the ServerGroupConfigurationProperties object itself.
+ */
+ public ServerGroupConfigurationProperties withServerRoleGroupConfigurations(
+ List serverRoleGroupConfigurations) {
+ this.serverRoleGroupConfigurations = serverRoleGroupConfigurations;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (serverRoleGroupConfigurations() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property serverRoleGroupConfigurations in model"
+ + " ServerGroupConfigurationProperties"));
+ } else {
+ serverRoleGroupConfigurations().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupInner.java
new file mode 100644
index 0000000000000..84534099558d5
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupInner.java
@@ -0,0 +1,604 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.CitusVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.CreateMode;
+import com.azure.resourcemanager.postgresqlhsc.models.MaintenanceWindow;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ResourceProviderType;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupPropertiesDelegatedSubnetArguments;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupPropertiesPrivateDnsZoneArguments;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroup;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerState;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Map;
+
+/** Represents a server group for create. */
+@Fluent
+public final class ServerGroupInner extends Resource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupInner.class);
+
+ /*
+ * The system metadata relating to this resource
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * Properties of the server group create.
+ */
+ @JsonProperty(value = "properties")
+ private ServerGroupProperties innerProperties;
+
+ /**
+ * Get the systemData property: The system metadata relating to this resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the innerProperties property: Properties of the server group create.
+ *
+ * @return the innerProperties value.
+ */
+ private ServerGroupProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServerGroupInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServerGroupInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the createMode property: The mode to create a new server group.
+ *
+ * @return the createMode value.
+ */
+ public CreateMode createMode() {
+ return this.innerProperties() == null ? null : this.innerProperties().createMode();
+ }
+
+ /**
+ * Set the createMode property: The mode to create a new server group.
+ *
+ * @param createMode the createMode value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withCreateMode(CreateMode createMode) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withCreateMode(createMode);
+ return this;
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login name of servers in server group. Can only be
+ * specified when the server is being created (and is required for creation).
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.innerProperties() == null ? null : this.innerProperties().administratorLogin();
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login name of servers in server group. Can only be
+ * specified when the server is being created (and is required for creation).
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withAdministratorLogin(String administratorLogin) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withAdministratorLogin(administratorLogin);
+ return this;
+ }
+
+ /**
+ * Get the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @return the administratorLoginPassword value.
+ */
+ public String administratorLoginPassword() {
+ return this.innerProperties() == null ? null : this.innerProperties().administratorLoginPassword();
+ }
+
+ /**
+ * Set the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @param administratorLoginPassword the administratorLoginPassword value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withAdministratorLoginPassword(String administratorLoginPassword) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withAdministratorLoginPassword(administratorLoginPassword);
+ return this;
+ }
+
+ /**
+ * Get the backupRetentionDays property: The backup retention days for server group.
+ *
+ * @return the backupRetentionDays value.
+ */
+ public Integer backupRetentionDays() {
+ return this.innerProperties() == null ? null : this.innerProperties().backupRetentionDays();
+ }
+
+ /**
+ * Set the backupRetentionDays property: The backup retention days for server group.
+ *
+ * @param backupRetentionDays the backupRetentionDays value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withBackupRetentionDays(Integer backupRetentionDays) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withBackupRetentionDays(backupRetentionDays);
+ return this;
+ }
+
+ /**
+ * Get the postgresqlVersion property: The PostgreSQL version of server group.
+ *
+ * @return the postgresqlVersion value.
+ */
+ public PostgreSqlVersion postgresqlVersion() {
+ return this.innerProperties() == null ? null : this.innerProperties().postgresqlVersion();
+ }
+
+ /**
+ * Set the postgresqlVersion property: The PostgreSQL version of server group.
+ *
+ * @param postgresqlVersion the postgresqlVersion value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withPostgresqlVersion(PostgreSqlVersion postgresqlVersion) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withPostgresqlVersion(postgresqlVersion);
+ return this;
+ }
+
+ /**
+ * Get the citusVersion property: The Citus version of server group.
+ *
+ * @return the citusVersion value.
+ */
+ public CitusVersion citusVersion() {
+ return this.innerProperties() == null ? null : this.innerProperties().citusVersion();
+ }
+
+ /**
+ * Set the citusVersion property: The Citus version of server group.
+ *
+ * @param citusVersion the citusVersion value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withCitusVersion(CitusVersion citusVersion) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withCitusVersion(citusVersion);
+ return this;
+ }
+
+ /**
+ * Get the enableMx property: If Citus MX is enabled or not for the server group.
+ *
+ * @return the enableMx value.
+ */
+ public Boolean enableMx() {
+ return this.innerProperties() == null ? null : this.innerProperties().enableMx();
+ }
+
+ /**
+ * Set the enableMx property: If Citus MX is enabled or not for the server group.
+ *
+ * @param enableMx the enableMx value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withEnableMx(Boolean enableMx) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withEnableMx(enableMx);
+ return this;
+ }
+
+ /**
+ * Get the enableZfs property: If ZFS compression is enabled or not for the server group.
+ *
+ * @return the enableZfs value.
+ */
+ public Boolean enableZfs() {
+ return this.innerProperties() == null ? null : this.innerProperties().enableZfs();
+ }
+
+ /**
+ * Set the enableZfs property: If ZFS compression is enabled or not for the server group.
+ *
+ * @param enableZfs the enableZfs value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withEnableZfs(Boolean enableZfs) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withEnableZfs(enableZfs);
+ return this;
+ }
+
+ /**
+ * Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the server group.
+ *
+ * @return the enableShardsOnCoordinator value.
+ */
+ public Boolean enableShardsOnCoordinator() {
+ return this.innerProperties() == null ? null : this.innerProperties().enableShardsOnCoordinator();
+ }
+
+ /**
+ * Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the server group.
+ *
+ * @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withEnableShardsOnCoordinator(Boolean enableShardsOnCoordinator) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withEnableShardsOnCoordinator(enableShardsOnCoordinator);
+ return this;
+ }
+
+ /**
+ * Get the state property: A state of a server group that is visible to user.
+ *
+ * @return the state value.
+ */
+ public ServerState state() {
+ return this.innerProperties() == null ? null : this.innerProperties().state();
+ }
+
+ /**
+ * Get the earliestRestoreTime property: The earliest restore point time (ISO8601 format) for server group.
+ *
+ * @return the earliestRestoreTime value.
+ */
+ public OffsetDateTime earliestRestoreTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().earliestRestoreTime();
+ }
+
+ /**
+ * Get the resourceProviderType property: The resource provider type of server group.
+ *
+ * @return the resourceProviderType value.
+ */
+ public ResourceProviderType resourceProviderType() {
+ return this.innerProperties() == null ? null : this.innerProperties().resourceProviderType();
+ }
+
+ /**
+ * Get the serverRoleGroups property: The list of server role groups.
+ *
+ * @return the serverRoleGroups value.
+ */
+ public List serverRoleGroups() {
+ return this.innerProperties() == null ? null : this.innerProperties().serverRoleGroups();
+ }
+
+ /**
+ * Set the serverRoleGroups property: The list of server role groups.
+ *
+ * @param serverRoleGroups the serverRoleGroups value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withServerRoleGroups(List serverRoleGroups) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withServerRoleGroups(serverRoleGroups);
+ return this;
+ }
+
+ /**
+ * Get the maintenanceWindow property: Maintenance window of a server group.
+ *
+ * @return the maintenanceWindow value.
+ */
+ public MaintenanceWindow maintenanceWindow() {
+ return this.innerProperties() == null ? null : this.innerProperties().maintenanceWindow();
+ }
+
+ /**
+ * Set the maintenanceWindow property: Maintenance window of a server group.
+ *
+ * @param maintenanceWindow the maintenanceWindow value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withMaintenanceWindow(maintenanceWindow);
+ return this;
+ }
+
+ /**
+ * Get the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @return the availabilityZone value.
+ */
+ public String availabilityZone() {
+ return this.innerProperties() == null ? null : this.innerProperties().availabilityZone();
+ }
+
+ /**
+ * Set the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @param availabilityZone the availabilityZone value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withAvailabilityZone(String availabilityZone) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withAvailabilityZone(availabilityZone);
+ return this;
+ }
+
+ /**
+ * Get the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @return the standbyAvailabilityZone value.
+ */
+ public String standbyAvailabilityZone() {
+ return this.innerProperties() == null ? null : this.innerProperties().standbyAvailabilityZone();
+ }
+
+ /**
+ * Set the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @param standbyAvailabilityZone the standbyAvailabilityZone value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withStandbyAvailabilityZone(String standbyAvailabilityZone) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withStandbyAvailabilityZone(standbyAvailabilityZone);
+ return this;
+ }
+
+ /**
+ * Get the delegatedSubnetArguments property: The delegated subnet arguments for a server group.
+ *
+ * @return the delegatedSubnetArguments value.
+ */
+ public ServerGroupPropertiesDelegatedSubnetArguments delegatedSubnetArguments() {
+ return this.innerProperties() == null ? null : this.innerProperties().delegatedSubnetArguments();
+ }
+
+ /**
+ * Set the delegatedSubnetArguments property: The delegated subnet arguments for a server group.
+ *
+ * @param delegatedSubnetArguments the delegatedSubnetArguments value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withDelegatedSubnetArguments(
+ ServerGroupPropertiesDelegatedSubnetArguments delegatedSubnetArguments) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withDelegatedSubnetArguments(delegatedSubnetArguments);
+ return this;
+ }
+
+ /**
+ * Get the privateDnsZoneArguments property: The private dns zone arguments for a server group.
+ *
+ * @return the privateDnsZoneArguments value.
+ */
+ public ServerGroupPropertiesPrivateDnsZoneArguments privateDnsZoneArguments() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateDnsZoneArguments();
+ }
+
+ /**
+ * Set the privateDnsZoneArguments property: The private dns zone arguments for a server group.
+ *
+ * @param privateDnsZoneArguments the privateDnsZoneArguments value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withPrivateDnsZoneArguments(
+ ServerGroupPropertiesPrivateDnsZoneArguments privateDnsZoneArguments) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withPrivateDnsZoneArguments(privateDnsZoneArguments);
+ return this;
+ }
+
+ /**
+ * Get the readReplicas property: The array of read replica server groups.
+ *
+ * @return the readReplicas value.
+ */
+ public List readReplicas() {
+ return this.innerProperties() == null ? null : this.innerProperties().readReplicas();
+ }
+
+ /**
+ * Get the sourceServerGroup property: The source server group id for read replica server groups.
+ *
+ * @return the sourceServerGroup value.
+ */
+ public String sourceServerGroup() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceServerGroup();
+ }
+
+ /**
+ * Get the sourceSubscriptionId property: The source subscription id to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceSubscriptionId value.
+ */
+ public String sourceSubscriptionId() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceSubscriptionId();
+ }
+
+ /**
+ * Set the sourceSubscriptionId property: The source subscription id to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceSubscriptionId the sourceSubscriptionId value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withSourceSubscriptionId(String sourceSubscriptionId) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withSourceSubscriptionId(sourceSubscriptionId);
+ return this;
+ }
+
+ /**
+ * Get the sourceResourceGroupName property: The source resource group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceResourceGroupName value.
+ */
+ public String sourceResourceGroupName() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceResourceGroupName();
+ }
+
+ /**
+ * Set the sourceResourceGroupName property: The source resource group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceResourceGroupName the sourceResourceGroupName value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withSourceResourceGroupName(String sourceResourceGroupName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withSourceResourceGroupName(sourceResourceGroupName);
+ return this;
+ }
+
+ /**
+ * Get the sourceServerGroupName property: The source server group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceServerGroupName value.
+ */
+ public String sourceServerGroupName() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceServerGroupName();
+ }
+
+ /**
+ * Set the sourceServerGroupName property: The source server group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceServerGroupName the sourceServerGroupName value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withSourceServerGroupName(String sourceServerGroupName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withSourceServerGroupName(sourceServerGroupName);
+ return this;
+ }
+
+ /**
+ * Get the sourceLocation property: The source server group location to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceLocation value.
+ */
+ public String sourceLocation() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceLocation();
+ }
+
+ /**
+ * Set the sourceLocation property: The source server group location to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceLocation the sourceLocation value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withSourceLocation(String sourceLocation) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withSourceLocation(sourceLocation);
+ return this;
+ }
+
+ /**
+ * Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
+ * from. It's required when 'createMode' is 'PointInTimeRestore'.
+ *
+ * @return the pointInTimeUtc value.
+ */
+ public OffsetDateTime pointInTimeUtc() {
+ return this.innerProperties() == null ? null : this.innerProperties().pointInTimeUtc();
+ }
+
+ /**
+ * Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
+ * from. It's required when 'createMode' is 'PointInTimeRestore'.
+ *
+ * @param pointInTimeUtc the pointInTimeUtc value to set.
+ * @return the ServerGroupInner object itself.
+ */
+ public ServerGroupInner withPointInTimeUtc(OffsetDateTime pointInTimeUtc) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupProperties();
+ }
+ this.innerProperties().withPointInTimeUtc(pointInTimeUtc);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupProperties.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupProperties.java
new file mode 100644
index 0000000000000..40118c5b47b7b
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupProperties.java
@@ -0,0 +1,663 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.CitusVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.CreateMode;
+import com.azure.resourcemanager.postgresqlhsc.models.MaintenanceWindow;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ResourceProviderType;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupPropertiesDelegatedSubnetArguments;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupPropertiesPrivateDnsZoneArguments;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroup;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerState;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** The properties used to create a new server group. */
+@Fluent
+public final class ServerGroupProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupProperties.class);
+
+ /*
+ * The mode to create a new server group.
+ */
+ @JsonProperty(value = "createMode")
+ private CreateMode createMode;
+
+ /*
+ * The administrator's login name of servers in server group. Can only be
+ * specified when the server is being created (and is required for
+ * creation).
+ */
+ @JsonProperty(value = "administratorLogin")
+ private String administratorLogin;
+
+ /*
+ * The password of the administrator login.
+ */
+ @JsonProperty(value = "administratorLoginPassword")
+ private String administratorLoginPassword;
+
+ /*
+ * The backup retention days for server group.
+ */
+ @JsonProperty(value = "backupRetentionDays")
+ private Integer backupRetentionDays;
+
+ /*
+ * The PostgreSQL version of server group.
+ */
+ @JsonProperty(value = "postgresqlVersion")
+ private PostgreSqlVersion postgresqlVersion;
+
+ /*
+ * The Citus version of server group.
+ */
+ @JsonProperty(value = "citusVersion")
+ private CitusVersion citusVersion;
+
+ /*
+ * If Citus MX is enabled or not for the server group.
+ */
+ @JsonProperty(value = "enableMx")
+ private Boolean enableMx;
+
+ /*
+ * If ZFS compression is enabled or not for the server group.
+ */
+ @JsonProperty(value = "enableZfs")
+ private Boolean enableZfs;
+
+ /*
+ * If shards on coordinator is enabled or not for the server group.
+ */
+ @JsonProperty(value = "enableShardsOnCoordinator")
+ private Boolean enableShardsOnCoordinator;
+
+ /*
+ * A state of a server group that is visible to user.
+ */
+ @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY)
+ private ServerState state;
+
+ /*
+ * The earliest restore point time (ISO8601 format) for server group.
+ */
+ @JsonProperty(value = "earliestRestoreTime", access = JsonProperty.Access.WRITE_ONLY)
+ private OffsetDateTime earliestRestoreTime;
+
+ /*
+ * The resource provider type of server group.
+ */
+ @JsonProperty(value = "resourceProviderType", access = JsonProperty.Access.WRITE_ONLY)
+ private ResourceProviderType resourceProviderType;
+
+ /*
+ * The list of server role groups.
+ */
+ @JsonProperty(value = "serverRoleGroups")
+ private List serverRoleGroups;
+
+ /*
+ * Maintenance window of a server group.
+ */
+ @JsonProperty(value = "maintenanceWindow")
+ private MaintenanceWindow maintenanceWindow;
+
+ /*
+ * Availability Zone information of the server group.
+ */
+ @JsonProperty(value = "availabilityZone")
+ private String availabilityZone;
+
+ /*
+ * Standby Availability Zone information of the server group.
+ */
+ @JsonProperty(value = "standbyAvailabilityZone")
+ private String standbyAvailabilityZone;
+
+ /*
+ * The delegated subnet arguments for a server group.
+ */
+ @JsonProperty(value = "delegatedSubnetArguments")
+ private ServerGroupPropertiesDelegatedSubnetArguments delegatedSubnetArguments;
+
+ /*
+ * The private dns zone arguments for a server group.
+ */
+ @JsonProperty(value = "privateDnsZoneArguments")
+ private ServerGroupPropertiesPrivateDnsZoneArguments privateDnsZoneArguments;
+
+ /*
+ * The array of read replica server groups.
+ */
+ @JsonProperty(value = "readReplicas", access = JsonProperty.Access.WRITE_ONLY)
+ private List readReplicas;
+
+ /*
+ * The source server group id for read replica server groups.
+ */
+ @JsonProperty(value = "sourceServerGroup", access = JsonProperty.Access.WRITE_ONLY)
+ private String sourceServerGroup;
+
+ /*
+ * The source subscription id to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'
+ */
+ @JsonProperty(value = "sourceSubscriptionId")
+ private String sourceSubscriptionId;
+
+ /*
+ * The source resource group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'
+ */
+ @JsonProperty(value = "sourceResourceGroupName")
+ private String sourceResourceGroupName;
+
+ /*
+ * The source server group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'
+ */
+ @JsonProperty(value = "sourceServerGroupName")
+ private String sourceServerGroupName;
+
+ /*
+ * The source server group location to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'
+ */
+ @JsonProperty(value = "sourceLocation")
+ private String sourceLocation;
+
+ /*
+ * Restore point creation time (ISO8601 format), specifying the time to
+ * restore from. It's required when 'createMode' is 'PointInTimeRestore'
+ */
+ @JsonProperty(value = "pointInTimeUTC")
+ private OffsetDateTime pointInTimeUtc;
+
+ /**
+ * Get the createMode property: The mode to create a new server group.
+ *
+ * @return the createMode value.
+ */
+ public CreateMode createMode() {
+ return this.createMode;
+ }
+
+ /**
+ * Set the createMode property: The mode to create a new server group.
+ *
+ * @param createMode the createMode value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withCreateMode(CreateMode createMode) {
+ this.createMode = createMode;
+ return this;
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login name of servers in server group. Can only be
+ * specified when the server is being created (and is required for creation).
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.administratorLogin;
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login name of servers in server group. Can only be
+ * specified when the server is being created (and is required for creation).
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withAdministratorLogin(String administratorLogin) {
+ this.administratorLogin = administratorLogin;
+ return this;
+ }
+
+ /**
+ * Get the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @return the administratorLoginPassword value.
+ */
+ public String administratorLoginPassword() {
+ return this.administratorLoginPassword;
+ }
+
+ /**
+ * Set the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @param administratorLoginPassword the administratorLoginPassword value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withAdministratorLoginPassword(String administratorLoginPassword) {
+ this.administratorLoginPassword = administratorLoginPassword;
+ return this;
+ }
+
+ /**
+ * Get the backupRetentionDays property: The backup retention days for server group.
+ *
+ * @return the backupRetentionDays value.
+ */
+ public Integer backupRetentionDays() {
+ return this.backupRetentionDays;
+ }
+
+ /**
+ * Set the backupRetentionDays property: The backup retention days for server group.
+ *
+ * @param backupRetentionDays the backupRetentionDays value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withBackupRetentionDays(Integer backupRetentionDays) {
+ this.backupRetentionDays = backupRetentionDays;
+ return this;
+ }
+
+ /**
+ * Get the postgresqlVersion property: The PostgreSQL version of server group.
+ *
+ * @return the postgresqlVersion value.
+ */
+ public PostgreSqlVersion postgresqlVersion() {
+ return this.postgresqlVersion;
+ }
+
+ /**
+ * Set the postgresqlVersion property: The PostgreSQL version of server group.
+ *
+ * @param postgresqlVersion the postgresqlVersion value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withPostgresqlVersion(PostgreSqlVersion postgresqlVersion) {
+ this.postgresqlVersion = postgresqlVersion;
+ return this;
+ }
+
+ /**
+ * Get the citusVersion property: The Citus version of server group.
+ *
+ * @return the citusVersion value.
+ */
+ public CitusVersion citusVersion() {
+ return this.citusVersion;
+ }
+
+ /**
+ * Set the citusVersion property: The Citus version of server group.
+ *
+ * @param citusVersion the citusVersion value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withCitusVersion(CitusVersion citusVersion) {
+ this.citusVersion = citusVersion;
+ return this;
+ }
+
+ /**
+ * Get the enableMx property: If Citus MX is enabled or not for the server group.
+ *
+ * @return the enableMx value.
+ */
+ public Boolean enableMx() {
+ return this.enableMx;
+ }
+
+ /**
+ * Set the enableMx property: If Citus MX is enabled or not for the server group.
+ *
+ * @param enableMx the enableMx value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withEnableMx(Boolean enableMx) {
+ this.enableMx = enableMx;
+ return this;
+ }
+
+ /**
+ * Get the enableZfs property: If ZFS compression is enabled or not for the server group.
+ *
+ * @return the enableZfs value.
+ */
+ public Boolean enableZfs() {
+ return this.enableZfs;
+ }
+
+ /**
+ * Set the enableZfs property: If ZFS compression is enabled or not for the server group.
+ *
+ * @param enableZfs the enableZfs value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withEnableZfs(Boolean enableZfs) {
+ this.enableZfs = enableZfs;
+ return this;
+ }
+
+ /**
+ * Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the server group.
+ *
+ * @return the enableShardsOnCoordinator value.
+ */
+ public Boolean enableShardsOnCoordinator() {
+ return this.enableShardsOnCoordinator;
+ }
+
+ /**
+ * Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the server group.
+ *
+ * @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withEnableShardsOnCoordinator(Boolean enableShardsOnCoordinator) {
+ this.enableShardsOnCoordinator = enableShardsOnCoordinator;
+ return this;
+ }
+
+ /**
+ * Get the state property: A state of a server group that is visible to user.
+ *
+ * @return the state value.
+ */
+ public ServerState state() {
+ return this.state;
+ }
+
+ /**
+ * Get the earliestRestoreTime property: The earliest restore point time (ISO8601 format) for server group.
+ *
+ * @return the earliestRestoreTime value.
+ */
+ public OffsetDateTime earliestRestoreTime() {
+ return this.earliestRestoreTime;
+ }
+
+ /**
+ * Get the resourceProviderType property: The resource provider type of server group.
+ *
+ * @return the resourceProviderType value.
+ */
+ public ResourceProviderType resourceProviderType() {
+ return this.resourceProviderType;
+ }
+
+ /**
+ * Get the serverRoleGroups property: The list of server role groups.
+ *
+ * @return the serverRoleGroups value.
+ */
+ public List serverRoleGroups() {
+ return this.serverRoleGroups;
+ }
+
+ /**
+ * Set the serverRoleGroups property: The list of server role groups.
+ *
+ * @param serverRoleGroups the serverRoleGroups value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withServerRoleGroups(List serverRoleGroups) {
+ this.serverRoleGroups = serverRoleGroups;
+ return this;
+ }
+
+ /**
+ * Get the maintenanceWindow property: Maintenance window of a server group.
+ *
+ * @return the maintenanceWindow value.
+ */
+ public MaintenanceWindow maintenanceWindow() {
+ return this.maintenanceWindow;
+ }
+
+ /**
+ * Set the maintenanceWindow property: Maintenance window of a server group.
+ *
+ * @param maintenanceWindow the maintenanceWindow value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindow) {
+ this.maintenanceWindow = maintenanceWindow;
+ return this;
+ }
+
+ /**
+ * Get the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @return the availabilityZone value.
+ */
+ public String availabilityZone() {
+ return this.availabilityZone;
+ }
+
+ /**
+ * Set the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @param availabilityZone the availabilityZone value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withAvailabilityZone(String availabilityZone) {
+ this.availabilityZone = availabilityZone;
+ return this;
+ }
+
+ /**
+ * Get the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @return the standbyAvailabilityZone value.
+ */
+ public String standbyAvailabilityZone() {
+ return this.standbyAvailabilityZone;
+ }
+
+ /**
+ * Set the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @param standbyAvailabilityZone the standbyAvailabilityZone value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withStandbyAvailabilityZone(String standbyAvailabilityZone) {
+ this.standbyAvailabilityZone = standbyAvailabilityZone;
+ return this;
+ }
+
+ /**
+ * Get the delegatedSubnetArguments property: The delegated subnet arguments for a server group.
+ *
+ * @return the delegatedSubnetArguments value.
+ */
+ public ServerGroupPropertiesDelegatedSubnetArguments delegatedSubnetArguments() {
+ return this.delegatedSubnetArguments;
+ }
+
+ /**
+ * Set the delegatedSubnetArguments property: The delegated subnet arguments for a server group.
+ *
+ * @param delegatedSubnetArguments the delegatedSubnetArguments value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withDelegatedSubnetArguments(
+ ServerGroupPropertiesDelegatedSubnetArguments delegatedSubnetArguments) {
+ this.delegatedSubnetArguments = delegatedSubnetArguments;
+ return this;
+ }
+
+ /**
+ * Get the privateDnsZoneArguments property: The private dns zone arguments for a server group.
+ *
+ * @return the privateDnsZoneArguments value.
+ */
+ public ServerGroupPropertiesPrivateDnsZoneArguments privateDnsZoneArguments() {
+ return this.privateDnsZoneArguments;
+ }
+
+ /**
+ * Set the privateDnsZoneArguments property: The private dns zone arguments for a server group.
+ *
+ * @param privateDnsZoneArguments the privateDnsZoneArguments value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withPrivateDnsZoneArguments(
+ ServerGroupPropertiesPrivateDnsZoneArguments privateDnsZoneArguments) {
+ this.privateDnsZoneArguments = privateDnsZoneArguments;
+ return this;
+ }
+
+ /**
+ * Get the readReplicas property: The array of read replica server groups.
+ *
+ * @return the readReplicas value.
+ */
+ public List readReplicas() {
+ return this.readReplicas;
+ }
+
+ /**
+ * Get the sourceServerGroup property: The source server group id for read replica server groups.
+ *
+ * @return the sourceServerGroup value.
+ */
+ public String sourceServerGroup() {
+ return this.sourceServerGroup;
+ }
+
+ /**
+ * Get the sourceSubscriptionId property: The source subscription id to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceSubscriptionId value.
+ */
+ public String sourceSubscriptionId() {
+ return this.sourceSubscriptionId;
+ }
+
+ /**
+ * Set the sourceSubscriptionId property: The source subscription id to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceSubscriptionId the sourceSubscriptionId value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withSourceSubscriptionId(String sourceSubscriptionId) {
+ this.sourceSubscriptionId = sourceSubscriptionId;
+ return this;
+ }
+
+ /**
+ * Get the sourceResourceGroupName property: The source resource group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceResourceGroupName value.
+ */
+ public String sourceResourceGroupName() {
+ return this.sourceResourceGroupName;
+ }
+
+ /**
+ * Set the sourceResourceGroupName property: The source resource group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceResourceGroupName the sourceResourceGroupName value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withSourceResourceGroupName(String sourceResourceGroupName) {
+ this.sourceResourceGroupName = sourceResourceGroupName;
+ return this;
+ }
+
+ /**
+ * Get the sourceServerGroupName property: The source server group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceServerGroupName value.
+ */
+ public String sourceServerGroupName() {
+ return this.sourceServerGroupName;
+ }
+
+ /**
+ * Set the sourceServerGroupName property: The source server group name to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceServerGroupName the sourceServerGroupName value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withSourceServerGroupName(String sourceServerGroupName) {
+ this.sourceServerGroupName = sourceServerGroupName;
+ return this;
+ }
+
+ /**
+ * Get the sourceLocation property: The source server group location to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @return the sourceLocation value.
+ */
+ public String sourceLocation() {
+ return this.sourceLocation;
+ }
+
+ /**
+ * Set the sourceLocation property: The source server group location to restore from. It's required when
+ * 'createMode' is 'PointInTimeRestore' or 'ReadReplica'.
+ *
+ * @param sourceLocation the sourceLocation value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withSourceLocation(String sourceLocation) {
+ this.sourceLocation = sourceLocation;
+ return this;
+ }
+
+ /**
+ * Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
+ * from. It's required when 'createMode' is 'PointInTimeRestore'.
+ *
+ * @return the pointInTimeUtc value.
+ */
+ public OffsetDateTime pointInTimeUtc() {
+ return this.pointInTimeUtc;
+ }
+
+ /**
+ * Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
+ * from. It's required when 'createMode' is 'PointInTimeRestore'.
+ *
+ * @param pointInTimeUtc the pointInTimeUtc value to set.
+ * @return the ServerGroupProperties object itself.
+ */
+ public ServerGroupProperties withPointInTimeUtc(OffsetDateTime pointInTimeUtc) {
+ this.pointInTimeUtc = pointInTimeUtc;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (serverRoleGroups() != null) {
+ serverRoleGroups().forEach(e -> e.validate());
+ }
+ if (maintenanceWindow() != null) {
+ maintenanceWindow().validate();
+ }
+ if (delegatedSubnetArguments() != null) {
+ delegatedSubnetArguments().validate();
+ }
+ if (privateDnsZoneArguments() != null) {
+ privateDnsZoneArguments().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupPropertiesForUpdate.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupPropertiesForUpdate.java
new file mode 100644
index 0000000000000..b1a3d6040f794
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupPropertiesForUpdate.java
@@ -0,0 +1,269 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.CitusVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.MaintenanceWindow;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRoleGroup;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The properties used to update a server group. */
+@Fluent
+public final class ServerGroupPropertiesForUpdate {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupPropertiesForUpdate.class);
+
+ /*
+ * The password of the administrator login.
+ */
+ @JsonProperty(value = "administratorLoginPassword")
+ private String administratorLoginPassword;
+
+ /*
+ * The backup retention days for server group.
+ */
+ @JsonProperty(value = "backupRetentionDays")
+ private Integer backupRetentionDays;
+
+ /*
+ * The PostgreSQL version of server group.
+ */
+ @JsonProperty(value = "postgresqlVersion")
+ private PostgreSqlVersion postgresqlVersion;
+
+ /*
+ * The Citus version of server group.
+ */
+ @JsonProperty(value = "citusVersion")
+ private CitusVersion citusVersion;
+
+ /*
+ * If shards on coordinator is enabled or not for the server group.
+ */
+ @JsonProperty(value = "enableShardsOnCoordinator")
+ private Boolean enableShardsOnCoordinator;
+
+ /*
+ * The list of server role groups.
+ */
+ @JsonProperty(value = "serverRoleGroups")
+ private List serverRoleGroups;
+
+ /*
+ * Maintenance window of a server group.
+ */
+ @JsonProperty(value = "maintenanceWindow")
+ private MaintenanceWindow maintenanceWindow;
+
+ /*
+ * Availability Zone information of the server group.
+ */
+ @JsonProperty(value = "availabilityZone")
+ private String availabilityZone;
+
+ /*
+ * Standby Availability Zone information of the server group.
+ */
+ @JsonProperty(value = "standbyAvailabilityZone")
+ private String standbyAvailabilityZone;
+
+ /**
+ * Get the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @return the administratorLoginPassword value.
+ */
+ public String administratorLoginPassword() {
+ return this.administratorLoginPassword;
+ }
+
+ /**
+ * Set the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @param administratorLoginPassword the administratorLoginPassword value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withAdministratorLoginPassword(String administratorLoginPassword) {
+ this.administratorLoginPassword = administratorLoginPassword;
+ return this;
+ }
+
+ /**
+ * Get the backupRetentionDays property: The backup retention days for server group.
+ *
+ * @return the backupRetentionDays value.
+ */
+ public Integer backupRetentionDays() {
+ return this.backupRetentionDays;
+ }
+
+ /**
+ * Set the backupRetentionDays property: The backup retention days for server group.
+ *
+ * @param backupRetentionDays the backupRetentionDays value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withBackupRetentionDays(Integer backupRetentionDays) {
+ this.backupRetentionDays = backupRetentionDays;
+ return this;
+ }
+
+ /**
+ * Get the postgresqlVersion property: The PostgreSQL version of server group.
+ *
+ * @return the postgresqlVersion value.
+ */
+ public PostgreSqlVersion postgresqlVersion() {
+ return this.postgresqlVersion;
+ }
+
+ /**
+ * Set the postgresqlVersion property: The PostgreSQL version of server group.
+ *
+ * @param postgresqlVersion the postgresqlVersion value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withPostgresqlVersion(PostgreSqlVersion postgresqlVersion) {
+ this.postgresqlVersion = postgresqlVersion;
+ return this;
+ }
+
+ /**
+ * Get the citusVersion property: The Citus version of server group.
+ *
+ * @return the citusVersion value.
+ */
+ public CitusVersion citusVersion() {
+ return this.citusVersion;
+ }
+
+ /**
+ * Set the citusVersion property: The Citus version of server group.
+ *
+ * @param citusVersion the citusVersion value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withCitusVersion(CitusVersion citusVersion) {
+ this.citusVersion = citusVersion;
+ return this;
+ }
+
+ /**
+ * Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the server group.
+ *
+ * @return the enableShardsOnCoordinator value.
+ */
+ public Boolean enableShardsOnCoordinator() {
+ return this.enableShardsOnCoordinator;
+ }
+
+ /**
+ * Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the server group.
+ *
+ * @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withEnableShardsOnCoordinator(Boolean enableShardsOnCoordinator) {
+ this.enableShardsOnCoordinator = enableShardsOnCoordinator;
+ return this;
+ }
+
+ /**
+ * Get the serverRoleGroups property: The list of server role groups.
+ *
+ * @return the serverRoleGroups value.
+ */
+ public List serverRoleGroups() {
+ return this.serverRoleGroups;
+ }
+
+ /**
+ * Set the serverRoleGroups property: The list of server role groups.
+ *
+ * @param serverRoleGroups the serverRoleGroups value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withServerRoleGroups(List serverRoleGroups) {
+ this.serverRoleGroups = serverRoleGroups;
+ return this;
+ }
+
+ /**
+ * Get the maintenanceWindow property: Maintenance window of a server group.
+ *
+ * @return the maintenanceWindow value.
+ */
+ public MaintenanceWindow maintenanceWindow() {
+ return this.maintenanceWindow;
+ }
+
+ /**
+ * Set the maintenanceWindow property: Maintenance window of a server group.
+ *
+ * @param maintenanceWindow the maintenanceWindow value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withMaintenanceWindow(MaintenanceWindow maintenanceWindow) {
+ this.maintenanceWindow = maintenanceWindow;
+ return this;
+ }
+
+ /**
+ * Get the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @return the availabilityZone value.
+ */
+ public String availabilityZone() {
+ return this.availabilityZone;
+ }
+
+ /**
+ * Set the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @param availabilityZone the availabilityZone value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withAvailabilityZone(String availabilityZone) {
+ this.availabilityZone = availabilityZone;
+ return this;
+ }
+
+ /**
+ * Get the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @return the standbyAvailabilityZone value.
+ */
+ public String standbyAvailabilityZone() {
+ return this.standbyAvailabilityZone;
+ }
+
+ /**
+ * Set the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @param standbyAvailabilityZone the standbyAvailabilityZone value to set.
+ * @return the ServerGroupPropertiesForUpdate object itself.
+ */
+ public ServerGroupPropertiesForUpdate withStandbyAvailabilityZone(String standbyAvailabilityZone) {
+ this.standbyAvailabilityZone = standbyAvailabilityZone;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (serverRoleGroups() != null) {
+ serverRoleGroups().forEach(e -> e.validate());
+ }
+ if (maintenanceWindow() != null) {
+ maintenanceWindow().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupServerInner.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupServerInner.java
new file mode 100644
index 0000000000000..8bc7d7d6afff0
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupServerInner.java
@@ -0,0 +1,331 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.CitusVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerEdition;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerHaState;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRole;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerState;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Represents a server in a server group. */
+@Fluent
+public final class ServerGroupServerInner extends ProxyResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupServerInner.class);
+
+ /*
+ * The system metadata relating to this resource
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * The properties of a server in a server group.
+ */
+ @JsonProperty(value = "properties")
+ private ServerGroupServerProperties innerProperties;
+
+ /**
+ * Get the systemData property: The system metadata relating to this resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the innerProperties property: The properties of a server in a server group.
+ *
+ * @return the innerProperties value.
+ */
+ private ServerGroupServerProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the fullyQualifiedDomainName property: The fully qualified domain name of a server.
+ *
+ * @return the fullyQualifiedDomainName value.
+ */
+ public String fullyQualifiedDomainName() {
+ return this.innerProperties() == null ? null : this.innerProperties().fullyQualifiedDomainName();
+ }
+
+ /**
+ * Get the role property: The role of server in the server group.
+ *
+ * @return the role value.
+ */
+ public ServerRole role() {
+ return this.innerProperties() == null ? null : this.innerProperties().role();
+ }
+
+ /**
+ * Set the role property: The role of server in the server group.
+ *
+ * @param role the role value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withRole(ServerRole role) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withRole(role);
+ return this;
+ }
+
+ /**
+ * Get the state property: A state of a server that is visible to user.
+ *
+ * @return the state value.
+ */
+ public ServerState state() {
+ return this.innerProperties() == null ? null : this.innerProperties().state();
+ }
+
+ /**
+ * Get the haState property: A state of a server group that is visible to user for HA feature.
+ *
+ * @return the haState value.
+ */
+ public ServerHaState haState() {
+ return this.innerProperties() == null ? null : this.innerProperties().haState();
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login name of a servers in server group.
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.innerProperties() == null ? null : this.innerProperties().administratorLogin();
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login name of a servers in server group.
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withAdministratorLogin(String administratorLogin) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withAdministratorLogin(administratorLogin);
+ return this;
+ }
+
+ /**
+ * Get the postgresqlVersion property: The PostgreSQL version of server.
+ *
+ * @return the postgresqlVersion value.
+ */
+ public PostgreSqlVersion postgresqlVersion() {
+ return this.innerProperties() == null ? null : this.innerProperties().postgresqlVersion();
+ }
+
+ /**
+ * Set the postgresqlVersion property: The PostgreSQL version of server.
+ *
+ * @param postgresqlVersion the postgresqlVersion value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withPostgresqlVersion(PostgreSqlVersion postgresqlVersion) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withPostgresqlVersion(postgresqlVersion);
+ return this;
+ }
+
+ /**
+ * Get the citusVersion property: The Citus version of server.
+ *
+ * @return the citusVersion value.
+ */
+ public CitusVersion citusVersion() {
+ return this.innerProperties() == null ? null : this.innerProperties().citusVersion();
+ }
+
+ /**
+ * Set the citusVersion property: The Citus version of server.
+ *
+ * @param citusVersion the citusVersion value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withCitusVersion(CitusVersion citusVersion) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withCitusVersion(citusVersion);
+ return this;
+ }
+
+ /**
+ * Get the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @return the availabilityZone value.
+ */
+ public String availabilityZone() {
+ return this.innerProperties() == null ? null : this.innerProperties().availabilityZone();
+ }
+
+ /**
+ * Set the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @param availabilityZone the availabilityZone value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withAvailabilityZone(String availabilityZone) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withAvailabilityZone(availabilityZone);
+ return this;
+ }
+
+ /**
+ * Get the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @return the standbyAvailabilityZone value.
+ */
+ public String standbyAvailabilityZone() {
+ return this.innerProperties() == null ? null : this.innerProperties().standbyAvailabilityZone();
+ }
+
+ /**
+ * Set the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @param standbyAvailabilityZone the standbyAvailabilityZone value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withStandbyAvailabilityZone(String standbyAvailabilityZone) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withStandbyAvailabilityZone(standbyAvailabilityZone);
+ return this;
+ }
+
+ /**
+ * Get the serverEdition property: The edition of a server (default: GeneralPurpose).
+ *
+ * @return the serverEdition value.
+ */
+ public ServerEdition serverEdition() {
+ return this.innerProperties() == null ? null : this.innerProperties().serverEdition();
+ }
+
+ /**
+ * Set the serverEdition property: The edition of a server (default: GeneralPurpose).
+ *
+ * @param serverEdition the serverEdition value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withServerEdition(ServerEdition serverEdition) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withServerEdition(serverEdition);
+ return this;
+ }
+
+ /**
+ * Get the storageQuotaInMb property: The storage of a server in MB (max: 2097152 = 2TiB).
+ *
+ * @return the storageQuotaInMb value.
+ */
+ public Long storageQuotaInMb() {
+ return this.innerProperties() == null ? null : this.innerProperties().storageQuotaInMb();
+ }
+
+ /**
+ * Set the storageQuotaInMb property: The storage of a server in MB (max: 2097152 = 2TiB).
+ *
+ * @param storageQuotaInMb the storageQuotaInMb value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withStorageQuotaInMb(Long storageQuotaInMb) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withStorageQuotaInMb(storageQuotaInMb);
+ return this;
+ }
+
+ /**
+ * Get the vCores property: The vCores count of a server (max: 64).
+ *
+ * @return the vCores value.
+ */
+ public Long vCores() {
+ return this.innerProperties() == null ? null : this.innerProperties().vCores();
+ }
+
+ /**
+ * Set the vCores property: The vCores count of a server (max: 64).
+ *
+ * @param vCores the vCores value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withVCores(Long vCores) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withVCores(vCores);
+ return this;
+ }
+
+ /**
+ * Get the enableHa property: If high availability is enabled or not for the server.
+ *
+ * @return the enableHa value.
+ */
+ public Boolean enableHa() {
+ return this.innerProperties() == null ? null : this.innerProperties().enableHa();
+ }
+
+ /**
+ * Set the enableHa property: If high availability is enabled or not for the server.
+ *
+ * @param enableHa the enableHa value to set.
+ * @return the ServerGroupServerInner object itself.
+ */
+ public ServerGroupServerInner withEnableHa(Boolean enableHa) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ServerGroupServerProperties();
+ }
+ this.innerProperties().withEnableHa(enableHa);
+ return this;
+ }
+
+ /**
+ * Get the enablePublicIp property: If public IP is requested or not for a server.
+ *
+ * @return the enablePublicIp value.
+ */
+ public Boolean enablePublicIp() {
+ return this.innerProperties() == null ? null : this.innerProperties().enablePublicIp();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupServerProperties.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupServerProperties.java
new file mode 100644
index 0000000000000..c8344d3e02f4c
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/ServerGroupServerProperties.java
@@ -0,0 +1,262 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlhsc.models.CitusVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.PostgreSqlVersion;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerEdition;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerHaState;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerProperties;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerRole;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerState;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of a server in server group. */
+@Fluent
+public final class ServerGroupServerProperties extends ServerProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerGroupServerProperties.class);
+
+ /*
+ * The fully qualified domain name of a server.
+ */
+ @JsonProperty(value = "fullyQualifiedDomainName", access = JsonProperty.Access.WRITE_ONLY)
+ private String fullyQualifiedDomainName;
+
+ /*
+ * The role of server in the server group.
+ */
+ @JsonProperty(value = "role")
+ private ServerRole role;
+
+ /*
+ * A state of a server that is visible to user.
+ */
+ @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY)
+ private ServerState state;
+
+ /*
+ * A state of a server group that is visible to user for HA feature.
+ */
+ @JsonProperty(value = "haState", access = JsonProperty.Access.WRITE_ONLY)
+ private ServerHaState haState;
+
+ /*
+ * The administrator's login name of a servers in server group.
+ */
+ @JsonProperty(value = "administratorLogin")
+ private String administratorLogin;
+
+ /*
+ * The PostgreSQL version of server.
+ */
+ @JsonProperty(value = "postgresqlVersion")
+ private PostgreSqlVersion postgresqlVersion;
+
+ /*
+ * The Citus version of server.
+ */
+ @JsonProperty(value = "citusVersion")
+ private CitusVersion citusVersion;
+
+ /*
+ * Availability Zone information of the server group.
+ */
+ @JsonProperty(value = "availabilityZone")
+ private String availabilityZone;
+
+ /*
+ * Standby Availability Zone information of the server group.
+ */
+ @JsonProperty(value = "standbyAvailabilityZone")
+ private String standbyAvailabilityZone;
+
+ /**
+ * Get the fullyQualifiedDomainName property: The fully qualified domain name of a server.
+ *
+ * @return the fullyQualifiedDomainName value.
+ */
+ public String fullyQualifiedDomainName() {
+ return this.fullyQualifiedDomainName;
+ }
+
+ /**
+ * Get the role property: The role of server in the server group.
+ *
+ * @return the role value.
+ */
+ public ServerRole role() {
+ return this.role;
+ }
+
+ /**
+ * Set the role property: The role of server in the server group.
+ *
+ * @param role the role value to set.
+ * @return the ServerGroupServerProperties object itself.
+ */
+ public ServerGroupServerProperties withRole(ServerRole role) {
+ this.role = role;
+ return this;
+ }
+
+ /**
+ * Get the state property: A state of a server that is visible to user.
+ *
+ * @return the state value.
+ */
+ public ServerState state() {
+ return this.state;
+ }
+
+ /**
+ * Get the haState property: A state of a server group that is visible to user for HA feature.
+ *
+ * @return the haState value.
+ */
+ public ServerHaState haState() {
+ return this.haState;
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login name of a servers in server group.
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.administratorLogin;
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login name of a servers in server group.
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the ServerGroupServerProperties object itself.
+ */
+ public ServerGroupServerProperties withAdministratorLogin(String administratorLogin) {
+ this.administratorLogin = administratorLogin;
+ return this;
+ }
+
+ /**
+ * Get the postgresqlVersion property: The PostgreSQL version of server.
+ *
+ * @return the postgresqlVersion value.
+ */
+ public PostgreSqlVersion postgresqlVersion() {
+ return this.postgresqlVersion;
+ }
+
+ /**
+ * Set the postgresqlVersion property: The PostgreSQL version of server.
+ *
+ * @param postgresqlVersion the postgresqlVersion value to set.
+ * @return the ServerGroupServerProperties object itself.
+ */
+ public ServerGroupServerProperties withPostgresqlVersion(PostgreSqlVersion postgresqlVersion) {
+ this.postgresqlVersion = postgresqlVersion;
+ return this;
+ }
+
+ /**
+ * Get the citusVersion property: The Citus version of server.
+ *
+ * @return the citusVersion value.
+ */
+ public CitusVersion citusVersion() {
+ return this.citusVersion;
+ }
+
+ /**
+ * Set the citusVersion property: The Citus version of server.
+ *
+ * @param citusVersion the citusVersion value to set.
+ * @return the ServerGroupServerProperties object itself.
+ */
+ public ServerGroupServerProperties withCitusVersion(CitusVersion citusVersion) {
+ this.citusVersion = citusVersion;
+ return this;
+ }
+
+ /**
+ * Get the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @return the availabilityZone value.
+ */
+ public String availabilityZone() {
+ return this.availabilityZone;
+ }
+
+ /**
+ * Set the availabilityZone property: Availability Zone information of the server group.
+ *
+ * @param availabilityZone the availabilityZone value to set.
+ * @return the ServerGroupServerProperties object itself.
+ */
+ public ServerGroupServerProperties withAvailabilityZone(String availabilityZone) {
+ this.availabilityZone = availabilityZone;
+ return this;
+ }
+
+ /**
+ * Get the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @return the standbyAvailabilityZone value.
+ */
+ public String standbyAvailabilityZone() {
+ return this.standbyAvailabilityZone;
+ }
+
+ /**
+ * Set the standbyAvailabilityZone property: Standby Availability Zone information of the server group.
+ *
+ * @param standbyAvailabilityZone the standbyAvailabilityZone value to set.
+ * @return the ServerGroupServerProperties object itself.
+ */
+ public ServerGroupServerProperties withStandbyAvailabilityZone(String standbyAvailabilityZone) {
+ this.standbyAvailabilityZone = standbyAvailabilityZone;
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServerGroupServerProperties withServerEdition(ServerEdition serverEdition) {
+ super.withServerEdition(serverEdition);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServerGroupServerProperties withStorageQuotaInMb(Long storageQuotaInMb) {
+ super.withStorageQuotaInMb(storageQuotaInMb);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServerGroupServerProperties withVCores(Long vCores) {
+ super.withVCores(vCores);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServerGroupServerProperties withEnableHa(Boolean enableHa) {
+ super.withEnableHa(enableHa);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/package-info.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/package-info.java
new file mode 100644
index 0000000000000..d1567ccf7b143
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/models/package-info.java
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the inner data models for MicrosoftPostgreSqlHyperscale. The Microsoft Azure management API
+ * provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including
+ * server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations.
+ */
+package com.azure.resourcemanager.postgresqlhsc.fluent.models;
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/package-info.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/package-info.java
new file mode 100644
index 0000000000000..523ce5a767806
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/fluent/package-info.java
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the service clients for MicrosoftPostgreSqlHyperscale. The Microsoft Azure management API provides
+ * create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server
+ * groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations.
+ */
+package com.azure.resourcemanager.postgresqlhsc.fluent;
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/ConfigurationsClientImpl.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/ConfigurationsClientImpl.java
new file mode 100644
index 0000000000000..aeb2f4cf61bca
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/ConfigurationsClientImpl.java
@@ -0,0 +1,1178 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.implementation;
+
+import com.azure.core.annotation.BodyParam;
+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.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlhsc.fluent.ConfigurationsClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerConfigurationInner;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerGroupConfigurationInner;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerConfigurationListResult;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupConfigurationListResult;
+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 ConfigurationsClient. */
+public final class ConfigurationsClientImpl implements ConfigurationsClient {
+ private final ClientLogger logger = new ClientLogger(ConfigurationsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final ConfigurationsService service;
+
+ /** The service client containing this operation class. */
+ private final MicrosoftPostgreSqlHyperscaleImpl client;
+
+ /**
+ * Initializes an instance of ConfigurationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ConfigurationsClientImpl(MicrosoftPostgreSqlHyperscaleImpl client) {
+ this.service =
+ RestProxy.create(ConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftPostgreSqlHyperscaleConfigurations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftPostgreSqlH")
+ private interface ConfigurationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/servers/{serverName}/configurations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServer(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @PathParam("serverName") String serverName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/configurations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServerGroup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/configurations/{configurationName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @PathParam("configurationName") String configurationName,
+ @BodyParam("application/json") ServerGroupConfigurationInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/configurations/{configurationName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @PathParam("configurationName") String configurationName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServerNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServerGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, String serverGroupName, String serverName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByServer(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ serverName,
+ 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 all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, String serverGroupName, String serverName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServer(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ serverName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerAsync(
+ String resourceGroupName, String serverGroupName, String serverName) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverGroupName, serverName),
+ nextLink -> listByServerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerAsync(
+ String resourceGroupName, String serverGroupName, String serverName, Context context) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverGroupName, serverName, context),
+ nextLink -> listByServerNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverGroupName, String serverName) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverGroupName, serverName));
+ }
+
+ /**
+ * List all the configurations of a server in server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param serverName The name of the server.
+ * @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 server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverGroupName, String serverName, Context context) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverGroupName, serverName, context));
+ }
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerGroupSinglePageAsync(
+ String resourceGroupName, String serverGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByServerGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ 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 all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerGroupSinglePageAsync(
+ String resourceGroupName, String serverGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServerGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerGroupAsync(
+ String resourceGroupName, String serverGroupName) {
+ return new PagedFlux<>(
+ () -> listByServerGroupSinglePageAsync(resourceGroupName, serverGroupName),
+ nextLink -> listByServerGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerGroupAsync(
+ String resourceGroupName, String serverGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByServerGroupSinglePageAsync(resourceGroupName, serverGroupName, context),
+ nextLink -> listByServerGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName) {
+ return new PagedIterable<>(listByServerGroupAsync(resourceGroupName, serverGroupName));
+ }
+
+ /**
+ * List all the configurations of a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context) {
+ return new PagedIterable<>(listByServerGroupAsync(resourceGroupName, serverGroupName, context));
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (configurationName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ configurationName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (configurationName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ configurationName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ServerGroupConfigurationInner> beginUpdateAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters) {
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, serverGroupName, configurationName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ServerGroupConfigurationInner.class,
+ ServerGroupConfigurationInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ServerGroupConfigurationInner> beginUpdateAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, serverGroupName, configurationName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ServerGroupConfigurationInner.class,
+ ServerGroupConfigurationInner.class,
+ context);
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ServerGroupConfigurationInner> beginUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters) {
+ return beginUpdateAsync(resourceGroupName, serverGroupName, configurationName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ServerGroupConfigurationInner> beginUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, serverGroupName, configurationName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters) {
+ return beginUpdateAsync(resourceGroupName, serverGroupName, configurationName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, serverGroupName, configurationName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ServerGroupConfigurationInner update(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters) {
+ return updateAsync(resourceGroupName, serverGroupName, configurationName, parameters).block();
+ }
+
+ /**
+ * Updates configuration of server role groups in a server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @param parameters The required parameters for updating a server group configuration.
+ * @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 configuration list of server role groups in a server group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ServerGroupConfigurationInner update(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context) {
+ return updateAsync(resourceGroupName, serverGroupName, configurationName, parameters, context).block();
+ }
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String configurationName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (configurationName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ configurationName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String configurationName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (configurationName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ configurationName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String resourceGroupName, String serverGroupName, String configurationName) {
+ return getWithResponseAsync(resourceGroupName, serverGroupName, configurationName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ServerGroupConfigurationInner get(
+ String resourceGroupName, String serverGroupName, String configurationName) {
+ return getAsync(resourceGroupName, serverGroupName, configurationName).block();
+ }
+
+ /**
+ * Gets information about single server group configuration.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param configurationName The name of the server group configuration.
+ * @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 single server group configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String configurationName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serverGroupName, configurationName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByServerNext(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 nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of server configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServerNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByServerGroupNext(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 nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of server group configurations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServerGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/ConfigurationsImpl.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/ConfigurationsImpl.java
new file mode 100644
index 0000000000000..239b9dc35d37c
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/ConfigurationsImpl.java
@@ -0,0 +1,121 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.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.postgresqlhsc.fluent.ConfigurationsClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerConfigurationInner;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.ServerGroupConfigurationInner;
+import com.azure.resourcemanager.postgresqlhsc.models.Configurations;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerConfiguration;
+import com.azure.resourcemanager.postgresqlhsc.models.ServerGroupConfiguration;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class ConfigurationsImpl implements Configurations {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationsImpl.class);
+
+ private final ConfigurationsClient innerClient;
+
+ private final com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager;
+
+ public ConfigurationsImpl(
+ ConfigurationsClient innerClient, com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverGroupName, String serverName) {
+ PagedIterable inner =
+ this.serviceClient().listByServer(resourceGroupName, serverGroupName, serverName);
+ return Utils.mapPage(inner, inner1 -> new ServerConfigurationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverGroupName, String serverName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByServer(resourceGroupName, serverGroupName, serverName, context);
+ return Utils.mapPage(inner, inner1 -> new ServerConfigurationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName) {
+ PagedIterable inner =
+ this.serviceClient().listByServerGroup(resourceGroupName, serverGroupName);
+ return Utils.mapPage(inner, inner1 -> new ServerGroupConfigurationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByServerGroup(resourceGroupName, serverGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new ServerGroupConfigurationImpl(inner1, this.manager()));
+ }
+
+ public ServerGroupConfiguration update(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters) {
+ ServerGroupConfigurationInner inner =
+ this.serviceClient().update(resourceGroupName, serverGroupName, configurationName, parameters);
+ if (inner != null) {
+ return new ServerGroupConfigurationImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public ServerGroupConfiguration update(
+ String resourceGroupName,
+ String serverGroupName,
+ String configurationName,
+ ServerGroupConfigurationInner parameters,
+ Context context) {
+ ServerGroupConfigurationInner inner =
+ this.serviceClient().update(resourceGroupName, serverGroupName, configurationName, parameters, context);
+ if (inner != null) {
+ return new ServerGroupConfigurationImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public ServerGroupConfiguration get(String resourceGroupName, String serverGroupName, String configurationName) {
+ ServerGroupConfigurationInner inner =
+ this.serviceClient().get(resourceGroupName, serverGroupName, configurationName);
+ if (inner != null) {
+ return new ServerGroupConfigurationImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String configurationName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, serverGroupName, configurationName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new ServerGroupConfigurationImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ private ConfigurationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRuleImpl.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRuleImpl.java
new file mode 100644
index 0000000000000..24392cfe6ae0f
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRuleImpl.java
@@ -0,0 +1,145 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.FirewallRuleInner;
+import com.azure.resourcemanager.postgresqlhsc.models.FirewallRule;
+
+public final class FirewallRuleImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update {
+ private FirewallRuleInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String startIpAddress() {
+ return this.innerModel().startIpAddress();
+ }
+
+ public String endIpAddress() {
+ return this.innerModel().endIpAddress();
+ }
+
+ public FirewallRuleInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String serverGroupName;
+
+ private String firewallRuleName;
+
+ public FirewallRuleImpl withExistingServerGroupsv2(String resourceGroupName, String serverGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ this.serverGroupName = serverGroupName;
+ return this;
+ }
+
+ public FirewallRule create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, serverGroupName, firewallRuleName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public FirewallRule create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, serverGroupName, firewallRuleName, this.innerModel(), context);
+ return this;
+ }
+
+ FirewallRuleImpl(String name, com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager) {
+ this.innerObject = new FirewallRuleInner();
+ this.serviceManager = serviceManager;
+ this.firewallRuleName = name;
+ }
+
+ public FirewallRuleImpl update() {
+ return this;
+ }
+
+ public FirewallRule apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, serverGroupName, firewallRuleName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public FirewallRule apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, serverGroupName, firewallRuleName, this.innerModel(), context);
+ return this;
+ }
+
+ FirewallRuleImpl(
+ FirewallRuleInner innerObject, com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.serverGroupName = Utils.getValueFromIdByName(innerObject.id(), "serverGroupsv2");
+ this.firewallRuleName = Utils.getValueFromIdByName(innerObject.id(), "firewallRules");
+ }
+
+ public FirewallRule refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getFirewallRules()
+ .getWithResponse(resourceGroupName, serverGroupName, firewallRuleName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public FirewallRule refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getFirewallRules()
+ .getWithResponse(resourceGroupName, serverGroupName, firewallRuleName, context)
+ .getValue();
+ return this;
+ }
+
+ public FirewallRuleImpl withStartIpAddress(String startIpAddress) {
+ this.innerModel().withStartIpAddress(startIpAddress);
+ return this;
+ }
+
+ public FirewallRuleImpl withEndIpAddress(String endIpAddress) {
+ this.innerModel().withEndIpAddress(endIpAddress);
+ return this;
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRulesClientImpl.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRulesClientImpl.java
new file mode 100644
index 0000000000000..35f3cb4876723
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRulesClientImpl.java
@@ -0,0 +1,1037 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.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.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlhsc.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.FirewallRuleInner;
+import com.azure.resourcemanager.postgresqlhsc.models.FirewallRuleListResult;
+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 FirewallRulesClient. */
+public final class FirewallRulesClientImpl implements FirewallRulesClient {
+ private final ClientLogger logger = new ClientLogger(FirewallRulesClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final FirewallRulesService service;
+
+ /** The service client containing this operation class. */
+ private final MicrosoftPostgreSqlHyperscaleImpl client;
+
+ /**
+ * Initializes an instance of FirewallRulesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ FirewallRulesClientImpl(MicrosoftPostgreSqlHyperscaleImpl client) {
+ this.service =
+ RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftPostgreSqlHyperscaleFirewallRules to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftPostgreSqlH")
+ private interface FirewallRulesService {
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({200, 201, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @PathParam("firewallRuleName") String firewallRuleName,
+ @BodyParam("application/json") FirewallRuleInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @PathParam("firewallRuleName") String firewallRuleName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @PathParam("firewallRuleName") String firewallRuleName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql"
+ + "/serverGroupsv2/{serverGroupName}/firewallRules")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServerGroup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverGroupName") String serverGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ firewallRuleName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ firewallRuleName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, FirewallRuleInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ FirewallRuleInner.class,
+ FirewallRuleInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, FirewallRuleInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), FirewallRuleInner.class, FirewallRuleInner.class, context);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, FirewallRuleInner> beginCreateOrUpdate(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, FirewallRuleInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FirewallRuleInner createOrUpdate(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, FirewallRuleInner parameters) {
+ return createOrUpdateAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters).block();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group firewall rule.
+ * @param parameters The required parameters for creating or updating a 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 represents a server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FirewallRuleInner createOrUpdate(
+ String resourceGroupName,
+ String serverGroupName,
+ String firewallRuleName,
+ FirewallRuleInner parameters,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, serverGroupName, firewallRuleName, parameters, context).block();
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ firewallRuleName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ firewallRuleName,
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, serverGroupName, firewallRuleName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, serverGroupName, firewallRuleName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ return beginDeleteAsync(resourceGroupName, serverGroupName, firewallRuleName).getSyncPoller();
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ return beginDeleteAsync(resourceGroupName, serverGroupName, firewallRuleName, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ return beginDeleteAsync(resourceGroupName, serverGroupName, firewallRuleName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ return beginDeleteAsync(resourceGroupName, serverGroupName, firewallRuleName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 serverGroupName, String firewallRuleName) {
+ deleteAsync(resourceGroupName, serverGroupName, firewallRuleName).block();
+ }
+
+ /**
+ * Deletes a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 serverGroupName, String firewallRuleName, Context context) {
+ deleteAsync(resourceGroupName, serverGroupName, firewallRuleName, context).block();
+ }
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ firewallRuleName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ firewallRuleName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ return getWithResponseAsync(resourceGroupName, serverGroupName, firewallRuleName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FirewallRuleInner get(String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ return getAsync(resourceGroupName, serverGroupName, firewallRuleName).block();
+ }
+
+ /**
+ * Gets information about a server group firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server group.
+ * @param firewallRuleName The name of the server group 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 server group firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serverGroupName, firewallRuleName, context).block();
+ }
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerGroupSinglePageAsync(
+ String resourceGroupName, String serverGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByServerGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerGroupSinglePageAsync(
+ String resourceGroupName, String serverGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter serverGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServerGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverGroupName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
+ }
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerGroupAsync(String resourceGroupName, String serverGroupName) {
+ return new PagedFlux<>(() -> listByServerGroupSinglePageAsync(resourceGroupName, serverGroupName));
+ }
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerGroupAsync(
+ String resourceGroupName, String serverGroupName, Context context) {
+ return new PagedFlux<>(() -> listByServerGroupSinglePageAsync(resourceGroupName, serverGroupName, context));
+ }
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName) {
+ return new PagedIterable<>(listByServerGroupAsync(resourceGroupName, serverGroupName));
+ }
+
+ /**
+ * List all the firewall rules in a given server group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverGroupName The name of the server 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 a list of firewall rules.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context) {
+ return new PagedIterable<>(listByServerGroupAsync(resourceGroupName, serverGroupName, context));
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRulesImpl.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRulesImpl.java
new file mode 100644
index 0000000000000..9d4810015cb77
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/FirewallRulesImpl.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.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.postgresqlhsc.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.models.FirewallRuleInner;
+import com.azure.resourcemanager.postgresqlhsc.models.FirewallRule;
+import com.azure.resourcemanager.postgresqlhsc.models.FirewallRules;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class FirewallRulesImpl implements FirewallRules {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRulesImpl.class);
+
+ private final FirewallRulesClient innerClient;
+
+ private final com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager;
+
+ public FirewallRulesImpl(
+ FirewallRulesClient innerClient, com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public void delete(String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ this.serviceClient().delete(resourceGroupName, serverGroupName, firewallRuleName);
+ }
+
+ public void delete(String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ this.serviceClient().delete(resourceGroupName, serverGroupName, firewallRuleName, context);
+ }
+
+ public FirewallRule get(String resourceGroupName, String serverGroupName, String firewallRuleName) {
+ FirewallRuleInner inner = this.serviceClient().get(resourceGroupName, serverGroupName, firewallRuleName);
+ if (inner != null) {
+ return new FirewallRuleImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String serverGroupName, String firewallRuleName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, serverGroupName, firewallRuleName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new FirewallRuleImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public PagedIterable listByServerGroup(String resourceGroupName, String serverGroupName) {
+ PagedIterable inner =
+ this.serviceClient().listByServerGroup(resourceGroupName, serverGroupName);
+ return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServerGroup(
+ String resourceGroupName, String serverGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByServerGroup(resourceGroupName, serverGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
+ }
+
+ public FirewallRule getById(String id) {
+ String resourceGroupName = Utils.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 serverGroupName = Utils.getValueFromIdByName(id, "serverGroupsv2");
+ if (serverGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'serverGroupsv2'.", id)));
+ }
+ String firewallRuleName = Utils.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, serverGroupName, firewallRuleName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.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 serverGroupName = Utils.getValueFromIdByName(id, "serverGroupsv2");
+ if (serverGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'serverGroupsv2'.", id)));
+ }
+ String firewallRuleName = Utils.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, serverGroupName, firewallRuleName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.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 serverGroupName = Utils.getValueFromIdByName(id, "serverGroupsv2");
+ if (serverGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'serverGroupsv2'.", id)));
+ }
+ String firewallRuleName = Utils.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, serverGroupName, firewallRuleName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.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 serverGroupName = Utils.getValueFromIdByName(id, "serverGroupsv2");
+ if (serverGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'serverGroupsv2'.", id)));
+ }
+ String firewallRuleName = Utils.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, serverGroupName, firewallRuleName, context);
+ }
+
+ private FirewallRulesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.postgresqlhsc.PostgresqlhscManager manager() {
+ return this.serviceManager;
+ }
+
+ public FirewallRuleImpl define(String name) {
+ return new FirewallRuleImpl(name, this.manager());
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/MicrosoftPostgreSqlHyperscaleBuilder.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/MicrosoftPostgreSqlHyperscaleBuilder.java
new file mode 100644
index 0000000000000..0007d8332bab7
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/MicrosoftPostgreSqlHyperscaleBuilder.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.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.CookiePolicy;
+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 MicrosoftPostgreSqlHyperscaleImpl type. */
+@ServiceClientBuilder(serviceClients = {MicrosoftPostgreSqlHyperscaleImpl.class})
+public final class MicrosoftPostgreSqlHyperscaleBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the MicrosoftPostgreSqlHyperscaleBuilder.
+ */
+ public MicrosoftPostgreSqlHyperscaleBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the MicrosoftPostgreSqlHyperscaleBuilder.
+ */
+ public MicrosoftPostgreSqlHyperscaleBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the MicrosoftPostgreSqlHyperscaleBuilder.
+ */
+ public MicrosoftPostgreSqlHyperscaleBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ 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 MicrosoftPostgreSqlHyperscaleBuilder.
+ */
+ public MicrosoftPostgreSqlHyperscaleBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ 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 MicrosoftPostgreSqlHyperscaleBuilder.
+ */
+ public MicrosoftPostgreSqlHyperscaleBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ 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 MicrosoftPostgreSqlHyperscaleBuilder.
+ */
+ public MicrosoftPostgreSqlHyperscaleBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of MicrosoftPostgreSqlHyperscaleImpl with the provided parameters.
+ *
+ * @return an instance of MicrosoftPostgreSqlHyperscaleImpl.
+ */
+ public MicrosoftPostgreSqlHyperscaleImpl buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ if (pipeline == null) {
+ this.pipeline =
+ new HttpPipelineBuilder()
+ .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
+ .build();
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
+ }
+ MicrosoftPostgreSqlHyperscaleImpl client =
+ new MicrosoftPostgreSqlHyperscaleImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/MicrosoftPostgreSqlHyperscaleImpl.java b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/MicrosoftPostgreSqlHyperscaleImpl.java
new file mode 100644
index 0000000000000..53d9c2a1f8f62
--- /dev/null
+++ b/sdk/postgresqlhsc/azure-resourcemanager-postgresqlhsc/src/main/java/com/azure/resourcemanager/postgresqlhsc/implementation/MicrosoftPostgreSqlHyperscaleImpl.java
@@ -0,0 +1,363 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlhsc.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+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.util.Context;
+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.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.postgresqlhsc.fluent.ConfigurationsClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.MicrosoftPostgreSqlHyperscale;
+import com.azure.resourcemanager.postgresqlhsc.fluent.OperationsClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.RolesClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.ServerGroupsClient;
+import com.azure.resourcemanager.postgresqlhsc.fluent.ServersClient;
+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 java.util.Map;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the MicrosoftPostgreSqlHyperscaleImpl type. */
+@ServiceClient(builder = MicrosoftPostgreSqlHyperscaleBuilder.class)
+public final class MicrosoftPostgreSqlHyperscaleImpl implements MicrosoftPostgreSqlHyperscale {
+ private final ClientLogger logger = new ClientLogger(MicrosoftPostgreSqlHyperscaleImpl.class);
+
+ /** The ID of the target subscription. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ 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 ServerGroupsClient object to access its operations. */
+ private final ServerGroupsClient serverGroups;
+
+ /**
+ * Gets the ServerGroupsClient object to access its operations.
+ *
+ * @return the ServerGroupsClient object.
+ */
+ public ServerGroupsClient getServerGroups() {
+ return this.serverGroups;
+ }
+
+ /** The ServersClient object to access its operations. */
+ private final ServersClient servers;
+
+ /**
+ * Gets the ServersClient object to access its operations.
+ *
+ * @return the ServersClient object.
+ */
+ public ServersClient getServers() {
+ return this.servers;
+ }
+
+ /** The ConfigurationsClient object to access its operations. */
+ private final ConfigurationsClient configurations;
+
+ /**
+ * Gets the ConfigurationsClient object to access its operations.
+ *
+ * @return the ConfigurationsClient object.
+ */
+ public ConfigurationsClient getConfigurations() {
+ return this.configurations;
+ }
+
+ /** The FirewallRulesClient object to access its operations. */
+ private final FirewallRulesClient firewallRules;
+
+ /**
+ * Gets the FirewallRulesClient object to access its operations.
+ *
+ * @return the FirewallRulesClient object.
+ */
+ public FirewallRulesClient getFirewallRules() {
+ return this.firewallRules;
+ }
+
+ /** The RolesClient object to access its operations. */
+ private final RolesClient roles;
+
+ /**
+ * Gets the RolesClient object to access its operations.
+ *
+ * @return the RolesClient object.
+ */
+ public RolesClient getRoles() {
+ return this.roles;
+ }
+
+ /** 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;
+ }
+
+ /**
+ * Initializes an instance of MicrosoftPostgreSqlHyperscale client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription.
+ * @param endpoint server parameter.
+ */
+ MicrosoftPostgreSqlHyperscaleImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2020-10-05-privatepreview";
+ this.serverGroups = new ServerGroupsClientImpl(this);
+ this.servers = new ServersClientImpl(this);
+ this.configurations = new ConfigurationsClientImpl(this);
+ this.firewallRules = new FirewallRulesClientImpl(this);
+ this.roles = new RolesClientImpl(this);
+ this.operations = new OperationsClientImpl(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) {
+ for (Map.Entry