listByTargetServer(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter,
+ Context context);
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java
index f4253b4194d8a..0046679cf8987 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java
@@ -65,6 +65,13 @@ public interface PostgreSqlManagementClient {
*/
LocationBasedCapabilitiesClient getLocationBasedCapabilities();
+ /**
+ * Gets the ServerCapabilitiesClient object to access its operations.
+ *
+ * @return the ServerCapabilitiesClient object.
+ */
+ ServerCapabilitiesClient getServerCapabilities();
+
/**
* Gets the CheckNameAvailabilitiesClient object to access its operations.
*
@@ -107,6 +114,20 @@ public interface PostgreSqlManagementClient {
*/
ServersClient getServers();
+ /**
+ * Gets the MigrationsClient object to access its operations.
+ *
+ * @return the MigrationsClient object.
+ */
+ MigrationsClient getMigrations();
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ ResourceProvidersClient getResourceProviders();
+
/**
* Gets the OperationsClient object to access its operations.
*
@@ -128,10 +149,31 @@ public interface PostgreSqlManagementClient {
*/
ReplicasClient getReplicas();
+ /**
+ * Gets the LogFilesClient object to access its operations.
+ *
+ * @return the LogFilesClient object.
+ */
+ LogFilesClient getLogFiles();
+
/**
* Gets the VirtualNetworkSubnetUsagesClient object to access its operations.
*
* @return the VirtualNetworkSubnetUsagesClient object.
*/
VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages();
+
+ /**
+ * Gets the FlexibleServersClient object to access its operations.
+ *
+ * @return the FlexibleServersClient object.
+ */
+ FlexibleServersClient getFlexibleServers();
+
+ /**
+ * Gets the LtrBackupOperationsClient object to access its operations.
+ *
+ * @return the LtrBackupOperationsClient object.
+ */
+ LtrBackupOperationsClient getLtrBackupOperations();
}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ResourceProvidersClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ResourceProvidersClient.java
new file mode 100644
index 0000000000000..5edf25d9e7ff2
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ResourceProvidersClient.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */
+public interface ResourceProvidersClient {
+ /**
+ * Check migration name validity and availability
+ *
+ * This method checks whether a proposed migration name is valid and available.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param parameters The required parameters for checking if a migration 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 migration name's availability along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono> checkMigrationNameAvailabilityWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationNameAvailabilityResourceInner parameters);
+
+ /**
+ * Check migration name validity and availability
+ *
+ * This method checks whether a proposed migration name is valid and available.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param parameters The required parameters for checking if a migration 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 migration name's availability on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono checkMigrationNameAvailabilityAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationNameAvailabilityResourceInner parameters);
+
+ /**
+ * Check migration name validity and availability
+ *
+ * This method checks whether a proposed migration name is valid and available.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param parameters The required parameters for checking if a migration 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 migration name's availability along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkMigrationNameAvailabilityWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationNameAvailabilityResourceInner parameters,
+ Context context);
+
+ /**
+ * Check migration name validity and availability
+ *
+ * This method checks whether a proposed migration name is valid and available.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param parameters The required parameters for checking if a migration 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 migration name's availability.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MigrationNameAvailabilityResourceInner checkMigrationNameAvailability(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationNameAvailabilityResourceInner parameters);
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerCapabilitiesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerCapabilitiesClient.java
new file mode 100644
index 0000000000000..9c48b8acce17d
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerCapabilitiesClient.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.postgresqlflexibleserver.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner;
+
+/** An instance of this class provides access to all the operations defined in ServerCapabilitiesClient. */
+public interface ServerCapabilitiesClient {
+ /**
+ * Get capabilities for a flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 capabilities for a flexible server as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedFlux listAsync(String resourceGroupName, String serverName);
+
+ /**
+ * Get capabilities for a flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 capabilities for a flexible server as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serverName);
+
+ /**
+ * Get capabilities for a flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 capabilities for a flexible server as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serverName, Context context);
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/CapabilityPropertiesInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/CapabilityPropertiesInner.java
deleted file mode 100644
index e0ecfaae1617d..0000000000000
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/CapabilityPropertiesInner.java
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
-
-import com.azure.core.annotation.Immutable;
-import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability;
-import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability;
-import com.azure.resourcemanager.postgresqlflexibleserver.models.HyperscaleNodeEditionCapability;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.List;
-
-/** Location capabilities. */
-@Immutable
-public final class CapabilityPropertiesInner {
- /*
- * zone name
- */
- @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY)
- private String zone;
-
- /*
- * Supported high availability mode
- */
- @JsonProperty(value = "supportedHAMode", access = JsonProperty.Access.WRITE_ONLY)
- private List supportedHAMode;
-
- /*
- * A value indicating whether a new server in this region can have geo-backups to paired region.
- */
- @JsonProperty(value = "geoBackupSupported", access = JsonProperty.Access.WRITE_ONLY)
- private Boolean geoBackupSupported;
-
- /*
- * A value indicating whether a new server in this region can support multi zone HA.
- */
- @JsonProperty(value = "zoneRedundantHaSupported", access = JsonProperty.Access.WRITE_ONLY)
- private Boolean zoneRedundantHaSupported;
-
- /*
- * A value indicating whether a new server in this region can have geo-backups to paired region.
- */
- @JsonProperty(value = "zoneRedundantHaAndGeoBackupSupported", access = JsonProperty.Access.WRITE_ONLY)
- private Boolean zoneRedundantHaAndGeoBackupSupported;
-
- /*
- * The supportedFlexibleServerEditions property.
- */
- @JsonProperty(value = "supportedFlexibleServerEditions", access = JsonProperty.Access.WRITE_ONLY)
- private List supportedFlexibleServerEditions;
-
- /*
- * The supportedHyperscaleNodeEditions property.
- */
- @JsonProperty(value = "supportedHyperscaleNodeEditions", access = JsonProperty.Access.WRITE_ONLY)
- private List supportedHyperscaleNodeEditions;
-
- /*
- * A value indicating whether fast provisioning is supported in this region.
- */
- @JsonProperty(value = "fastProvisioningSupported", access = JsonProperty.Access.WRITE_ONLY)
- private Boolean fastProvisioningSupported;
-
- /*
- * The supportedFastProvisioningEditions property.
- */
- @JsonProperty(value = "supportedFastProvisioningEditions", access = JsonProperty.Access.WRITE_ONLY)
- private List supportedFastProvisioningEditions;
-
- /*
- * The status
- */
- @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
- private String status;
-
- /** Creates an instance of CapabilityPropertiesInner class. */
- public CapabilityPropertiesInner() {
- }
-
- /**
- * Get the zone property: zone name.
- *
- * @return the zone value.
- */
- public String zone() {
- return this.zone;
- }
-
- /**
- * Get the supportedHAMode property: Supported high availability mode.
- *
- * @return the supportedHAMode value.
- */
- public List supportedHAMode() {
- return this.supportedHAMode;
- }
-
- /**
- * Get the geoBackupSupported property: A value indicating whether a new server in this region can have geo-backups
- * to paired region.
- *
- * @return the geoBackupSupported value.
- */
- public Boolean geoBackupSupported() {
- return this.geoBackupSupported;
- }
-
- /**
- * Get the zoneRedundantHaSupported property: A value indicating whether a new server in this region can support
- * multi zone HA.
- *
- * @return the zoneRedundantHaSupported value.
- */
- public Boolean zoneRedundantHaSupported() {
- return this.zoneRedundantHaSupported;
- }
-
- /**
- * Get the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether a new server in this region can
- * have geo-backups to paired region.
- *
- * @return the zoneRedundantHaAndGeoBackupSupported value.
- */
- public Boolean zoneRedundantHaAndGeoBackupSupported() {
- return this.zoneRedundantHaAndGeoBackupSupported;
- }
-
- /**
- * Get the supportedFlexibleServerEditions property: The supportedFlexibleServerEditions property.
- *
- * @return the supportedFlexibleServerEditions value.
- */
- public List supportedFlexibleServerEditions() {
- return this.supportedFlexibleServerEditions;
- }
-
- /**
- * Get the supportedHyperscaleNodeEditions property: The supportedHyperscaleNodeEditions property.
- *
- * @return the supportedHyperscaleNodeEditions value.
- */
- public List supportedHyperscaleNodeEditions() {
- return this.supportedHyperscaleNodeEditions;
- }
-
- /**
- * Get the fastProvisioningSupported property: A value indicating whether fast provisioning is supported in this
- * region.
- *
- * @return the fastProvisioningSupported value.
- */
- public Boolean fastProvisioningSupported() {
- return this.fastProvisioningSupported;
- }
-
- /**
- * Get the supportedFastProvisioningEditions property: The supportedFastProvisioningEditions property.
- *
- * @return the supportedFastProvisioningEditions value.
- */
- public List supportedFastProvisioningEditions() {
- return this.supportedFastProvisioningEditions;
- }
-
- /**
- * Get the status property: The status.
- *
- * @return the status value.
- */
- public String status() {
- return this.status;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (supportedFlexibleServerEditions() != null) {
- supportedFlexibleServerEditions().forEach(e -> e.validate());
- }
- if (supportedHyperscaleNodeEditions() != null) {
- supportedHyperscaleNodeEditions().forEach(e -> e.validate());
- }
- if (supportedFastProvisioningEditions() != null) {
- supportedFastProvisioningEditions().forEach(e -> e.validate());
- }
- }
-}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java
new file mode 100644
index 0000000000000..de5d3fc021a3f
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java
@@ -0,0 +1,240 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityBase;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoBackupSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.OnlineResizeSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Capability for the PostgreSQL server. */
+@Fluent
+public final class FlexibleServerCapabilityInner extends CapabilityBase {
+ /*
+ * Name of flexible servers capability
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * List of supported flexible server editions
+ */
+ @JsonProperty(value = "supportedServerEditions", access = JsonProperty.Access.WRITE_ONLY)
+ private List supportedServerEditions;
+
+ /*
+ * The list of server versions supported for this capability.
+ */
+ @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY)
+ private List supportedServerVersions;
+
+ /*
+ * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported.
+ * "Disabled" stands for fast provisioning is not supported.
+ */
+ @JsonProperty(value = "fastProvisioningSupported", access = JsonProperty.Access.WRITE_ONLY)
+ private FastProvisioningSupportedEnum fastProvisioningSupported;
+
+ /*
+ * List of supported server editions for fast provisioning
+ */
+ @JsonProperty(value = "supportedFastProvisioningEditions", access = JsonProperty.Access.WRITE_ONLY)
+ private List supportedFastProvisioningEditions;
+
+ /*
+ * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands
+ * for geo-back is not supported.
+ */
+ @JsonProperty(value = "geoBackupSupported", access = JsonProperty.Access.WRITE_ONLY)
+ private GeoBackupSupportedEnum geoBackupSupported;
+
+ /*
+ * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is
+ * supported. "Disabled" stands for zone redundant HA is not supported.
+ */
+ @JsonProperty(value = "zoneRedundantHaSupported", access = JsonProperty.Access.WRITE_ONLY)
+ private ZoneRedundantHaSupportedEnum zoneRedundantHaSupported;
+
+ /*
+ * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone
+ * redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not
+ * supported.
+ */
+ @JsonProperty(value = "zoneRedundantHaAndGeoBackupSupported", access = JsonProperty.Access.WRITE_ONLY)
+ private ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported;
+
+ /*
+ * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is
+ * supported. "Disabled" stands for storage auto-grow is not supported.
+ */
+ @JsonProperty(value = "storageAutoGrowthSupported", access = JsonProperty.Access.WRITE_ONLY)
+ private StorageAutoGrowthSupportedEnum storageAutoGrowthSupported;
+
+ /*
+ * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means
+ * storage online resize is supported. "Disabled" means storage online resize is not supported.
+ */
+ @JsonProperty(value = "onlineResizeSupported", access = JsonProperty.Access.WRITE_ONLY)
+ private OnlineResizeSupportedEnum onlineResizeSupported;
+
+ /*
+ * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands
+ * for region is not restricted.
+ */
+ @JsonProperty(value = "restricted", access = JsonProperty.Access.WRITE_ONLY)
+ private RestrictedEnum restricted;
+
+ /** Creates an instance of FlexibleServerCapabilityInner class. */
+ public FlexibleServerCapabilityInner() {
+ }
+
+ /**
+ * Get the name property: Name of flexible servers capability.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Name of flexible servers capability.
+ *
+ * @param name the name value to set.
+ * @return the FlexibleServerCapabilityInner object itself.
+ */
+ public FlexibleServerCapabilityInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the supportedServerEditions property: List of supported flexible server editions.
+ *
+ * @return the supportedServerEditions value.
+ */
+ public List supportedServerEditions() {
+ return this.supportedServerEditions;
+ }
+
+ /**
+ * Get the supportedServerVersions property: The list of server versions supported for this capability.
+ *
+ * @return the supportedServerVersions value.
+ */
+ public List supportedServerVersions() {
+ return this.supportedServerVersions;
+ }
+
+ /**
+ * Get the fastProvisioningSupported property: Gets a value indicating whether fast provisioning is supported.
+ * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported.
+ *
+ * @return the fastProvisioningSupported value.
+ */
+ public FastProvisioningSupportedEnum fastProvisioningSupported() {
+ return this.fastProvisioningSupported;
+ }
+
+ /**
+ * Get the supportedFastProvisioningEditions property: List of supported server editions for fast provisioning.
+ *
+ * @return the supportedFastProvisioningEditions value.
+ */
+ public List supportedFastProvisioningEditions() {
+ return this.supportedFastProvisioningEditions;
+ }
+
+ /**
+ * Get the geoBackupSupported property: Determines if geo-backup is supported in this region. "Enabled" means
+ * geo-backup is supported. "Disabled" stands for geo-back is not supported.
+ *
+ * @return the geoBackupSupported value.
+ */
+ public GeoBackupSupportedEnum geoBackupSupported() {
+ return this.geoBackupSupported;
+ }
+
+ /**
+ * Get the zoneRedundantHaSupported property: A value indicating whether Zone Redundant HA is supported in this
+ * region. "Enabled" means zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported.
+ *
+ * @return the zoneRedundantHaSupported value.
+ */
+ public ZoneRedundantHaSupportedEnum zoneRedundantHaSupported() {
+ return this.zoneRedundantHaSupported;
+ }
+
+ /**
+ * Get the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether Zone Redundant HA and
+ * Geo-backup is supported in this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled"
+ * stands for zone redundant HA and geo-backup is not supported.
+ *
+ * @return the zoneRedundantHaAndGeoBackupSupported value.
+ */
+ public ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported() {
+ return this.zoneRedundantHaAndGeoBackupSupported;
+ }
+
+ /**
+ * Get the storageAutoGrowthSupported property: A value indicating whether storage auto-grow is supported in this
+ * region. "Enabled" means storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported.
+ *
+ * @return the storageAutoGrowthSupported value.
+ */
+ public StorageAutoGrowthSupportedEnum storageAutoGrowthSupported() {
+ return this.storageAutoGrowthSupported;
+ }
+
+ /**
+ * Get the onlineResizeSupported property: A value indicating whether online resize is supported in this region for
+ * the given subscription. "Enabled" means storage online resize is supported. "Disabled" means storage online
+ * resize is not supported.
+ *
+ * @return the onlineResizeSupported value.
+ */
+ public OnlineResizeSupportedEnum onlineResizeSupported() {
+ return this.onlineResizeSupported;
+ }
+
+ /**
+ * Get the restricted property: A value indicating whether this region is restricted. "Enabled" means region is
+ * restricted. "Disabled" stands for region is not restricted.
+ *
+ * @return the restricted value.
+ */
+ public RestrictedEnum restricted() {
+ return this.restricted;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ if (supportedServerEditions() != null) {
+ supportedServerEditions().forEach(e -> e.validate());
+ }
+ if (supportedServerVersions() != null) {
+ supportedServerVersions().forEach(e -> e.validate());
+ }
+ if (supportedFastProvisioningEditions() != null) {
+ supportedFastProvisioningEditions().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java
new file mode 100644
index 0000000000000..e8848a5d625fe
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java
@@ -0,0 +1,175 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** Represents a logFile. */
+@Fluent
+public final class LogFileInner extends ProxyResource {
+ /*
+ * The properties of a logFile.
+ */
+ @JsonProperty(value = "properties")
+ private LogFileProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of LogFileInner class. */
+ public LogFileInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The properties of a logFile.
+ *
+ * @return the innerProperties value.
+ */
+ private LogFileProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the createdTime property: Creation timestamp of the log file.
+ *
+ * @return the createdTime value.
+ */
+ public OffsetDateTime createdTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().createdTime();
+ }
+
+ /**
+ * Set the createdTime property: Creation timestamp of the log file.
+ *
+ * @param createdTime the createdTime value to set.
+ * @return the LogFileInner object itself.
+ */
+ public LogFileInner withCreatedTime(OffsetDateTime createdTime) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LogFileProperties();
+ }
+ this.innerProperties().withCreatedTime(createdTime);
+ return this;
+ }
+
+ /**
+ * Get the lastModifiedTime property: Last modified timestamp of the log file.
+ *
+ * @return the lastModifiedTime value.
+ */
+ public OffsetDateTime lastModifiedTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
+ }
+
+ /**
+ * Set the lastModifiedTime property: Last modified timestamp of the log file.
+ *
+ * @param lastModifiedTime the lastModifiedTime value to set.
+ * @return the LogFileInner object itself.
+ */
+ public LogFileInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LogFileProperties();
+ }
+ this.innerProperties().withLastModifiedTime(lastModifiedTime);
+ return this;
+ }
+
+ /**
+ * Get the sizeInKb property: The size in kb of the logFile.
+ *
+ * @return the sizeInKb value.
+ */
+ public Long sizeInKb() {
+ return this.innerProperties() == null ? null : this.innerProperties().sizeInKb();
+ }
+
+ /**
+ * Set the sizeInKb property: The size in kb of the logFile.
+ *
+ * @param sizeInKb the sizeInKb value to set.
+ * @return the LogFileInner object itself.
+ */
+ public LogFileInner withSizeInKb(Long sizeInKb) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LogFileProperties();
+ }
+ this.innerProperties().withSizeInKb(sizeInKb);
+ return this;
+ }
+
+ /**
+ * Get the type property: Type of the log file.
+ *
+ * @return the type value.
+ */
+ public String typePropertiesType() {
+ return this.innerProperties() == null ? null : this.innerProperties().type();
+ }
+
+ /**
+ * Set the type property: Type of the log file.
+ *
+ * @param type the type value to set.
+ * @return the LogFileInner object itself.
+ */
+ public LogFileInner withTypePropertiesType(String type) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LogFileProperties();
+ }
+ this.innerProperties().withType(type);
+ return this;
+ }
+
+ /**
+ * Get the url property: The url to download the log file from.
+ *
+ * @return the url value.
+ */
+ public String url() {
+ return this.innerProperties() == null ? null : this.innerProperties().url();
+ }
+
+ /**
+ * Set the url property: The url to download the log file from.
+ *
+ * @param url the url value to set.
+ * @return the LogFileInner object itself.
+ */
+ public LogFileInner withUrl(String url) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LogFileProperties();
+ }
+ this.innerProperties().withUrl(url);
+ 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java
new file mode 100644
index 0000000000000..310837942f8fb
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** The properties of a logFile. */
+@Fluent
+public final class LogFileProperties {
+ /*
+ * Creation timestamp of the log file.
+ */
+ @JsonProperty(value = "createdTime")
+ private OffsetDateTime createdTime;
+
+ /*
+ * Last modified timestamp of the log file.
+ */
+ @JsonProperty(value = "lastModifiedTime")
+ private OffsetDateTime lastModifiedTime;
+
+ /*
+ * The size in kb of the logFile.
+ */
+ @JsonProperty(value = "sizeInKb")
+ private Long sizeInKb;
+
+ /*
+ * Type of the log file.
+ */
+ @JsonProperty(value = "type")
+ private String type;
+
+ /*
+ * The url to download the log file from.
+ */
+ @JsonProperty(value = "url")
+ private String url;
+
+ /** Creates an instance of LogFileProperties class. */
+ public LogFileProperties() {
+ }
+
+ /**
+ * Get the createdTime property: Creation timestamp of the log file.
+ *
+ * @return the createdTime value.
+ */
+ public OffsetDateTime createdTime() {
+ return this.createdTime;
+ }
+
+ /**
+ * Set the createdTime property: Creation timestamp of the log file.
+ *
+ * @param createdTime the createdTime value to set.
+ * @return the LogFileProperties object itself.
+ */
+ public LogFileProperties withCreatedTime(OffsetDateTime createdTime) {
+ this.createdTime = createdTime;
+ return this;
+ }
+
+ /**
+ * Get the lastModifiedTime property: Last modified timestamp of the log file.
+ *
+ * @return the lastModifiedTime value.
+ */
+ public OffsetDateTime lastModifiedTime() {
+ return this.lastModifiedTime;
+ }
+
+ /**
+ * Set the lastModifiedTime property: Last modified timestamp of the log file.
+ *
+ * @param lastModifiedTime the lastModifiedTime value to set.
+ * @return the LogFileProperties object itself.
+ */
+ public LogFileProperties withLastModifiedTime(OffsetDateTime lastModifiedTime) {
+ this.lastModifiedTime = lastModifiedTime;
+ return this;
+ }
+
+ /**
+ * Get the sizeInKb property: The size in kb of the logFile.
+ *
+ * @return the sizeInKb value.
+ */
+ public Long sizeInKb() {
+ return this.sizeInKb;
+ }
+
+ /**
+ * Set the sizeInKb property: The size in kb of the logFile.
+ *
+ * @param sizeInKb the sizeInKb value to set.
+ * @return the LogFileProperties object itself.
+ */
+ public LogFileProperties withSizeInKb(Long sizeInKb) {
+ this.sizeInKb = sizeInKb;
+ return this;
+ }
+
+ /**
+ * Get the type property: Type of the log file.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: Type of the log file.
+ *
+ * @param type the type value to set.
+ * @return the LogFileProperties object itself.
+ */
+ public LogFileProperties withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get the url property: The url to download the log file from.
+ *
+ * @return the url value.
+ */
+ public String url() {
+ return this.url;
+ }
+
+ /**
+ * Set the url property: The url to download the log file from.
+ *
+ * @param url the url value to set.
+ * @return the LogFileProperties object itself.
+ */
+ public LogFileProperties withUrl(String url) {
+ this.url = url;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java
new file mode 100644
index 0000000000000..8c4a2c0237b09
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java
@@ -0,0 +1,282 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** Response for the backup request. */
+@Fluent
+public final class LtrBackupOperationResponseProperties {
+ /*
+ * Size of datasource in bytes
+ */
+ @JsonProperty(value = "datasourceSizeInBytes")
+ private Long datasourceSizeInBytes;
+
+ /*
+ * Data transferred in bytes
+ */
+ @JsonProperty(value = "dataTransferredInBytes")
+ private Long dataTransferredInBytes;
+
+ /*
+ * Name of Backup operation
+ */
+ @JsonProperty(value = "backupName")
+ private String backupName;
+
+ /*
+ * Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this
+ * Recovery point. e.g. Versions, DataFormat etc
+ */
+ @JsonProperty(value = "backupMetadata")
+ private String backupMetadata;
+
+ /*
+ * Service-set extensible enum indicating the status of operation
+ */
+ @JsonProperty(value = "status", required = true)
+ private ExecutionStatus status;
+
+ /*
+ * Start time of the operation.
+ */
+ @JsonProperty(value = "startTime", required = true)
+ private OffsetDateTime startTime;
+
+ /*
+ * End time of the operation.
+ */
+ @JsonProperty(value = "endTime")
+ private OffsetDateTime endTime;
+
+ /*
+ * PercentageCompleted
+ */
+ @JsonProperty(value = "percentComplete")
+ private Double percentComplete;
+
+ /*
+ * The error code.
+ */
+ @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY)
+ private String errorCode;
+
+ /*
+ * The error message.
+ */
+ @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY)
+ private String errorMessage;
+
+ /** Creates an instance of LtrBackupOperationResponseProperties class. */
+ public LtrBackupOperationResponseProperties() {
+ }
+
+ /**
+ * Get the datasourceSizeInBytes property: Size of datasource in bytes.
+ *
+ * @return the datasourceSizeInBytes value.
+ */
+ public Long datasourceSizeInBytes() {
+ return this.datasourceSizeInBytes;
+ }
+
+ /**
+ * Set the datasourceSizeInBytes property: Size of datasource in bytes.
+ *
+ * @param datasourceSizeInBytes the datasourceSizeInBytes value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withDatasourceSizeInBytes(Long datasourceSizeInBytes) {
+ this.datasourceSizeInBytes = datasourceSizeInBytes;
+ return this;
+ }
+
+ /**
+ * Get the dataTransferredInBytes property: Data transferred in bytes.
+ *
+ * @return the dataTransferredInBytes value.
+ */
+ public Long dataTransferredInBytes() {
+ return this.dataTransferredInBytes;
+ }
+
+ /**
+ * Set the dataTransferredInBytes property: Data transferred in bytes.
+ *
+ * @param dataTransferredInBytes the dataTransferredInBytes value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withDataTransferredInBytes(Long dataTransferredInBytes) {
+ this.dataTransferredInBytes = dataTransferredInBytes;
+ return this;
+ }
+
+ /**
+ * Get the backupName property: Name of Backup operation.
+ *
+ * @return the backupName value.
+ */
+ public String backupName() {
+ return this.backupName;
+ }
+
+ /**
+ * Set the backupName property: Name of Backup operation.
+ *
+ * @param backupName the backupName value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withBackupName(String backupName) {
+ this.backupName = backupName;
+ return this;
+ }
+
+ /**
+ * Get the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a
+ * successful restore using this Recovery point. e.g. Versions, DataFormat etc.
+ *
+ * @return the backupMetadata value.
+ */
+ public String backupMetadata() {
+ return this.backupMetadata;
+ }
+
+ /**
+ * Set the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a
+ * successful restore using this Recovery point. e.g. Versions, DataFormat etc.
+ *
+ * @param backupMetadata the backupMetadata value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withBackupMetadata(String backupMetadata) {
+ this.backupMetadata = backupMetadata;
+ return this;
+ }
+
+ /**
+ * Get the status property: Service-set extensible enum indicating the status of operation.
+ *
+ * @return the status value.
+ */
+ public ExecutionStatus status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: Service-set extensible enum indicating the status of operation.
+ *
+ * @param status the status value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withStatus(ExecutionStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the startTime property: Start time of the operation.
+ *
+ * @return the startTime value.
+ */
+ public OffsetDateTime startTime() {
+ return this.startTime;
+ }
+
+ /**
+ * Set the startTime property: Start time of the operation.
+ *
+ * @param startTime the startTime value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withStartTime(OffsetDateTime startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ /**
+ * Get the endTime property: End time of the operation.
+ *
+ * @return the endTime value.
+ */
+ public OffsetDateTime endTime() {
+ return this.endTime;
+ }
+
+ /**
+ * Set the endTime property: End time of the operation.
+ *
+ * @param endTime the endTime value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withEndTime(OffsetDateTime endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ /**
+ * Get the percentComplete property: PercentageCompleted.
+ *
+ * @return the percentComplete value.
+ */
+ public Double percentComplete() {
+ return this.percentComplete;
+ }
+
+ /**
+ * Set the percentComplete property: PercentageCompleted.
+ *
+ * @param percentComplete the percentComplete value to set.
+ * @return the LtrBackupOperationResponseProperties object itself.
+ */
+ public LtrBackupOperationResponseProperties withPercentComplete(Double percentComplete) {
+ this.percentComplete = percentComplete;
+ return this;
+ }
+
+ /**
+ * Get the errorCode property: The error code.
+ *
+ * @return the errorCode value.
+ */
+ public String errorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Get the errorMessage property: The error message.
+ *
+ * @return the errorMessage value.
+ */
+ public String errorMessage() {
+ return this.errorMessage;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (status() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property status in model LtrBackupOperationResponseProperties"));
+ }
+ if (startTime() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property startTime in model LtrBackupOperationResponseProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(LtrBackupOperationResponseProperties.class);
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java
new file mode 100644
index 0000000000000..cae25402c0bbe
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java
@@ -0,0 +1,248 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** Response for the LTR backup API call. */
+@Fluent
+public final class LtrBackupResponseInner {
+ /*
+ * Long Term Retention Backup Operation Resource Properties
+ */
+ @JsonProperty(value = "properties")
+ private LtrBackupOperationResponseProperties innerProperties;
+
+ /** Creates an instance of LtrBackupResponseInner class. */
+ public LtrBackupResponseInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Long Term Retention Backup Operation Resource Properties.
+ *
+ * @return the innerProperties value.
+ */
+ private LtrBackupOperationResponseProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the datasourceSizeInBytes property: Size of datasource in bytes.
+ *
+ * @return the datasourceSizeInBytes value.
+ */
+ public Long datasourceSizeInBytes() {
+ return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes();
+ }
+
+ /**
+ * Set the datasourceSizeInBytes property: Size of datasource in bytes.
+ *
+ * @param datasourceSizeInBytes the datasourceSizeInBytes value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withDatasourceSizeInBytes(datasourceSizeInBytes);
+ return this;
+ }
+
+ /**
+ * Get the dataTransferredInBytes property: Data transferred in bytes.
+ *
+ * @return the dataTransferredInBytes value.
+ */
+ public Long dataTransferredInBytes() {
+ return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes();
+ }
+
+ /**
+ * Set the dataTransferredInBytes property: Data transferred in bytes.
+ *
+ * @param dataTransferredInBytes the dataTransferredInBytes value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withDataTransferredInBytes(Long dataTransferredInBytes) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes);
+ return this;
+ }
+
+ /**
+ * Get the backupName property: Name of Backup operation.
+ *
+ * @return the backupName value.
+ */
+ public String backupName() {
+ return this.innerProperties() == null ? null : this.innerProperties().backupName();
+ }
+
+ /**
+ * Set the backupName property: Name of Backup operation.
+ *
+ * @param backupName the backupName value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withBackupName(String backupName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withBackupName(backupName);
+ return this;
+ }
+
+ /**
+ * Get the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a
+ * successful restore using this Recovery point. e.g. Versions, DataFormat etc.
+ *
+ * @return the backupMetadata value.
+ */
+ public String backupMetadata() {
+ return this.innerProperties() == null ? null : this.innerProperties().backupMetadata();
+ }
+
+ /**
+ * Set the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a
+ * successful restore using this Recovery point. e.g. Versions, DataFormat etc.
+ *
+ * @param backupMetadata the backupMetadata value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withBackupMetadata(String backupMetadata) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withBackupMetadata(backupMetadata);
+ return this;
+ }
+
+ /**
+ * Get the status property: Service-set extensible enum indicating the status of operation.
+ *
+ * @return the status value.
+ */
+ public ExecutionStatus status() {
+ return this.innerProperties() == null ? null : this.innerProperties().status();
+ }
+
+ /**
+ * Set the status property: Service-set extensible enum indicating the status of operation.
+ *
+ * @param status the status value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withStatus(ExecutionStatus status) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withStatus(status);
+ return this;
+ }
+
+ /**
+ * Get the startTime property: Start time of the operation.
+ *
+ * @return the startTime value.
+ */
+ public OffsetDateTime startTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().startTime();
+ }
+
+ /**
+ * Set the startTime property: Start time of the operation.
+ *
+ * @param startTime the startTime value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withStartTime(OffsetDateTime startTime) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withStartTime(startTime);
+ return this;
+ }
+
+ /**
+ * Get the endTime property: End time of the operation.
+ *
+ * @return the endTime value.
+ */
+ public OffsetDateTime endTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().endTime();
+ }
+
+ /**
+ * Set the endTime property: End time of the operation.
+ *
+ * @param endTime the endTime value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withEndTime(OffsetDateTime endTime) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withEndTime(endTime);
+ return this;
+ }
+
+ /**
+ * Get the percentComplete property: PercentageCompleted.
+ *
+ * @return the percentComplete value.
+ */
+ public Double percentComplete() {
+ return this.innerProperties() == null ? null : this.innerProperties().percentComplete();
+ }
+
+ /**
+ * Set the percentComplete property: PercentageCompleted.
+ *
+ * @param percentComplete the percentComplete value to set.
+ * @return the LtrBackupResponseInner object itself.
+ */
+ public LtrBackupResponseInner withPercentComplete(Double percentComplete) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withPercentComplete(percentComplete);
+ return this;
+ }
+
+ /**
+ * Get the errorCode property: The error code.
+ *
+ * @return the errorCode value.
+ */
+ public String errorCode() {
+ return this.innerProperties() == null ? null : this.innerProperties().errorCode();
+ }
+
+ /**
+ * Get the errorMessage property: The error message.
+ *
+ * @return the errorMessage value.
+ */
+ public String errorMessage() {
+ return this.innerProperties() == null ? null : this.innerProperties().errorMessage();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java
new file mode 100644
index 0000000000000..addae5eee73a1
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Response for the LTR pre-backup API call. */
+@Fluent
+public final class LtrPreBackupResponseInner {
+ /*
+ * Additional Properties for the pre backup response
+ */
+ @JsonProperty(value = "properties", required = true)
+ private LtrPreBackupResponseProperties innerProperties = new LtrPreBackupResponseProperties();
+
+ /** Creates an instance of LtrPreBackupResponseInner class. */
+ public LtrPreBackupResponseInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Additional Properties for the pre backup response.
+ *
+ * @return the innerProperties value.
+ */
+ private LtrPreBackupResponseProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the numberOfContainers property: Number of storage containers the plugin will use during backup. More than
+ * one containers may be used for size limitations, parallelism, or redundancy etc.
+ *
+ * @return the numberOfContainers value.
+ */
+ public int numberOfContainers() {
+ return this.innerProperties() == null ? 0 : this.innerProperties().numberOfContainers();
+ }
+
+ /**
+ * Set the numberOfContainers property: Number of storage containers the plugin will use during backup. More than
+ * one containers may be used for size limitations, parallelism, or redundancy etc.
+ *
+ * @param numberOfContainers the numberOfContainers value to set.
+ * @return the LtrPreBackupResponseInner object itself.
+ */
+ public LtrPreBackupResponseInner withNumberOfContainers(int numberOfContainers) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrPreBackupResponseProperties();
+ }
+ this.innerProperties().withNumberOfContainers(numberOfContainers);
+ 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 LtrPreBackupResponseInner"));
+ } else {
+ innerProperties().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(LtrPreBackupResponseInner.class);
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java
new file mode 100644
index 0000000000000..968c034704f4f
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Response for the pre-backup request. */
+@Fluent
+public final class LtrPreBackupResponseProperties {
+ /*
+ * Number of storage containers the plugin will use during backup. More than one containers may be used for size
+ * limitations, parallelism, or redundancy etc.
+ */
+ @JsonProperty(value = "numberOfContainers", required = true)
+ private int numberOfContainers;
+
+ /** Creates an instance of LtrPreBackupResponseProperties class. */
+ public LtrPreBackupResponseProperties() {
+ }
+
+ /**
+ * Get the numberOfContainers property: Number of storage containers the plugin will use during backup. More than
+ * one containers may be used for size limitations, parallelism, or redundancy etc.
+ *
+ * @return the numberOfContainers value.
+ */
+ public int numberOfContainers() {
+ return this.numberOfContainers;
+ }
+
+ /**
+ * Set the numberOfContainers property: Number of storage containers the plugin will use during backup. More than
+ * one containers may be used for size limitations, parallelism, or redundancy etc.
+ *
+ * @param numberOfContainers the numberOfContainers value to set.
+ * @return the LtrPreBackupResponseProperties object itself.
+ */
+ public LtrPreBackupResponseProperties withNumberOfContainers(int numberOfContainers) {
+ this.numberOfContainers = numberOfContainers;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java
new file mode 100644
index 0000000000000..39f221b5c5e33
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java
@@ -0,0 +1,265 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** Response for the LTR backup Operation API call. */
+@Fluent
+public final class LtrServerBackupOperationInner extends ProxyResource {
+ /*
+ * Long Term Retention Backup Operation Resource Properties
+ */
+ @JsonProperty(value = "properties")
+ private LtrBackupOperationResponseProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of LtrServerBackupOperationInner class. */
+ public LtrServerBackupOperationInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Long Term Retention Backup Operation Resource Properties.
+ *
+ * @return the innerProperties value.
+ */
+ private LtrBackupOperationResponseProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the datasourceSizeInBytes property: Size of datasource in bytes.
+ *
+ * @return the datasourceSizeInBytes value.
+ */
+ public Long datasourceSizeInBytes() {
+ return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes();
+ }
+
+ /**
+ * Set the datasourceSizeInBytes property: Size of datasource in bytes.
+ *
+ * @param datasourceSizeInBytes the datasourceSizeInBytes value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withDatasourceSizeInBytes(datasourceSizeInBytes);
+ return this;
+ }
+
+ /**
+ * Get the dataTransferredInBytes property: Data transferred in bytes.
+ *
+ * @return the dataTransferredInBytes value.
+ */
+ public Long dataTransferredInBytes() {
+ return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes();
+ }
+
+ /**
+ * Set the dataTransferredInBytes property: Data transferred in bytes.
+ *
+ * @param dataTransferredInBytes the dataTransferredInBytes value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withDataTransferredInBytes(Long dataTransferredInBytes) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes);
+ return this;
+ }
+
+ /**
+ * Get the backupName property: Name of Backup operation.
+ *
+ * @return the backupName value.
+ */
+ public String backupName() {
+ return this.innerProperties() == null ? null : this.innerProperties().backupName();
+ }
+
+ /**
+ * Set the backupName property: Name of Backup operation.
+ *
+ * @param backupName the backupName value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withBackupName(String backupName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withBackupName(backupName);
+ return this;
+ }
+
+ /**
+ * Get the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a
+ * successful restore using this Recovery point. e.g. Versions, DataFormat etc.
+ *
+ * @return the backupMetadata value.
+ */
+ public String backupMetadata() {
+ return this.innerProperties() == null ? null : this.innerProperties().backupMetadata();
+ }
+
+ /**
+ * Set the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a
+ * successful restore using this Recovery point. e.g. Versions, DataFormat etc.
+ *
+ * @param backupMetadata the backupMetadata value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withBackupMetadata(String backupMetadata) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withBackupMetadata(backupMetadata);
+ return this;
+ }
+
+ /**
+ * Get the status property: Service-set extensible enum indicating the status of operation.
+ *
+ * @return the status value.
+ */
+ public ExecutionStatus status() {
+ return this.innerProperties() == null ? null : this.innerProperties().status();
+ }
+
+ /**
+ * Set the status property: Service-set extensible enum indicating the status of operation.
+ *
+ * @param status the status value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withStatus(ExecutionStatus status) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withStatus(status);
+ return this;
+ }
+
+ /**
+ * Get the startTime property: Start time of the operation.
+ *
+ * @return the startTime value.
+ */
+ public OffsetDateTime startTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().startTime();
+ }
+
+ /**
+ * Set the startTime property: Start time of the operation.
+ *
+ * @param startTime the startTime value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withStartTime(OffsetDateTime startTime) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withStartTime(startTime);
+ return this;
+ }
+
+ /**
+ * Get the endTime property: End time of the operation.
+ *
+ * @return the endTime value.
+ */
+ public OffsetDateTime endTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().endTime();
+ }
+
+ /**
+ * Set the endTime property: End time of the operation.
+ *
+ * @param endTime the endTime value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withEndTime(OffsetDateTime endTime) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withEndTime(endTime);
+ return this;
+ }
+
+ /**
+ * Get the percentComplete property: PercentageCompleted.
+ *
+ * @return the percentComplete value.
+ */
+ public Double percentComplete() {
+ return this.innerProperties() == null ? null : this.innerProperties().percentComplete();
+ }
+
+ /**
+ * Set the percentComplete property: PercentageCompleted.
+ *
+ * @param percentComplete the percentComplete value to set.
+ * @return the LtrServerBackupOperationInner object itself.
+ */
+ public LtrServerBackupOperationInner withPercentComplete(Double percentComplete) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new LtrBackupOperationResponseProperties();
+ }
+ this.innerProperties().withPercentComplete(percentComplete);
+ return this;
+ }
+
+ /**
+ * Get the errorCode property: The error code.
+ *
+ * @return the errorCode value.
+ */
+ public String errorCode() {
+ return this.innerProperties() == null ? null : this.innerProperties().errorCode();
+ }
+
+ /**
+ * Get the errorMessage property: The error message.
+ *
+ * @return the errorMessage value.
+ */
+ public String errorMessage() {
+ return this.innerProperties() == null ? null : this.innerProperties().errorMessage();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java
new file mode 100644
index 0000000000000..80c281290c364
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityReason;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Represents a migration name's availability. */
+@Fluent
+public final class MigrationNameAvailabilityResourceInner {
+ /*
+ * The resource name to verify.
+ */
+ @JsonProperty(value = "name", required = true)
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ @JsonProperty(value = "type", required = true)
+ private String type;
+
+ /*
+ * Indicates whether the resource name is available.
+ */
+ @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY)
+ private Boolean nameAvailable;
+
+ /*
+ * Migration name availability reason
+ */
+ @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY)
+ private MigrationNameAvailabilityReason reason;
+
+ /*
+ * Migration name availability message.
+ */
+ @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
+ private String message;
+
+ /** Creates an instance of MigrationNameAvailabilityResourceInner class. */
+ public MigrationNameAvailabilityResourceInner() {
+ }
+
+ /**
+ * Get the name property: The resource name to verify.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: The resource name to verify.
+ *
+ * @param name the name value to set.
+ * @return the MigrationNameAvailabilityResourceInner object itself.
+ */
+ public MigrationNameAvailabilityResourceInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: The type of the resource.
+ *
+ * @param type the type value to set.
+ * @return the MigrationNameAvailabilityResourceInner object itself.
+ */
+ public MigrationNameAvailabilityResourceInner withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get the nameAvailable property: Indicates whether the resource name is available.
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Get the reason property: Migration name availability reason.
+ *
+ * @return the reason value.
+ */
+ public MigrationNameAvailabilityReason reason() {
+ return this.reason;
+ }
+
+ /**
+ * Get the message property: Migration name availability message.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (name() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property name in model MigrationNameAvailabilityResourceInner"));
+ }
+ if (type() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property type in model MigrationNameAvailabilityResourceInner"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(MigrationNameAvailabilityResourceInner.class);
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java
new file mode 100644
index 0000000000000..1e6f37f04ba0b
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java
@@ -0,0 +1,494 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Map;
+
+/** Represents a migration resource. */
+@Fluent
+public final class MigrationResourceInner extends Resource {
+ /*
+ * Migration resource properties.
+ */
+ @JsonProperty(value = "properties")
+ private MigrationResourceProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of MigrationResourceInner class. */
+ public MigrationResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Migration resource properties.
+ *
+ * @return the innerProperties value.
+ */
+ private MigrationResourceProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public MigrationResourceInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public MigrationResourceInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the migrationId property: ID for migration, a GUID.
+ *
+ * @return the migrationId value.
+ */
+ public String migrationId() {
+ return this.innerProperties() == null ? null : this.innerProperties().migrationId();
+ }
+
+ /**
+ * Get the currentStatus property: Current status of migration.
+ *
+ * @return the currentStatus value.
+ */
+ public MigrationStatus currentStatus() {
+ return this.innerProperties() == null ? null : this.innerProperties().currentStatus();
+ }
+
+ /**
+ * Get the migrationMode property: There are two types of migration modes Online and Offline.
+ *
+ * @return the migrationMode value.
+ */
+ public MigrationMode migrationMode() {
+ return this.innerProperties() == null ? null : this.innerProperties().migrationMode();
+ }
+
+ /**
+ * Set the migrationMode property: There are two types of migration modes Online and Offline.
+ *
+ * @param migrationMode the migrationMode value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withMigrationMode(MigrationMode migrationMode) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withMigrationMode(migrationMode);
+ return this;
+ }
+
+ /**
+ * Get the sourceDbServerMetadata property: Metadata of the source database server.
+ *
+ * @return the sourceDbServerMetadata value.
+ */
+ public DbServerMetadata sourceDbServerMetadata() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerMetadata();
+ }
+
+ /**
+ * Get the targetDbServerMetadata property: Metadata of the target database server.
+ *
+ * @return the targetDbServerMetadata value.
+ */
+ public DbServerMetadata targetDbServerMetadata() {
+ return this.innerProperties() == null ? null : this.innerProperties().targetDbServerMetadata();
+ }
+
+ /**
+ * Get the sourceDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @return the sourceDbServerResourceId value.
+ */
+ public String sourceDbServerResourceId() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerResourceId();
+ }
+
+ /**
+ * Set the sourceDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @param sourceDbServerResourceId the sourceDbServerResourceId value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withSourceDbServerResourceId(String sourceDbServerResourceId) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withSourceDbServerResourceId(sourceDbServerResourceId);
+ return this;
+ }
+
+ /**
+ * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @return the sourceDbServerFullyQualifiedDomainName value.
+ */
+ public String sourceDbServerFullyQualifiedDomainName() {
+ return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerFullyQualifiedDomainName();
+ }
+
+ /**
+ * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withSourceDbServerFullyQualifiedDomainName(
+ String sourceDbServerFullyQualifiedDomainName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName);
+ return this;
+ }
+
+ /**
+ * Get the targetDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @return the targetDbServerResourceId value.
+ */
+ public String targetDbServerResourceId() {
+ return this.innerProperties() == null ? null : this.innerProperties().targetDbServerResourceId();
+ }
+
+ /**
+ * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @return the targetDbServerFullyQualifiedDomainName value.
+ */
+ public String targetDbServerFullyQualifiedDomainName() {
+ return this.innerProperties() == null ? null : this.innerProperties().targetDbServerFullyQualifiedDomainName();
+ }
+
+ /**
+ * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withTargetDbServerFullyQualifiedDomainName(
+ String targetDbServerFullyQualifiedDomainName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName);
+ return this;
+ }
+
+ /**
+ * Get the secretParameters property: Migration secret parameters.
+ *
+ * @return the secretParameters value.
+ */
+ public MigrationSecretParameters secretParameters() {
+ return this.innerProperties() == null ? null : this.innerProperties().secretParameters();
+ }
+
+ /**
+ * Set the secretParameters property: Migration secret parameters.
+ *
+ * @param secretParameters the secretParameters value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withSecretParameters(MigrationSecretParameters secretParameters) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withSecretParameters(secretParameters);
+ return this;
+ }
+
+ /**
+ * Get the dbsToMigrate property: Number of databases to migrate.
+ *
+ * @return the dbsToMigrate value.
+ */
+ public List dbsToMigrate() {
+ return this.innerProperties() == null ? null : this.innerProperties().dbsToMigrate();
+ }
+
+ /**
+ * Set the dbsToMigrate property: Number of databases to migrate.
+ *
+ * @param dbsToMigrate the dbsToMigrate value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withDbsToMigrate(List dbsToMigrate) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withDbsToMigrate(dbsToMigrate);
+ return this;
+ }
+
+ /**
+ * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup
+ * LogicalReplicationOnSourceDb, if needed.
+ *
+ * @return the setupLogicalReplicationOnSourceDbIfNeeded value.
+ */
+ public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() {
+ return this.innerProperties() == null
+ ? null
+ : this.innerProperties().setupLogicalReplicationOnSourceDbIfNeeded();
+ }
+
+ /**
+ * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup
+ * LogicalReplicationOnSourceDb, if needed.
+ *
+ * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withSetupLogicalReplicationOnSourceDbIfNeeded(
+ LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded);
+ return this;
+ }
+
+ /**
+ * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten,
+ * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the
+ * database already exists.
+ *
+ * @return the overwriteDbsInTarget value.
+ */
+ public OverwriteDbsInTargetEnum overwriteDbsInTarget() {
+ return this.innerProperties() == null ? null : this.innerProperties().overwriteDbsInTarget();
+ }
+
+ /**
+ * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten,
+ * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the
+ * database already exists.
+ *
+ * @param overwriteDbsInTarget the overwriteDbsInTarget value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withOverwriteDbsInTarget(overwriteDbsInTarget);
+ return this;
+ }
+
+ /**
+ * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window.
+ *
+ * @return the migrationWindowStartTimeInUtc value.
+ */
+ public OffsetDateTime migrationWindowStartTimeInUtc() {
+ return this.innerProperties() == null ? null : this.innerProperties().migrationWindowStartTimeInUtc();
+ }
+
+ /**
+ * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window.
+ *
+ * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc);
+ return this;
+ }
+
+ /**
+ * Get the migrationWindowEndTimeInUtc property: End time in UTC for migration window.
+ *
+ * @return the migrationWindowEndTimeInUtc value.
+ */
+ public OffsetDateTime migrationWindowEndTimeInUtc() {
+ return this.innerProperties() == null ? null : this.innerProperties().migrationWindowEndTimeInUtc();
+ }
+
+ /**
+ * Set the migrationWindowEndTimeInUtc property: End time in UTC for migration window.
+ *
+ * @param migrationWindowEndTimeInUtc the migrationWindowEndTimeInUtc value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withMigrationWindowEndTimeInUtc(migrationWindowEndTimeInUtc);
+ return this;
+ }
+
+ /**
+ * Get the startDataMigration property: Indicates whether the data migration should start right away.
+ *
+ * @return the startDataMigration value.
+ */
+ public StartDataMigrationEnum startDataMigration() {
+ return this.innerProperties() == null ? null : this.innerProperties().startDataMigration();
+ }
+
+ /**
+ * Set the startDataMigration property: Indicates whether the data migration should start right away.
+ *
+ * @param startDataMigration the startDataMigration value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withStartDataMigration(StartDataMigrationEnum startDataMigration) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withStartDataMigration(startDataMigration);
+ return this;
+ }
+
+ /**
+ * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True.
+ *
+ * @return the triggerCutover value.
+ */
+ public TriggerCutoverEnum triggerCutover() {
+ return this.innerProperties() == null ? null : this.innerProperties().triggerCutover();
+ }
+
+ /**
+ * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True.
+ *
+ * @param triggerCutover the triggerCutover value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withTriggerCutover(TriggerCutoverEnum triggerCutover) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withTriggerCutover(triggerCutover);
+ return this;
+ }
+
+ /**
+ * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send
+ * triggerCutover flag as True and database names in this array.
+ *
+ * @return the dbsToTriggerCutoverOn value.
+ */
+ public List dbsToTriggerCutoverOn() {
+ return this.innerProperties() == null ? null : this.innerProperties().dbsToTriggerCutoverOn();
+ }
+
+ /**
+ * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send
+ * triggerCutover flag as True and database names in this array.
+ *
+ * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn);
+ return this;
+ }
+
+ /**
+ * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True.
+ *
+ * @return the cancel value.
+ */
+ public CancelEnum cancel() {
+ return this.innerProperties() == null ? null : this.innerProperties().cancel();
+ }
+
+ /**
+ * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True.
+ *
+ * @param cancel the cancel value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withCancel(CancelEnum cancel) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withCancel(cancel);
+ return this;
+ }
+
+ /**
+ * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag
+ * as True and database names in this array.
+ *
+ * @return the dbsToCancelMigrationOn value.
+ */
+ public List dbsToCancelMigrationOn() {
+ return this.innerProperties() == null ? null : this.innerProperties().dbsToCancelMigrationOn();
+ }
+
+ /**
+ * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag
+ * as True and database names in this array.
+ *
+ * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set.
+ * @return the MigrationResourceInner object itself.
+ */
+ public MigrationResourceInner withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MigrationResourceProperties();
+ }
+ this.innerProperties().withDbsToCancelMigrationOn(dbsToCancelMigrationOn);
+ 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java
new file mode 100644
index 0000000000000..ab79f8fc84438
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java
@@ -0,0 +1,533 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Migration resource properties. */
+@Fluent
+public final class MigrationResourceProperties {
+ /*
+ * ID for migration, a GUID.
+ */
+ @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY)
+ private String migrationId;
+
+ /*
+ * Current status of migration
+ */
+ @JsonProperty(value = "currentStatus", access = JsonProperty.Access.WRITE_ONLY)
+ private MigrationStatus currentStatus;
+
+ /*
+ * There are two types of migration modes Online and Offline
+ */
+ @JsonProperty(value = "migrationMode")
+ private MigrationMode migrationMode;
+
+ /*
+ * Metadata of the source database server
+ */
+ @JsonProperty(value = "sourceDbServerMetadata", access = JsonProperty.Access.WRITE_ONLY)
+ private DbServerMetadata sourceDbServerMetadata;
+
+ /*
+ * Metadata of the target database server
+ */
+ @JsonProperty(value = "targetDbServerMetadata", access = JsonProperty.Access.WRITE_ONLY)
+ private DbServerMetadata targetDbServerMetadata;
+
+ /*
+ * ResourceId of the source database server
+ */
+ @JsonProperty(value = "sourceDbServerResourceId")
+ private String sourceDbServerResourceId;
+
+ /*
+ * Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always
+ * use it for connection
+ */
+ @JsonProperty(value = "sourceDbServerFullyQualifiedDomainName")
+ private String sourceDbServerFullyQualifiedDomainName;
+
+ /*
+ * ResourceId of the source database server
+ */
+ @JsonProperty(value = "targetDbServerResourceId", access = JsonProperty.Access.WRITE_ONLY)
+ private String targetDbServerResourceId;
+
+ /*
+ * Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always
+ * use it for connection
+ */
+ @JsonProperty(value = "targetDbServerFullyQualifiedDomainName")
+ private String targetDbServerFullyQualifiedDomainName;
+
+ /*
+ * Migration secret parameters
+ */
+ @JsonProperty(value = "secretParameters")
+ private MigrationSecretParameters secretParameters;
+
+ /*
+ * Number of databases to migrate
+ */
+ @JsonProperty(value = "dbsToMigrate")
+ private List dbsToMigrate;
+
+ /*
+ * Indicates whether to setup LogicalReplicationOnSourceDb, if needed
+ */
+ @JsonProperty(value = "setupLogicalReplicationOnSourceDbIfNeeded")
+ private LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded;
+
+ /*
+ * Indicates whether the databases on the target server can be overwritten, if already present. If set to False,
+ * the migration workflow will wait for a confirmation, if it detects that the database already exists.
+ */
+ @JsonProperty(value = "overwriteDbsInTarget")
+ private OverwriteDbsInTargetEnum overwriteDbsInTarget;
+
+ /*
+ * Start time in UTC for migration window
+ */
+ @JsonProperty(value = "migrationWindowStartTimeInUtc")
+ private OffsetDateTime migrationWindowStartTimeInUtc;
+
+ /*
+ * End time in UTC for migration window
+ */
+ @JsonProperty(value = "migrationWindowEndTimeInUtc")
+ private OffsetDateTime migrationWindowEndTimeInUtc;
+
+ /*
+ * Indicates whether the data migration should start right away
+ */
+ @JsonProperty(value = "startDataMigration")
+ private StartDataMigrationEnum startDataMigration;
+
+ /*
+ * To trigger cutover for entire migration we need to send this flag as True
+ */
+ @JsonProperty(value = "triggerCutover")
+ private TriggerCutoverEnum triggerCutover;
+
+ /*
+ * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in
+ * this array
+ */
+ @JsonProperty(value = "dbsToTriggerCutoverOn")
+ private List dbsToTriggerCutoverOn;
+
+ /*
+ * To trigger cancel for entire migration we need to send this flag as True
+ */
+ @JsonProperty(value = "cancel")
+ private CancelEnum cancel;
+
+ /*
+ * When you want to trigger cancel for specific databases send cancel flag as True and database names in this array
+ */
+ @JsonProperty(value = "dbsToCancelMigrationOn")
+ private List dbsToCancelMigrationOn;
+
+ /** Creates an instance of MigrationResourceProperties class. */
+ public MigrationResourceProperties() {
+ }
+
+ /**
+ * Get the migrationId property: ID for migration, a GUID.
+ *
+ * @return the migrationId value.
+ */
+ public String migrationId() {
+ return this.migrationId;
+ }
+
+ /**
+ * Get the currentStatus property: Current status of migration.
+ *
+ * @return the currentStatus value.
+ */
+ public MigrationStatus currentStatus() {
+ return this.currentStatus;
+ }
+
+ /**
+ * Get the migrationMode property: There are two types of migration modes Online and Offline.
+ *
+ * @return the migrationMode value.
+ */
+ public MigrationMode migrationMode() {
+ return this.migrationMode;
+ }
+
+ /**
+ * Set the migrationMode property: There are two types of migration modes Online and Offline.
+ *
+ * @param migrationMode the migrationMode value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withMigrationMode(MigrationMode migrationMode) {
+ this.migrationMode = migrationMode;
+ return this;
+ }
+
+ /**
+ * Get the sourceDbServerMetadata property: Metadata of the source database server.
+ *
+ * @return the sourceDbServerMetadata value.
+ */
+ public DbServerMetadata sourceDbServerMetadata() {
+ return this.sourceDbServerMetadata;
+ }
+
+ /**
+ * Get the targetDbServerMetadata property: Metadata of the target database server.
+ *
+ * @return the targetDbServerMetadata value.
+ */
+ public DbServerMetadata targetDbServerMetadata() {
+ return this.targetDbServerMetadata;
+ }
+
+ /**
+ * Get the sourceDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @return the sourceDbServerResourceId value.
+ */
+ public String sourceDbServerResourceId() {
+ return this.sourceDbServerResourceId;
+ }
+
+ /**
+ * Set the sourceDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @param sourceDbServerResourceId the sourceDbServerResourceId value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withSourceDbServerResourceId(String sourceDbServerResourceId) {
+ this.sourceDbServerResourceId = sourceDbServerResourceId;
+ return this;
+ }
+
+ /**
+ * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @return the sourceDbServerFullyQualifiedDomainName value.
+ */
+ public String sourceDbServerFullyQualifiedDomainName() {
+ return this.sourceDbServerFullyQualifiedDomainName;
+ }
+
+ /**
+ * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withSourceDbServerFullyQualifiedDomainName(
+ String sourceDbServerFullyQualifiedDomainName) {
+ this.sourceDbServerFullyQualifiedDomainName = sourceDbServerFullyQualifiedDomainName;
+ return this;
+ }
+
+ /**
+ * Get the targetDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @return the targetDbServerResourceId value.
+ */
+ public String targetDbServerResourceId() {
+ return this.targetDbServerResourceId;
+ }
+
+ /**
+ * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @return the targetDbServerFullyQualifiedDomainName value.
+ */
+ public String targetDbServerFullyQualifiedDomainName() {
+ return this.targetDbServerFullyQualifiedDomainName;
+ }
+
+ /**
+ * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withTargetDbServerFullyQualifiedDomainName(
+ String targetDbServerFullyQualifiedDomainName) {
+ this.targetDbServerFullyQualifiedDomainName = targetDbServerFullyQualifiedDomainName;
+ return this;
+ }
+
+ /**
+ * Get the secretParameters property: Migration secret parameters.
+ *
+ * @return the secretParameters value.
+ */
+ public MigrationSecretParameters secretParameters() {
+ return this.secretParameters;
+ }
+
+ /**
+ * Set the secretParameters property: Migration secret parameters.
+ *
+ * @param secretParameters the secretParameters value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withSecretParameters(MigrationSecretParameters secretParameters) {
+ this.secretParameters = secretParameters;
+ return this;
+ }
+
+ /**
+ * Get the dbsToMigrate property: Number of databases to migrate.
+ *
+ * @return the dbsToMigrate value.
+ */
+ public List dbsToMigrate() {
+ return this.dbsToMigrate;
+ }
+
+ /**
+ * Set the dbsToMigrate property: Number of databases to migrate.
+ *
+ * @param dbsToMigrate the dbsToMigrate value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withDbsToMigrate(List dbsToMigrate) {
+ this.dbsToMigrate = dbsToMigrate;
+ return this;
+ }
+
+ /**
+ * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup
+ * LogicalReplicationOnSourceDb, if needed.
+ *
+ * @return the setupLogicalReplicationOnSourceDbIfNeeded value.
+ */
+ public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() {
+ return this.setupLogicalReplicationOnSourceDbIfNeeded;
+ }
+
+ /**
+ * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup
+ * LogicalReplicationOnSourceDb, if needed.
+ *
+ * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withSetupLogicalReplicationOnSourceDbIfNeeded(
+ LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) {
+ this.setupLogicalReplicationOnSourceDbIfNeeded = setupLogicalReplicationOnSourceDbIfNeeded;
+ return this;
+ }
+
+ /**
+ * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten,
+ * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the
+ * database already exists.
+ *
+ * @return the overwriteDbsInTarget value.
+ */
+ public OverwriteDbsInTargetEnum overwriteDbsInTarget() {
+ return this.overwriteDbsInTarget;
+ }
+
+ /**
+ * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten,
+ * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the
+ * database already exists.
+ *
+ * @param overwriteDbsInTarget the overwriteDbsInTarget value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) {
+ this.overwriteDbsInTarget = overwriteDbsInTarget;
+ return this;
+ }
+
+ /**
+ * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window.
+ *
+ * @return the migrationWindowStartTimeInUtc value.
+ */
+ public OffsetDateTime migrationWindowStartTimeInUtc() {
+ return this.migrationWindowStartTimeInUtc;
+ }
+
+ /**
+ * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window.
+ *
+ * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) {
+ this.migrationWindowStartTimeInUtc = migrationWindowStartTimeInUtc;
+ return this;
+ }
+
+ /**
+ * Get the migrationWindowEndTimeInUtc property: End time in UTC for migration window.
+ *
+ * @return the migrationWindowEndTimeInUtc value.
+ */
+ public OffsetDateTime migrationWindowEndTimeInUtc() {
+ return this.migrationWindowEndTimeInUtc;
+ }
+
+ /**
+ * Set the migrationWindowEndTimeInUtc property: End time in UTC for migration window.
+ *
+ * @param migrationWindowEndTimeInUtc the migrationWindowEndTimeInUtc value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc) {
+ this.migrationWindowEndTimeInUtc = migrationWindowEndTimeInUtc;
+ return this;
+ }
+
+ /**
+ * Get the startDataMigration property: Indicates whether the data migration should start right away.
+ *
+ * @return the startDataMigration value.
+ */
+ public StartDataMigrationEnum startDataMigration() {
+ return this.startDataMigration;
+ }
+
+ /**
+ * Set the startDataMigration property: Indicates whether the data migration should start right away.
+ *
+ * @param startDataMigration the startDataMigration value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withStartDataMigration(StartDataMigrationEnum startDataMigration) {
+ this.startDataMigration = startDataMigration;
+ return this;
+ }
+
+ /**
+ * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True.
+ *
+ * @return the triggerCutover value.
+ */
+ public TriggerCutoverEnum triggerCutover() {
+ return this.triggerCutover;
+ }
+
+ /**
+ * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True.
+ *
+ * @param triggerCutover the triggerCutover value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withTriggerCutover(TriggerCutoverEnum triggerCutover) {
+ this.triggerCutover = triggerCutover;
+ return this;
+ }
+
+ /**
+ * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send
+ * triggerCutover flag as True and database names in this array.
+ *
+ * @return the dbsToTriggerCutoverOn value.
+ */
+ public List dbsToTriggerCutoverOn() {
+ return this.dbsToTriggerCutoverOn;
+ }
+
+ /**
+ * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send
+ * triggerCutover flag as True and database names in this array.
+ *
+ * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) {
+ this.dbsToTriggerCutoverOn = dbsToTriggerCutoverOn;
+ return this;
+ }
+
+ /**
+ * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True.
+ *
+ * @return the cancel value.
+ */
+ public CancelEnum cancel() {
+ return this.cancel;
+ }
+
+ /**
+ * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True.
+ *
+ * @param cancel the cancel value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withCancel(CancelEnum cancel) {
+ this.cancel = cancel;
+ return this;
+ }
+
+ /**
+ * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag
+ * as True and database names in this array.
+ *
+ * @return the dbsToCancelMigrationOn value.
+ */
+ public List dbsToCancelMigrationOn() {
+ return this.dbsToCancelMigrationOn;
+ }
+
+ /**
+ * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag
+ * as True and database names in this array.
+ *
+ * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set.
+ * @return the MigrationResourceProperties object itself.
+ */
+ public MigrationResourceProperties withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) {
+ this.dbsToCancelMigrationOn = dbsToCancelMigrationOn;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (currentStatus() != null) {
+ currentStatus().validate();
+ }
+ if (sourceDbServerMetadata() != null) {
+ sourceDbServerMetadata().validate();
+ }
+ if (targetDbServerMetadata() != null) {
+ targetDbServerMetadata().validate();
+ }
+ if (secretParameters() != null) {
+ secretParameters().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java
new file mode 100644
index 0000000000000..978b1cc4a3249
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java
@@ -0,0 +1,422 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Migration resource properties for patch. */
+@Fluent
+public final class MigrationResourcePropertiesForPatch {
+ /*
+ * ResourceId of the source database server
+ */
+ @JsonProperty(value = "sourceDbServerResourceId")
+ private String sourceDbServerResourceId;
+
+ /*
+ * Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always
+ * use it for connection
+ */
+ @JsonProperty(value = "sourceDbServerFullyQualifiedDomainName")
+ private String sourceDbServerFullyQualifiedDomainName;
+
+ /*
+ * Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always
+ * use it for connection
+ */
+ @JsonProperty(value = "targetDbServerFullyQualifiedDomainName")
+ private String targetDbServerFullyQualifiedDomainName;
+
+ /*
+ * Migration secret parameters
+ */
+ @JsonProperty(value = "secretParameters")
+ private MigrationSecretParameters secretParameters;
+
+ /*
+ * Number of databases to migrate
+ */
+ @JsonProperty(value = "dbsToMigrate")
+ private List dbsToMigrate;
+
+ /*
+ * Indicates whether to setup LogicalReplicationOnSourceDb, if needed
+ */
+ @JsonProperty(value = "setupLogicalReplicationOnSourceDbIfNeeded")
+ private LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded;
+
+ /*
+ * Indicates whether the databases on the target server can be overwritten, if already present. If set to False,
+ * the migration workflow will wait for a confirmation, if it detects that the database already exists.
+ */
+ @JsonProperty(value = "overwriteDbsInTarget")
+ private OverwriteDbsInTargetEnum overwriteDbsInTarget;
+
+ /*
+ * Start time in UTC for migration window
+ */
+ @JsonProperty(value = "migrationWindowStartTimeInUtc")
+ private OffsetDateTime migrationWindowStartTimeInUtc;
+
+ /*
+ * Indicates whether the data migration should start right away
+ */
+ @JsonProperty(value = "startDataMigration")
+ private StartDataMigrationEnum startDataMigration;
+
+ /*
+ * To trigger cutover for entire migration we need to send this flag as True
+ */
+ @JsonProperty(value = "triggerCutover")
+ private TriggerCutoverEnum triggerCutover;
+
+ /*
+ * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in
+ * this array
+ */
+ @JsonProperty(value = "dbsToTriggerCutoverOn")
+ private List dbsToTriggerCutoverOn;
+
+ /*
+ * To trigger cancel for entire migration we need to send this flag as True
+ */
+ @JsonProperty(value = "cancel")
+ private CancelEnum cancel;
+
+ /*
+ * When you want to trigger cancel for specific databases send cancel flag as True and database names in this array
+ */
+ @JsonProperty(value = "dbsToCancelMigrationOn")
+ private List dbsToCancelMigrationOn;
+
+ /*
+ * There are two types of migration modes Online and Offline
+ */
+ @JsonProperty(value = "migrationMode")
+ private MigrationMode migrationMode;
+
+ /** Creates an instance of MigrationResourcePropertiesForPatch class. */
+ public MigrationResourcePropertiesForPatch() {
+ }
+
+ /**
+ * Get the sourceDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @return the sourceDbServerResourceId value.
+ */
+ public String sourceDbServerResourceId() {
+ return this.sourceDbServerResourceId;
+ }
+
+ /**
+ * Set the sourceDbServerResourceId property: ResourceId of the source database server.
+ *
+ * @param sourceDbServerResourceId the sourceDbServerResourceId value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withSourceDbServerResourceId(String sourceDbServerResourceId) {
+ this.sourceDbServerResourceId = sourceDbServerResourceId;
+ return this;
+ }
+
+ /**
+ * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @return the sourceDbServerFullyQualifiedDomainName value.
+ */
+ public String sourceDbServerFullyQualifiedDomainName() {
+ return this.sourceDbServerFullyQualifiedDomainName;
+ }
+
+ /**
+ * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withSourceDbServerFullyQualifiedDomainName(
+ String sourceDbServerFullyQualifiedDomainName) {
+ this.sourceDbServerFullyQualifiedDomainName = sourceDbServerFullyQualifiedDomainName;
+ return this;
+ }
+
+ /**
+ * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @return the targetDbServerFullyQualifiedDomainName value.
+ */
+ public String targetDbServerFullyQualifiedDomainName() {
+ return this.targetDbServerFullyQualifiedDomainName;
+ }
+
+ /**
+ * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a
+ * optional value, if customer provide it, dms will always use it for connection.
+ *
+ * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withTargetDbServerFullyQualifiedDomainName(
+ String targetDbServerFullyQualifiedDomainName) {
+ this.targetDbServerFullyQualifiedDomainName = targetDbServerFullyQualifiedDomainName;
+ return this;
+ }
+
+ /**
+ * Get the secretParameters property: Migration secret parameters.
+ *
+ * @return the secretParameters value.
+ */
+ public MigrationSecretParameters secretParameters() {
+ return this.secretParameters;
+ }
+
+ /**
+ * Set the secretParameters property: Migration secret parameters.
+ *
+ * @param secretParameters the secretParameters value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withSecretParameters(MigrationSecretParameters secretParameters) {
+ this.secretParameters = secretParameters;
+ return this;
+ }
+
+ /**
+ * Get the dbsToMigrate property: Number of databases to migrate.
+ *
+ * @return the dbsToMigrate value.
+ */
+ public List dbsToMigrate() {
+ return this.dbsToMigrate;
+ }
+
+ /**
+ * Set the dbsToMigrate property: Number of databases to migrate.
+ *
+ * @param dbsToMigrate the dbsToMigrate value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withDbsToMigrate(List dbsToMigrate) {
+ this.dbsToMigrate = dbsToMigrate;
+ return this;
+ }
+
+ /**
+ * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup
+ * LogicalReplicationOnSourceDb, if needed.
+ *
+ * @return the setupLogicalReplicationOnSourceDbIfNeeded value.
+ */
+ public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() {
+ return this.setupLogicalReplicationOnSourceDbIfNeeded;
+ }
+
+ /**
+ * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup
+ * LogicalReplicationOnSourceDb, if needed.
+ *
+ * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withSetupLogicalReplicationOnSourceDbIfNeeded(
+ LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) {
+ this.setupLogicalReplicationOnSourceDbIfNeeded = setupLogicalReplicationOnSourceDbIfNeeded;
+ return this;
+ }
+
+ /**
+ * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten,
+ * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the
+ * database already exists.
+ *
+ * @return the overwriteDbsInTarget value.
+ */
+ public OverwriteDbsInTargetEnum overwriteDbsInTarget() {
+ return this.overwriteDbsInTarget;
+ }
+
+ /**
+ * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten,
+ * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the
+ * database already exists.
+ *
+ * @param overwriteDbsInTarget the overwriteDbsInTarget value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) {
+ this.overwriteDbsInTarget = overwriteDbsInTarget;
+ return this;
+ }
+
+ /**
+ * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window.
+ *
+ * @return the migrationWindowStartTimeInUtc value.
+ */
+ public OffsetDateTime migrationWindowStartTimeInUtc() {
+ return this.migrationWindowStartTimeInUtc;
+ }
+
+ /**
+ * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window.
+ *
+ * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withMigrationWindowStartTimeInUtc(
+ OffsetDateTime migrationWindowStartTimeInUtc) {
+ this.migrationWindowStartTimeInUtc = migrationWindowStartTimeInUtc;
+ return this;
+ }
+
+ /**
+ * Get the startDataMigration property: Indicates whether the data migration should start right away.
+ *
+ * @return the startDataMigration value.
+ */
+ public StartDataMigrationEnum startDataMigration() {
+ return this.startDataMigration;
+ }
+
+ /**
+ * Set the startDataMigration property: Indicates whether the data migration should start right away.
+ *
+ * @param startDataMigration the startDataMigration value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withStartDataMigration(StartDataMigrationEnum startDataMigration) {
+ this.startDataMigration = startDataMigration;
+ return this;
+ }
+
+ /**
+ * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True.
+ *
+ * @return the triggerCutover value.
+ */
+ public TriggerCutoverEnum triggerCutover() {
+ return this.triggerCutover;
+ }
+
+ /**
+ * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True.
+ *
+ * @param triggerCutover the triggerCutover value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withTriggerCutover(TriggerCutoverEnum triggerCutover) {
+ this.triggerCutover = triggerCutover;
+ return this;
+ }
+
+ /**
+ * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send
+ * triggerCutover flag as True and database names in this array.
+ *
+ * @return the dbsToTriggerCutoverOn value.
+ */
+ public List dbsToTriggerCutoverOn() {
+ return this.dbsToTriggerCutoverOn;
+ }
+
+ /**
+ * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send
+ * triggerCutover flag as True and database names in this array.
+ *
+ * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) {
+ this.dbsToTriggerCutoverOn = dbsToTriggerCutoverOn;
+ return this;
+ }
+
+ /**
+ * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True.
+ *
+ * @return the cancel value.
+ */
+ public CancelEnum cancel() {
+ return this.cancel;
+ }
+
+ /**
+ * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True.
+ *
+ * @param cancel the cancel value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withCancel(CancelEnum cancel) {
+ this.cancel = cancel;
+ return this;
+ }
+
+ /**
+ * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag
+ * as True and database names in this array.
+ *
+ * @return the dbsToCancelMigrationOn value.
+ */
+ public List dbsToCancelMigrationOn() {
+ return this.dbsToCancelMigrationOn;
+ }
+
+ /**
+ * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag
+ * as True and database names in this array.
+ *
+ * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) {
+ this.dbsToCancelMigrationOn = dbsToCancelMigrationOn;
+ return this;
+ }
+
+ /**
+ * Get the migrationMode property: There are two types of migration modes Online and Offline.
+ *
+ * @return the migrationMode value.
+ */
+ public MigrationMode migrationMode() {
+ return this.migrationMode;
+ }
+
+ /**
+ * Set the migrationMode property: There are two types of migration modes Online and Offline.
+ *
+ * @param migrationMode the migrationMode value to set.
+ * @return the MigrationResourcePropertiesForPatch object itself.
+ */
+ public MigrationResourcePropertiesForPatch withMigrationMode(MigrationMode migrationMode) {
+ this.migrationMode = migrationMode;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (secretParameters() != null) {
+ secretParameters().validate();
+ }
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java
index 3fc6de6cf5bdf..86949fa7ef2a5 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java
@@ -318,7 +318,8 @@ public ServerInner withBackup(Backup backup) {
}
/**
- * Get the network property: Network properties of a server.
+ * Get the network property: Network properties of a server. This Network property is required to be passed only in
+ * case you want the server to be Private access server.
*
* @return the network value.
*/
@@ -327,7 +328,8 @@ public Network network() {
}
/**
- * Set the network property: Network properties of a server.
+ * Set the network property: Network properties of a server. This Network property is required to be passed only in
+ * case you want the server to be Private access server.
*
* @param network the network value to set.
* @return the ServerInner object itself.
@@ -388,7 +390,8 @@ public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) {
/**
* Get the sourceServerResourceId property: The source server resource ID to restore from. It's required when
- * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'.
+ * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned
+ * only for Replica server.
*
* @return the sourceServerResourceId value.
*/
@@ -398,7 +401,8 @@ public String sourceServerResourceId() {
/**
* Set the sourceServerResourceId property: The source server resource ID to restore from. It's required when
- * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'.
+ * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned
+ * only for Replica server.
*
* @param sourceServerResourceId the sourceServerResourceId value to set.
* @return the ServerInner object itself.
@@ -413,7 +417,7 @@ public ServerInner withSourceServerResourceId(String sourceServerResourceId) {
/**
* Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
- * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'.
+ * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'.
*
* @return the pointInTimeUtc value.
*/
@@ -423,7 +427,7 @@ public OffsetDateTime pointInTimeUtc() {
/**
* Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
- * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'.
+ * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'.
*
* @param pointInTimeUtc the pointInTimeUtc value to set.
* @return the ServerInner object itself.
@@ -491,20 +495,6 @@ public Integer replicaCapacity() {
return this.innerProperties() == null ? null : this.innerProperties().replicaCapacity();
}
- /**
- * Set the replicaCapacity property: Replicas allowed for a server.
- *
- * @param replicaCapacity the replicaCapacity value to set.
- * @return the ServerInner object itself.
- */
- public ServerInner withReplicaCapacity(Integer replicaCapacity) {
- if (this.innerProperties() == null) {
- this.innerProperties = new ServerProperties();
- }
- this.innerProperties().withReplicaCapacity(replicaCapacity);
- return this;
- }
-
/**
* Get the createMode property: The mode to create a new PostgreSQL server.
*
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java
index 95c1173a3b90c..13064d51ee9f7 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java
@@ -84,7 +84,8 @@ public final class ServerProperties {
private Backup backup;
/*
- * Network properties of a server.
+ * Network properties of a server. This Network property is required to be passed only in case you want the server
+ * to be Private access server.
*/
@JsonProperty(value = "network")
private Network network;
@@ -103,14 +104,14 @@ public final class ServerProperties {
/*
* The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or
- * 'GeoRestore' or 'Replica'.
+ * 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned only for Replica server
*/
@JsonProperty(value = "sourceServerResourceId")
private String sourceServerResourceId;
/*
* Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when
- * 'createMode' is 'PointInTimeRestore' or 'GeoRestore'.
+ * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'.
*/
@JsonProperty(value = "pointInTimeUTC")
private OffsetDateTime pointInTimeUtc;
@@ -130,7 +131,7 @@ public final class ServerProperties {
/*
* Replicas allowed for a server.
*/
- @JsonProperty(value = "replicaCapacity")
+ @JsonProperty(value = "replicaCapacity", access = JsonProperty.Access.WRITE_ONLY)
private Integer replicaCapacity;
/*
@@ -313,7 +314,8 @@ public ServerProperties withBackup(Backup backup) {
}
/**
- * Get the network property: Network properties of a server.
+ * Get the network property: Network properties of a server. This Network property is required to be passed only in
+ * case you want the server to be Private access server.
*
* @return the network value.
*/
@@ -322,7 +324,8 @@ public Network network() {
}
/**
- * Set the network property: Network properties of a server.
+ * Set the network property: Network properties of a server. This Network property is required to be passed only in
+ * case you want the server to be Private access server.
*
* @param network the network value to set.
* @return the ServerProperties object itself.
@@ -374,7 +377,8 @@ public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindo
/**
* Get the sourceServerResourceId property: The source server resource ID to restore from. It's required when
- * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'.
+ * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned
+ * only for Replica server.
*
* @return the sourceServerResourceId value.
*/
@@ -384,7 +388,8 @@ public String sourceServerResourceId() {
/**
* Set the sourceServerResourceId property: The source server resource ID to restore from. It's required when
- * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'.
+ * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned
+ * only for Replica server.
*
* @param sourceServerResourceId the sourceServerResourceId value to set.
* @return the ServerProperties object itself.
@@ -396,7 +401,7 @@ public ServerProperties withSourceServerResourceId(String sourceServerResourceId
/**
* Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
- * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'.
+ * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'.
*
* @return the pointInTimeUtc value.
*/
@@ -406,7 +411,7 @@ public OffsetDateTime pointInTimeUtc() {
/**
* Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore
- * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'.
+ * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'.
*
* @param pointInTimeUtc the pointInTimeUtc value to set.
* @return the ServerProperties object itself.
@@ -465,17 +470,6 @@ public Integer replicaCapacity() {
return this.replicaCapacity;
}
- /**
- * Set the replicaCapacity property: Replicas allowed for a server.
- *
- * @param replicaCapacity the replicaCapacity value to set.
- * @return the ServerProperties object itself.
- */
- public ServerProperties withReplicaCapacity(Integer replicaCapacity) {
- this.replicaCapacity = replicaCapacity;
- return this;
- }
-
/**
* Get the createMode property: The mode to create a new PostgreSQL server.
*
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java
index 47db10fbfcee9..0d1e315707ae0 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java
@@ -11,6 +11,7 @@
import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability;
import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.Network;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage;
@@ -79,6 +80,13 @@ public final class ServerPropertiesForUpdate {
@JsonProperty(value = "replicationRole")
private ReplicationRole replicationRole;
+ /*
+ * Network properties of a server. These are required to be passed only in case if server is a private access
+ * server.
+ */
+ @JsonProperty(value = "network")
+ private Network network;
+
/** Creates an instance of ServerPropertiesForUpdate class. */
public ServerPropertiesForUpdate() {
}
@@ -283,6 +291,28 @@ public ServerPropertiesForUpdate withReplicationRole(ReplicationRole replication
return this;
}
+ /**
+ * Get the network property: Network properties of a server. These are required to be passed only in case if server
+ * is a private access server.
+ *
+ * @return the network value.
+ */
+ public Network network() {
+ return this.network;
+ }
+
+ /**
+ * Set the network property: Network properties of a server. These are required to be passed only in case if server
+ * is a private access server.
+ *
+ * @param network the network value to set.
+ * @return the ServerPropertiesForUpdate object itself.
+ */
+ public ServerPropertiesForUpdate withNetwork(Network network) {
+ this.network = network;
+ return this;
+ }
+
/**
* Validates the instance.
*
@@ -307,5 +337,8 @@ public void validate() {
if (dataEncryption() != null) {
dataEncryption().validate();
}
+ if (network() != null) {
+ network().validate();
+ }
}
}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CapabilityPropertiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java
similarity index 50%
rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CapabilityPropertiesImpl.java
rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java
index 4698faa775da3..baf6aa401c2d2 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CapabilityPropertiesImpl.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java
@@ -4,53 +4,48 @@
package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
-import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner;
-import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityProperties;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityStatus;
import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability;
import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability;
-import com.azure.resourcemanager.postgresqlflexibleserver.models.HyperscaleNodeEditionCapability;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoBackupSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.OnlineResizeSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum;
import java.util.Collections;
import java.util.List;
-public final class CapabilityPropertiesImpl implements CapabilityProperties {
- private CapabilityPropertiesInner innerObject;
+public final class FlexibleServerCapabilityImpl implements FlexibleServerCapability {
+ private FlexibleServerCapabilityInner innerObject;
private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
- CapabilityPropertiesImpl(
- CapabilityPropertiesInner innerObject,
+ FlexibleServerCapabilityImpl(
+ FlexibleServerCapabilityInner innerObject,
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
- public String zone() {
- return this.innerModel().zone();
- }
-
- public List supportedHAMode() {
- List inner = this.innerModel().supportedHAMode();
- if (inner != null) {
- return Collections.unmodifiableList(inner);
- } else {
- return Collections.emptyList();
- }
+ public CapabilityStatus status() {
+ return this.innerModel().status();
}
- public Boolean geoBackupSupported() {
- return this.innerModel().geoBackupSupported();
+ public String reason() {
+ return this.innerModel().reason();
}
- public Boolean zoneRedundantHaSupported() {
- return this.innerModel().zoneRedundantHaSupported();
+ public String name() {
+ return this.innerModel().name();
}
- public Boolean zoneRedundantHaAndGeoBackupSupported() {
- return this.innerModel().zoneRedundantHaAndGeoBackupSupported();
- }
-
- public List supportedFlexibleServerEditions() {
- List inner = this.innerModel().supportedFlexibleServerEditions();
+ public List supportedServerEditions() {
+ List inner = this.innerModel().supportedServerEditions();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
@@ -58,8 +53,8 @@ public List supportedFlexibleServerEditions() {
}
}
- public List supportedHyperscaleNodeEditions() {
- List inner = this.innerModel().supportedHyperscaleNodeEditions();
+ public List supportedServerVersions() {
+ List inner = this.innerModel().supportedServerVersions();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
@@ -67,7 +62,7 @@ public List supportedHyperscaleNodeEditions() {
}
}
- public Boolean fastProvisioningSupported() {
+ public FastProvisioningSupportedEnum fastProvisioningSupported() {
return this.innerModel().fastProvisioningSupported();
}
@@ -80,11 +75,31 @@ public List supportedFastProvisioningEditions
}
}
- public String status() {
- return this.innerModel().status();
+ public GeoBackupSupportedEnum geoBackupSupported() {
+ return this.innerModel().geoBackupSupported();
+ }
+
+ public ZoneRedundantHaSupportedEnum zoneRedundantHaSupported() {
+ return this.innerModel().zoneRedundantHaSupported();
+ }
+
+ public ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported() {
+ return this.innerModel().zoneRedundantHaAndGeoBackupSupported();
+ }
+
+ public StorageAutoGrowthSupportedEnum storageAutoGrowthSupported() {
+ return this.innerModel().storageAutoGrowthSupported();
+ }
+
+ public OnlineResizeSupportedEnum onlineResizeSupported() {
+ return this.innerModel().onlineResizeSupported();
+ }
+
+ public RestrictedEnum restricted() {
+ return this.innerModel().restricted();
}
- public CapabilityPropertiesInner innerModel() {
+ public FlexibleServerCapabilityInner innerModel() {
return this.innerObject;
}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java
new file mode 100644
index 0000000000000..5d05bac0cfc63
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java
@@ -0,0 +1,533 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.ExpectedResponses;
+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.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.FlexibleServersClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupResponse;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest;
+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 FlexibleServersClient. */
+public final class FlexibleServersClientImpl implements FlexibleServersClient {
+ /** The proxy service used to perform REST calls. */
+ private final FlexibleServersService service;
+
+ /** The service client containing this operation class. */
+ private final PostgreSqlManagementClientImpl client;
+
+ /**
+ * Initializes an instance of FlexibleServersClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ FlexibleServersClientImpl(PostgreSqlManagementClientImpl client) {
+ this.service =
+ RestProxy.create(FlexibleServersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for PostgreSqlManagementClientFlexibleServers to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "PostgreSqlManagement")
+ public interface FlexibleServersService {
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrPreBackup")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono triggerLtrPreBackup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverName") String serverName,
+ @BodyParam("application/json") LtrPreBackupRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startLtrBackup")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> startLtrBackup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverName") String serverName,
+ @BodyParam("application/json") LtrBackupRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup
+ * operation to succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR pre-backup API call on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono triggerLtrPreBackupWithResponseAsync(
+ String resourceGroupName, String serverName, LtrPreBackupRequest 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 (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName 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
+ .triggerLtrPreBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup
+ * operation to succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR pre-backup API call on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono triggerLtrPreBackupWithResponseAsync(
+ String resourceGroupName, String serverName, LtrPreBackupRequest 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 (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName 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
+ .triggerLtrPreBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup
+ * operation to succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR pre-backup API call on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono triggerLtrPreBackupAsync(
+ String resourceGroupName, String serverName, LtrPreBackupRequest parameters) {
+ return triggerLtrPreBackupWithResponseAsync(resourceGroupName, serverName, parameters)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup
+ * operation to succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR pre-backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FlexibleServersTriggerLtrPreBackupResponse triggerLtrPreBackupWithResponse(
+ String resourceGroupName, String serverName, LtrPreBackupRequest parameters, Context context) {
+ return triggerLtrPreBackupWithResponseAsync(resourceGroupName, serverName, parameters, context).block();
+ }
+
+ /**
+ * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup
+ * operation to succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR pre-backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public LtrPreBackupResponseInner triggerLtrPreBackup(
+ String resourceGroupName, String serverName, LtrPreBackupRequest parameters) {
+ return triggerLtrPreBackupWithResponse(resourceGroupName, serverName, parameters, Context.NONE).getValue();
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR backup API call along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono>> startLtrBackupWithResponseAsync(
+ String resourceGroupName, String serverName, LtrBackupRequest 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 (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName 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
+ .startLtrBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR backup API call along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> startLtrBackupWithResponseAsync(
+ String resourceGroupName, String serverName, LtrBackupRequest 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 (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName 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
+ .startLtrBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ serverName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response for the LTR backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux, LtrBackupResponseInner> beginStartLtrBackupAsync(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters) {
+ Mono>> mono =
+ startLtrBackupWithResponseAsync(resourceGroupName, serverName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ LtrBackupResponseInner.class,
+ LtrBackupResponseInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response for the LTR backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, LtrBackupResponseInner> beginStartLtrBackupAsync(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ startLtrBackupWithResponseAsync(resourceGroupName, serverName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ LtrBackupResponseInner.class,
+ LtrBackupResponseInner.class,
+ context);
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for the LTR backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, LtrBackupResponseInner> beginStartLtrBackup(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters) {
+ return this.beginStartLtrBackupAsync(resourceGroupName, serverName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for the LTR backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, LtrBackupResponseInner> beginStartLtrBackup(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) {
+ return this.beginStartLtrBackupAsync(resourceGroupName, serverName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR backup API call on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono startLtrBackupAsync(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters) {
+ return beginStartLtrBackupAsync(resourceGroupName, serverName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR backup API call on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono startLtrBackupAsync(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) {
+ return beginStartLtrBackupAsync(resourceGroupName, serverName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public LtrBackupResponseInner startLtrBackup(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters) {
+ return startLtrBackupAsync(resourceGroupName, serverName, parameters).block();
+ }
+
+ /**
+ * Start the Long Term Retention Backup operation.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the LTR backup API call.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public LtrBackupResponseInner startLtrBackup(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) {
+ return startLtrBackupAsync(resourceGroupName, serverName, parameters, context).block();
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java
new file mode 100644
index 0000000000000..db85a88f9734e
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.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.postgresqlflexibleserver.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.FlexibleServersClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServers;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupResponse;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupResponse;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupResponse;
+
+public final class FlexibleServersImpl implements FlexibleServers {
+ private static final ClientLogger LOGGER = new ClientLogger(FlexibleServersImpl.class);
+
+ private final FlexibleServersClient innerClient;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ public FlexibleServersImpl(
+ FlexibleServersClient innerClient,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response triggerLtrPreBackupWithResponse(
+ String resourceGroupName, String serverName, LtrPreBackupRequest parameters, Context context) {
+ FlexibleServersTriggerLtrPreBackupResponse inner =
+ this.serviceClient().triggerLtrPreBackupWithResponse(resourceGroupName, serverName, parameters, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new LtrPreBackupResponseImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public LtrPreBackupResponse triggerLtrPreBackup(
+ String resourceGroupName, String serverName, LtrPreBackupRequest parameters) {
+ LtrPreBackupResponseInner inner =
+ this.serviceClient().triggerLtrPreBackup(resourceGroupName, serverName, parameters);
+ if (inner != null) {
+ return new LtrPreBackupResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public LtrBackupResponse startLtrBackup(String resourceGroupName, String serverName, LtrBackupRequest parameters) {
+ LtrBackupResponseInner inner = this.serviceClient().startLtrBackup(resourceGroupName, serverName, parameters);
+ if (inner != null) {
+ return new LtrBackupResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public LtrBackupResponse startLtrBackup(
+ String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) {
+ LtrBackupResponseInner inner =
+ this.serviceClient().startLtrBackup(resourceGroupName, serverName, parameters, context);
+ if (inner != null) {
+ return new LtrBackupResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private FlexibleServersClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java
index 1d3556eb07ea6..e3af7907c2eba 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java
@@ -26,7 +26,7 @@
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LocationBasedCapabilitiesClient;
-import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult;
import reactor.core.publisher.Mono;
@@ -93,7 +93,7 @@ Mono> executeNext(
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> executeSinglePageAsync(String locationName) {
+ private Mono> executeSinglePageAsync(String locationName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -121,7 +121,7 @@ private Mono> executeSinglePageAsync(St
locationName,
accept,
context))
- .>map(
+ .>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
@@ -145,7 +145,7 @@ private Mono> executeSinglePageAsync(St
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> executeSinglePageAsync(
+ private Mono> executeSinglePageAsync(
String locationName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -193,7 +193,7 @@ private Mono> executeSinglePageAsync(
* @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux executeAsync(String locationName) {
+ public PagedFlux executeAsync(String locationName) {
return new PagedFlux<>(
() -> executeSinglePageAsync(locationName), nextLink -> executeNextSinglePageAsync(nextLink));
}
@@ -209,7 +209,7 @@ public PagedFlux executeAsync(String locationName) {
* @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux executeAsync(String locationName, Context context) {
+ private PagedFlux executeAsync(String locationName, Context context) {
return new PagedFlux<>(
() -> executeSinglePageAsync(locationName, context),
nextLink -> executeNextSinglePageAsync(nextLink, context));
@@ -226,7 +226,7 @@ private PagedFlux executeAsync(String locationName, C
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable execute(String locationName) {
+ public PagedIterable execute(String locationName) {
return new PagedIterable<>(executeAsync(locationName));
}
@@ -242,7 +242,7 @@ public PagedIterable execute(String locationName) {
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable execute(String locationName, Context context) {
+ public PagedIterable execute(String locationName, Context context) {
return new PagedIterable<>(executeAsync(locationName, context));
}
@@ -254,10 +254,11 @@ public PagedIterable execute(String locationName, Con
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return location capability along with {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> executeNextSinglePageAsync(String nextLink) {
+ private Mono> executeNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
@@ -270,7 +271,7 @@ private Mono> executeNextSinglePageAsyn
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.executeNext(nextLink, this.client.getEndpoint(), accept, context))
- .>map(
+ .>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
@@ -291,10 +292,11 @@ private Mono> executeNextSinglePageAsyn
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return location capability along with {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> executeNextSinglePageAsync(
+ private Mono> executeNextSinglePageAsync(
String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java
index ea794b02808bb..f05bef6bedf84 100644
--- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java
@@ -8,8 +8,8 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LocationBasedCapabilitiesClient;
-import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner;
-import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityProperties;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability;
import com.azure.resourcemanager.postgresqlflexibleserver.models.LocationBasedCapabilities;
public final class LocationBasedCapabilitiesImpl implements LocationBasedCapabilities {
@@ -26,14 +26,14 @@ public LocationBasedCapabilitiesImpl(
this.serviceManager = serviceManager;
}
- public PagedIterable execute(String locationName) {
- PagedIterable inner = this.serviceClient().execute(locationName);
- return Utils.mapPage(inner, inner1 -> new CapabilityPropertiesImpl(inner1, this.manager()));
+ public PagedIterable execute(String locationName) {
+ PagedIterable inner = this.serviceClient().execute(locationName);
+ return Utils.mapPage(inner, inner1 -> new FlexibleServerCapabilityImpl(inner1, this.manager()));
}
- public PagedIterable execute(String locationName, Context context) {
- PagedIterable inner = this.serviceClient().execute(locationName, context);
- return Utils.mapPage(inner, inner1 -> new CapabilityPropertiesImpl(inner1, this.manager()));
+ public PagedIterable execute(String locationName, Context context) {
+ PagedIterable inner = this.serviceClient().execute(locationName, context);
+ return Utils.mapPage(inner, inner1 -> new FlexibleServerCapabilityImpl(inner1, this.manager()));
}
private LocationBasedCapabilitiesClient serviceClient() {
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java
new file mode 100644
index 0000000000000..972c57d60e67b
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFile;
+import java.time.OffsetDateTime;
+
+public final class LogFileImpl implements LogFile {
+ private LogFileInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ LogFileImpl(
+ LogFileInner innerObject, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public OffsetDateTime createdTime() {
+ return this.innerModel().createdTime();
+ }
+
+ public OffsetDateTime lastModifiedTime() {
+ return this.innerModel().lastModifiedTime();
+ }
+
+ public Long sizeInKb() {
+ return this.innerModel().sizeInKb();
+ }
+
+ public String typePropertiesType() {
+ return this.innerModel().typePropertiesType();
+ }
+
+ public String url() {
+ return this.innerModel().url();
+ }
+
+ public LogFileInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java
new file mode 100644
index 0000000000000..f6f737caa3cb3
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java
@@ -0,0 +1,332 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LogFilesClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFileListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in LogFilesClient. */
+public final class LogFilesClientImpl implements LogFilesClient {
+ /** The proxy service used to perform REST calls. */
+ private final LogFilesService service;
+
+ /** The service client containing this operation class. */
+ private final PostgreSqlManagementClientImpl client;
+
+ /**
+ * Initializes an instance of LogFilesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ LogFilesClientImpl(PostgreSqlManagementClientImpl client) {
+ this.service = RestProxy.create(LogFilesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for PostgreSqlManagementClientLogFiles to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "PostgreSqlManagement")
+ public interface LogFilesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/logFiles")
+ @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("serverName") String serverName,
+ @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);
+ }
+
+ /**
+ * List all the server log files in a given server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(String resourceGroupName, 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 (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,
+ 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 server log files in a given server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, 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 (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,
+ serverName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List all the server log files in a given server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 logFiles as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByServerAsync(String resourceGroupName, String serverName) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverName),
+ nextLink -> listByServerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the server log files in a given server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 logFiles as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverName, context),
+ nextLink -> listByServerNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the server log files in a given server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 logFiles as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(String resourceGroupName, String serverName) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName));
+ }
+
+ /**
+ * List all the server log files in a given server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 logFiles as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @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 URL to get the next list of items
+ * 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @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));
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java
new file mode 100644
index 0000000000000..5395cb92d9939
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LogFilesClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFile;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFiles;
+
+public final class LogFilesImpl implements LogFiles {
+ private static final ClientLogger LOGGER = new ClientLogger(LogFilesImpl.class);
+
+ private final LogFilesClient innerClient;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ public LogFilesImpl(
+ LogFilesClient innerClient,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByServer(String resourceGroupName, String serverName) {
+ PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
+ return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
+ PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context);
+ return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager()));
+ }
+
+ private LogFilesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java
new file mode 100644
index 0000000000000..3321070348805
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java
@@ -0,0 +1,520 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LtrBackupOperationsClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperationList;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in LtrBackupOperationsClient. */
+public final class LtrBackupOperationsClientImpl implements LtrBackupOperationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final LtrBackupOperationsService service;
+
+ /** The service client containing this operation class. */
+ private final PostgreSqlManagementClientImpl client;
+
+ /**
+ * Initializes an instance of LtrBackupOperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ LtrBackupOperationsClientImpl(PostgreSqlManagementClientImpl client) {
+ this.service =
+ RestProxy.create(LtrBackupOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for PostgreSqlManagementClientLtrBackupOperations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "PostgreSqlManagement")
+ public interface LtrBackupOperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations/{backupName}")
+ @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("serverName") String serverName,
+ @PathParam("backupName") String backupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations")
+ @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("serverName") String serverName,
+ @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);
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operation for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param backupName The name of the backup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of the give long term retention backup operation for the flexible server along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String serverName, String backupName) {
+ 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 (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
+ }
+ if (backupName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter backupName 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,
+ serverName,
+ backupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operation for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param backupName The name of the backup.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of the give long term retention backup operation for the flexible server along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String serverName, String backupName, 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 (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
+ }
+ if (backupName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter backupName 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,
+ serverName,
+ backupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operation for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param backupName The name of the backup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of the give long term retention backup operation for the flexible server on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String resourceGroupName, String serverName, String backupName) {
+ return getWithResponseAsync(resourceGroupName, serverName, backupName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operation for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param backupName The name of the backup.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of the give long term retention backup operation for the flexible server along with {@link
+ * Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String serverName, String backupName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serverName, backupName, context).block();
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operation for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param backupName The name of the backup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of the give long term retention backup operation for the flexible server.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public LtrServerBackupOperationInner get(String resourceGroupName, String serverName, String backupName) {
+ return getWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue();
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operations for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 the result of the give long term retention backup operations for the flexible server along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, 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 (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,
+ 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()));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operations for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 the result of the give long term retention backup operations for the flexible server along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, 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 (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,
+ serverName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operations for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 the result of the give long term retention backup operations for the flexible server as paginated
+ * response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByServerAsync(String resourceGroupName, String serverName) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverName),
+ nextLink -> listByServerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operations for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 the result of the give long term retention backup operations for the flexible server as paginated
+ * response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerAsync(
+ String resourceGroupName, String serverName, Context context) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverName, context),
+ nextLink -> listByServerNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operations for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 the result of the give long term retention backup operations for the flexible server as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(String resourceGroupName, String serverName) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName));
+ }
+
+ /**
+ * Gets the result of the give long term retention backup operations for the flexible server.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 the result of the give long term retention backup operations for the flexible server as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverName, Context context) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 long term retention backup operations for server along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @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 URL to get the next list of items
+ * 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 long term retention backup operations for server along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @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));
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java
new file mode 100644
index 0000000000000..e5f797dcfb7ac
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.LtrBackupOperationsClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupOperations;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperation;
+
+public final class LtrBackupOperationsImpl implements LtrBackupOperations {
+ private static final ClientLogger LOGGER = new ClientLogger(LtrBackupOperationsImpl.class);
+
+ private final LtrBackupOperationsClient innerClient;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ public LtrBackupOperationsImpl(
+ LtrBackupOperationsClient innerClient,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String serverName, String backupName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, serverName, backupName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new LtrServerBackupOperationImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public LtrServerBackupOperation get(String resourceGroupName, String serverName, String backupName) {
+ LtrServerBackupOperationInner inner = this.serviceClient().get(resourceGroupName, serverName, backupName);
+ if (inner != null) {
+ return new LtrServerBackupOperationImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public PagedIterable listByServer(String resourceGroupName, String serverName) {
+ PagedIterable inner =
+ this.serviceClient().listByServer(resourceGroupName, serverName);
+ return Utils.mapPage(inner, inner1 -> new LtrServerBackupOperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByServer(resourceGroupName, serverName, context);
+ return Utils.mapPage(inner, inner1 -> new LtrServerBackupOperationImpl(inner1, this.manager()));
+ }
+
+ private LtrBackupOperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java
new file mode 100644
index 0000000000000..f83d22134bb32
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupResponse;
+import java.time.OffsetDateTime;
+
+public final class LtrBackupResponseImpl implements LtrBackupResponse {
+ private LtrBackupResponseInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ LtrBackupResponseImpl(
+ LtrBackupResponseInner innerObject,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public Long datasourceSizeInBytes() {
+ return this.innerModel().datasourceSizeInBytes();
+ }
+
+ public Long dataTransferredInBytes() {
+ return this.innerModel().dataTransferredInBytes();
+ }
+
+ public String backupName() {
+ return this.innerModel().backupName();
+ }
+
+ public String backupMetadata() {
+ return this.innerModel().backupMetadata();
+ }
+
+ public ExecutionStatus status() {
+ return this.innerModel().status();
+ }
+
+ public OffsetDateTime startTime() {
+ return this.innerModel().startTime();
+ }
+
+ public OffsetDateTime endTime() {
+ return this.innerModel().endTime();
+ }
+
+ public Double percentComplete() {
+ return this.innerModel().percentComplete();
+ }
+
+ public String errorCode() {
+ return this.innerModel().errorCode();
+ }
+
+ public String errorMessage() {
+ return this.innerModel().errorMessage();
+ }
+
+ public LtrBackupResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java
new file mode 100644
index 0000000000000..52e93387b43ed
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupResponse;
+
+public final class LtrPreBackupResponseImpl implements LtrPreBackupResponse {
+ private LtrPreBackupResponseInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ LtrPreBackupResponseImpl(
+ LtrPreBackupResponseInner innerObject,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public int numberOfContainers() {
+ return this.innerModel().numberOfContainers();
+ }
+
+ public LtrPreBackupResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java
new file mode 100644
index 0000000000000..b2e21b253eefb
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.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.postgresqlflexibleserver.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperation;
+import java.time.OffsetDateTime;
+
+public final class LtrServerBackupOperationImpl implements LtrServerBackupOperation {
+ private LtrServerBackupOperationInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ LtrServerBackupOperationImpl(
+ LtrServerBackupOperationInner innerObject,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Long datasourceSizeInBytes() {
+ return this.innerModel().datasourceSizeInBytes();
+ }
+
+ public Long dataTransferredInBytes() {
+ return this.innerModel().dataTransferredInBytes();
+ }
+
+ public String backupName() {
+ return this.innerModel().backupName();
+ }
+
+ public String backupMetadata() {
+ return this.innerModel().backupMetadata();
+ }
+
+ public ExecutionStatus status() {
+ return this.innerModel().status();
+ }
+
+ public OffsetDateTime startTime() {
+ return this.innerModel().startTime();
+ }
+
+ public OffsetDateTime endTime() {
+ return this.innerModel().endTime();
+ }
+
+ public Double percentComplete() {
+ return this.innerModel().percentComplete();
+ }
+
+ public String errorCode() {
+ return this.innerModel().errorCode();
+ }
+
+ public String errorMessage() {
+ return this.innerModel().errorMessage();
+ }
+
+ public LtrServerBackupOperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java
new file mode 100644
index 0000000000000..21300cb9457ab
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityReason;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityResource;
+
+public final class MigrationNameAvailabilityResourceImpl implements MigrationNameAvailabilityResource {
+ private MigrationNameAvailabilityResourceInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ MigrationNameAvailabilityResourceImpl(
+ MigrationNameAvailabilityResourceInner innerObject,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public Boolean nameAvailable() {
+ return this.innerModel().nameAvailable();
+ }
+
+ public MigrationNameAvailabilityReason reason() {
+ return this.innerModel().reason();
+ }
+
+ public String message() {
+ return this.innerModel().message();
+ }
+
+ public MigrationNameAvailabilityResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java
new file mode 100644
index 0000000000000..c0de03fbb1e5a
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java
@@ -0,0 +1,465 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum;
+import java.time.OffsetDateTime;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class MigrationResourceImpl
+ implements MigrationResource, MigrationResource.Definition, MigrationResource.Update {
+ private MigrationResourceInner innerObject;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String migrationId() {
+ return this.innerModel().migrationId();
+ }
+
+ public MigrationStatus currentStatus() {
+ return this.innerModel().currentStatus();
+ }
+
+ public MigrationMode migrationMode() {
+ return this.innerModel().migrationMode();
+ }
+
+ public DbServerMetadata sourceDbServerMetadata() {
+ return this.innerModel().sourceDbServerMetadata();
+ }
+
+ public DbServerMetadata targetDbServerMetadata() {
+ return this.innerModel().targetDbServerMetadata();
+ }
+
+ public String sourceDbServerResourceId() {
+ return this.innerModel().sourceDbServerResourceId();
+ }
+
+ public String sourceDbServerFullyQualifiedDomainName() {
+ return this.innerModel().sourceDbServerFullyQualifiedDomainName();
+ }
+
+ public String targetDbServerResourceId() {
+ return this.innerModel().targetDbServerResourceId();
+ }
+
+ public String targetDbServerFullyQualifiedDomainName() {
+ return this.innerModel().targetDbServerFullyQualifiedDomainName();
+ }
+
+ public MigrationSecretParameters secretParameters() {
+ return this.innerModel().secretParameters();
+ }
+
+ public List dbsToMigrate() {
+ List inner = this.innerModel().dbsToMigrate();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() {
+ return this.innerModel().setupLogicalReplicationOnSourceDbIfNeeded();
+ }
+
+ public OverwriteDbsInTargetEnum overwriteDbsInTarget() {
+ return this.innerModel().overwriteDbsInTarget();
+ }
+
+ public OffsetDateTime migrationWindowStartTimeInUtc() {
+ return this.innerModel().migrationWindowStartTimeInUtc();
+ }
+
+ public OffsetDateTime migrationWindowEndTimeInUtc() {
+ return this.innerModel().migrationWindowEndTimeInUtc();
+ }
+
+ public StartDataMigrationEnum startDataMigration() {
+ return this.innerModel().startDataMigration();
+ }
+
+ public TriggerCutoverEnum triggerCutover() {
+ return this.innerModel().triggerCutover();
+ }
+
+ public List dbsToTriggerCutoverOn() {
+ List inner = this.innerModel().dbsToTriggerCutoverOn();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public CancelEnum cancel() {
+ return this.innerModel().cancel();
+ }
+
+ public List dbsToCancelMigrationOn() {
+ List inner = this.innerModel().dbsToCancelMigrationOn();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public MigrationResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() {
+ return this.serviceManager;
+ }
+
+ private String subscriptionId;
+
+ private String resourceGroupName;
+
+ private String targetDbServerName;
+
+ private String migrationName;
+
+ private MigrationResourceForPatch updateParameters;
+
+ public MigrationResourceImpl withExistingFlexibleServer(
+ String subscriptionId, String resourceGroupName, String targetDbServerName) {
+ this.subscriptionId = subscriptionId;
+ this.resourceGroupName = resourceGroupName;
+ this.targetDbServerName = targetDbServerName;
+ return this;
+ }
+
+ public MigrationResource create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMigrations()
+ .createWithResponse(
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ this.innerModel(),
+ Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public MigrationResource create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMigrations()
+ .createWithResponse(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ MigrationResourceImpl(
+ String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = new MigrationResourceInner();
+ this.serviceManager = serviceManager;
+ this.migrationName = name;
+ }
+
+ public MigrationResourceImpl update() {
+ this.updateParameters = new MigrationResourceForPatch();
+ return this;
+ }
+
+ public MigrationResource apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMigrations()
+ .updateWithResponse(
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ updateParameters,
+ Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public MigrationResource apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMigrations()
+ .updateWithResponse(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationName, updateParameters, context)
+ .getValue();
+ return this;
+ }
+
+ MigrationResourceImpl(
+ MigrationResourceInner innerObject,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.subscriptionId = Utils.getValueFromIdByName(innerObject.id(), "subscriptions");
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.targetDbServerName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers");
+ this.migrationName = Utils.getValueFromIdByName(innerObject.id(), "migrations");
+ }
+
+ public MigrationResource refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMigrations()
+ .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public MigrationResource refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMigrations()
+ .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context)
+ .getValue();
+ return this;
+ }
+
+ public MigrationResourceImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public MigrationResourceImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public MigrationResourceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateParameters.withTags(tags);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withMigrationMode(MigrationMode migrationMode) {
+ if (isInCreateMode()) {
+ this.innerModel().withMigrationMode(migrationMode);
+ return this;
+ } else {
+ this.updateParameters.withMigrationMode(migrationMode);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withSourceDbServerResourceId(String sourceDbServerResourceId) {
+ if (isInCreateMode()) {
+ this.innerModel().withSourceDbServerResourceId(sourceDbServerResourceId);
+ return this;
+ } else {
+ this.updateParameters.withSourceDbServerResourceId(sourceDbServerResourceId);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withSourceDbServerFullyQualifiedDomainName(
+ String sourceDbServerFullyQualifiedDomainName) {
+ if (isInCreateMode()) {
+ this.innerModel().withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName);
+ return this;
+ } else {
+ this.updateParameters.withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withTargetDbServerFullyQualifiedDomainName(
+ String targetDbServerFullyQualifiedDomainName) {
+ if (isInCreateMode()) {
+ this.innerModel().withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName);
+ return this;
+ } else {
+ this.updateParameters.withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withSecretParameters(MigrationSecretParameters secretParameters) {
+ if (isInCreateMode()) {
+ this.innerModel().withSecretParameters(secretParameters);
+ return this;
+ } else {
+ this.updateParameters.withSecretParameters(secretParameters);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withDbsToMigrate(List dbsToMigrate) {
+ if (isInCreateMode()) {
+ this.innerModel().withDbsToMigrate(dbsToMigrate);
+ return this;
+ } else {
+ this.updateParameters.withDbsToMigrate(dbsToMigrate);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withSetupLogicalReplicationOnSourceDbIfNeeded(
+ LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) {
+ if (isInCreateMode()) {
+ this.innerModel().withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded);
+ return this;
+ } else {
+ this
+ .updateParameters
+ .withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) {
+ if (isInCreateMode()) {
+ this.innerModel().withOverwriteDbsInTarget(overwriteDbsInTarget);
+ return this;
+ } else {
+ this.updateParameters.withOverwriteDbsInTarget(overwriteDbsInTarget);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) {
+ if (isInCreateMode()) {
+ this.innerModel().withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc);
+ return this;
+ } else {
+ this.updateParameters.withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc) {
+ this.innerModel().withMigrationWindowEndTimeInUtc(migrationWindowEndTimeInUtc);
+ return this;
+ }
+
+ public MigrationResourceImpl withStartDataMigration(StartDataMigrationEnum startDataMigration) {
+ if (isInCreateMode()) {
+ this.innerModel().withStartDataMigration(startDataMigration);
+ return this;
+ } else {
+ this.updateParameters.withStartDataMigration(startDataMigration);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withTriggerCutover(TriggerCutoverEnum triggerCutover) {
+ if (isInCreateMode()) {
+ this.innerModel().withTriggerCutover(triggerCutover);
+ return this;
+ } else {
+ this.updateParameters.withTriggerCutover(triggerCutover);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) {
+ if (isInCreateMode()) {
+ this.innerModel().withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn);
+ return this;
+ } else {
+ this.updateParameters.withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withCancel(CancelEnum cancel) {
+ if (isInCreateMode()) {
+ this.innerModel().withCancel(cancel);
+ return this;
+ } else {
+ this.updateParameters.withCancel(cancel);
+ return this;
+ }
+ }
+
+ public MigrationResourceImpl withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) {
+ if (isInCreateMode()) {
+ this.innerModel().withDbsToCancelMigrationOn(dbsToCancelMigrationOn);
+ return this;
+ } else {
+ this.updateParameters.withDbsToCancelMigrationOn(dbsToCancelMigrationOn);
+ return this;
+ }
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java
new file mode 100644
index 0000000000000..a95d22c2f1504
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java
@@ -0,0 +1,1207 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.MigrationsClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in MigrationsClient. */
+public final class MigrationsClientImpl implements MigrationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final MigrationsService service;
+
+ /** The service client containing this operation class. */
+ private final PostgreSqlManagementClientImpl client;
+
+ /**
+ * Initializes an instance of MigrationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ MigrationsClientImpl(PostgreSqlManagementClientImpl client) {
+ this.service =
+ RestProxy.create(MigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for PostgreSqlManagementClientMigrations to be used by the proxy service
+ * to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "PostgreSqlManagement")
+ public interface MigrationsService {
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> create(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("targetDbServerName") String targetDbServerName,
+ @PathParam("migrationName") String migrationName,
+ @BodyParam("application/json") MigrationResourceInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}")
+ @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("targetDbServerName") String targetDbServerName,
+ @PathParam("migrationName") String migrationName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("targetDbServerName") String targetDbServerName,
+ @PathParam("migrationName") String migrationName,
+ @BodyParam("application/json") MigrationResourceForPatch parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("targetDbServerName") String targetDbServerName,
+ @PathParam("migrationName") String migrationName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByTargetServer(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("targetDbServerName") String targetDbServerName,
+ @QueryParam("migrationListFilter") MigrationListFilter migrationListFilter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByTargetServerNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Creates a new migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for creating a migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName 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
+ .create(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates a new migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for creating a migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceInner parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName 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
+ .create(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates a new migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for creating a migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceInner parameters) {
+ return createWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates a new migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for creating a migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceInner parameters,
+ Context context) {
+ return createWithResponseAsync(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, context)
+ .block();
+ }
+
+ /**
+ * Creates a new migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for creating a migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MigrationResourceInner create(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceInner parameters) {
+ return createWithResponse(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Gets details of a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return details of a migration along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets details of a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return details of a migration along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName 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(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets details of a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return details of a migration on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ return getWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets details of a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return details of a migration along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ Context context) {
+ return getWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context)
+ .block();
+ }
+
+ /**
+ * Gets details of a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return details of a migration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MigrationResourceInner get(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ return getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Updates an existing migration. The request body can contain one to many of the mutable properties present in the
+ * migration definition. Certain property updates initiate migration state transitions.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for updating a migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceForPatch parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName 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(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates an existing migration. The request body can contain one to many of the mutable properties present in the
+ * migration definition. Certain property updates initiate migration state transitions.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for updating a migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceForPatch parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName 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(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Updates an existing migration. The request body can contain one to many of the mutable properties present in the
+ * migration definition. Certain property updates initiate migration state transitions.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for updating a migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono updateAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceForPatch parameters) {
+ return updateWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Updates an existing migration. The request body can contain one to many of the mutable properties present in the
+ * migration definition. Certain property updates initiate migration state transitions.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for updating a migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceForPatch parameters,
+ Context context) {
+ return updateWithResponseAsync(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, context)
+ .block();
+ }
+
+ /**
+ * Updates an existing migration. The request body can contain one to many of the mutable properties present in the
+ * migration definition. Certain property updates initiate migration state transitions.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param parameters The required parameters for updating a migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MigrationResourceInner update(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ MigrationResourceForPatch parameters) {
+ return updateWithResponse(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Deletes a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ if (migrationName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter migrationName 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(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationName,
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ return deleteWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ Context context) {
+ return deleteWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context)
+ .block();
+ }
+
+ /**
+ * Deletes a migration.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationName The name of the migration.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ deleteWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE);
+ }
+
+ /**
+ * List all the migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByTargetServerSinglePageAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByTargetServer(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationListFilter,
+ 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 migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByTargetServerSinglePageAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (subscriptionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (targetDbServerName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByTargetServer(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ subscriptionId,
+ resourceGroupName,
+ targetDbServerName,
+ migrationListFilter,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List all the migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByTargetServerAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter) {
+ return new PagedFlux<>(
+ () ->
+ listByTargetServerSinglePageAsync(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter),
+ nextLink -> listByTargetServerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByTargetServerAsync(
+ String subscriptionId, String resourceGroupName, String targetDbServerName) {
+ final MigrationListFilter migrationListFilter = null;
+ return new PagedFlux<>(
+ () ->
+ listByTargetServerSinglePageAsync(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter),
+ nextLink -> listByTargetServerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByTargetServerAsync(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter,
+ Context context) {
+ return new PagedFlux<>(
+ () ->
+ listByTargetServerSinglePageAsync(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter, context),
+ nextLink -> listByTargetServerNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByTargetServer(
+ String subscriptionId, String resourceGroupName, String targetDbServerName) {
+ final MigrationListFilter migrationListFilter = null;
+ return new PagedIterable<>(
+ listByTargetServerAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter));
+ }
+
+ /**
+ * List all the migrations on a given target server.
+ *
+ * @param subscriptionId The subscription ID of the target database server.
+ * @param resourceGroupName The resource group name of the target database server.
+ * @param targetDbServerName The name of the target database server.
+ * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 migration resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByTargetServer(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter,
+ Context context) {
+ return new PagedIterable<>(
+ listByTargetServerAsync(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByTargetServerNextSinglePageAsync(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.listByTargetServerNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByTargetServerNextSinglePageAsync(
+ 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
+ .listByTargetServerNext(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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java
new file mode 100644
index 0000000000000..79b8bc8ee00b8
--- /dev/null
+++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java
@@ -0,0 +1,250 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.MigrationsClient;
+import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource;
+import com.azure.resourcemanager.postgresqlflexibleserver.models.Migrations;
+
+public final class MigrationsImpl implements Migrations {
+ private static final ClientLogger LOGGER = new ClientLogger(MigrationsImpl.class);
+
+ private final MigrationsClient innerClient;
+
+ private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager;
+
+ public MigrationsImpl(
+ MigrationsClient innerClient,
+ com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ Context context) {
+ Response inner =
+ this
+ .serviceClient()
+ .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new MigrationResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MigrationResource get(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ MigrationResourceInner inner =
+ this.serviceClient().get(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
+ if (inner != null) {
+ return new MigrationResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ String migrationName,
+ Context context) {
+ return this
+ .serviceClient()
+ .deleteWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context);
+ }
+
+ public void delete(
+ String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) {
+ this.serviceClient().delete(subscriptionId, resourceGroupName, targetDbServerName, migrationName);
+ }
+
+ public PagedIterable listByTargetServer(
+ String subscriptionId, String resourceGroupName, String targetDbServerName) {
+ PagedIterable inner =
+ this.serviceClient().listByTargetServer(subscriptionId, resourceGroupName, targetDbServerName);
+ return Utils.mapPage(inner, inner1 -> new MigrationResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByTargetServer(
+ String subscriptionId,
+ String resourceGroupName,
+ String targetDbServerName,
+ MigrationListFilter migrationListFilter,
+ Context context) {
+ PagedIterable inner =
+ this
+ .serviceClient()
+ .listByTargetServer(
+ subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter, context);
+ return Utils.mapPage(inner, inner1 -> new MigrationResourceImpl(inner1, this.manager()));
+ }
+
+ public MigrationResource getById(String id) {
+ String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions");
+ if (subscriptionId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 targetDbServerName = Utils.getValueFromIdByName(id, "flexibleServers");
+ if (targetDbServerName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id)));
+ }
+ String migrationName = Utils.getValueFromIdByName(id, "migrations");
+ if (migrationName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'migrations'.", id)));
+ }
+ return this
+ .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE)
+ .getValue();
+ }
+
+ public Response