diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 738d6a47c0df3..7c164b1307755 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -383,7 +383,7 @@ com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.7;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purview;1.0.0-beta.3;1.0.0-beta.4 -com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.6;1.0.0-beta.7 +com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.6;1.0.0 com.azure.resourcemanager:azure-resourcemanager-baremetalinfrastructure;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-quota;1.0.0;1.1.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.3;1.0.0-beta.4 diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md index c6ee3987396b2..9bb1a88a3cabe 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History -## 1.0.0-beta.7 (Unreleased) +## 1.0.0 (2024-12-20) -### Features Added - -### Breaking Changes - -### Bugs Fixed +- Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Other Changes +Release for the azure-resourcemanager-mysqlflexibleserver Java SDK. + ## 1.0.0-beta.6 (2024-12-04) - Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-30. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md index cca9d4a3ab85c..f1443068026f2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md @@ -2,7 +2,7 @@ Azure Resource Manager MySql client library for Java. -This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-30. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-mysqlflexibleserver - 1.0.0-beta.6 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md index 7396434a28c0e..560c855ac0718 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md @@ -1,30 +1,10 @@ # Code snippets and samples -## AdvancedThreatProtectionSettings - -- [Get](#advancedthreatprotectionsettings_get) -- [List](#advancedthreatprotectionsettings_list) -- [Update](#advancedthreatprotectionsettings_update) -- [UpdatePut](#advancedthreatprotectionsettings_updateput) - -## AzureADAdministrators - -- [CreateOrUpdate](#azureadadministrators_createorupdate) -- [Delete](#azureadadministrators_delete) -- [Get](#azureadadministrators_get) -- [ListByServer](#azureadadministrators_listbyserver) - -## BackupAndExport - -- [Create](#backupandexport_create) -- [ValidateBackup](#backupandexport_validatebackup) - ## Backups - [Get](#backups_get) - [ListByServer](#backups_listbyserver) -- [Put](#backups_put) ## CheckNameAvailability @@ -41,7 +21,6 @@ ## Configurations - [BatchUpdate](#configurations_batchupdate) -- [CreateOrUpdate](#configurations_createorupdate) - [Get](#configurations_get) - [ListByServer](#configurations_listbyserver) - [Update](#configurations_update) @@ -68,38 +47,6 @@ - [List](#locationbasedcapabilities_list) -## LocationBasedCapabilitySet - -- [Get](#locationbasedcapabilityset_get) -- [List](#locationbasedcapabilityset_list) - -## LogFiles - -- [ListByServer](#logfiles_listbyserver) - -## LongRunningBackup - -- [Create](#longrunningbackup_create) - -## LongRunningBackupsOperation - -- [Get](#longrunningbackupsoperation_get) -- [List](#longrunningbackupsoperation_list) - -## Maintenances - -- [List](#maintenances_list) -- [Read](#maintenances_read) -- [Update](#maintenances_update) - -## OperationProgress - -- [Get](#operationprogress_get) - -## OperationResults - -- [Get](#operationresults_get) - ## Operations - [List](#operations_list) @@ -116,337 +63,10 @@ - [GetByResourceGroup](#servers_getbyresourcegroup) - [List](#servers_list) - [ListByResourceGroup](#servers_listbyresourcegroup) -- [ResetGtid](#servers_resetgtid) - [Restart](#servers_restart) - [Start](#servers_start) - [Stop](#servers_stop) - [Update](#servers_update) -- [ValidateEstimateHighAvailability](#servers_validateestimatehighavailability) - -## ServersMigration - -- [CutoverMigration](#serversmigration_cutovermigration) -### AdvancedThreatProtectionSettings_Get - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; - -/** - * Samples for AdvancedThreatProtectionSettings Get. - */ -public final class AdvancedThreatProtectionSettingsGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsGet.json - */ - /** - * Sample code: Get a server's Advanced Threat Protection settings. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .getWithResponse("threatprotection-6852", "threatprotection-2080", AdvancedThreatProtectionName.DEFAULT, - com.azure.core.util.Context.NONE); - } -} -``` - -### AdvancedThreatProtectionSettings_List - -```java -/** - * Samples for AdvancedThreatProtectionSettings List. - */ -public final class AdvancedThreatProtectionSettingsListSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsList.json - */ - /** - * Sample code: Get list of server's Advanced Threat Protection settings. - * - * @param manager Entry point to MySqlManager. - */ - public static void getListOfServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .list("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); - } -} -``` - -### AdvancedThreatProtectionSettings_Update - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; - -/** - * Samples for AdvancedThreatProtectionSettings Update. - */ -public final class AdvancedThreatProtectionSettingsUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPatchDisabled.json - */ - /** - * Sample code: Disable a server's Advanced Threat Protection settings with all parameters. - * - * @param manager Entry point to MySqlManager. - */ - public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParameters( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPatchEnabled.json - */ - /** - * Sample code: Enable a server's Advanced Threat Protection settings. - * - * @param manager Entry point to MySqlManager. - */ - public static void enableAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), - com.azure.core.util.Context.NONE); - } -} -``` - -### AdvancedThreatProtectionSettings_UpdatePut - -```java -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; - -/** - * Samples for AdvancedThreatProtectionSettings UpdatePut. - */ -public final class AdvancedThreatProtectionSettingsUpdatePutSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPutDisabled.json - */ - /** - * Sample code: Disable a server's Advanced Threat Protection settings with all parameters using PUT. - * - * @param manager Entry point to MySqlManager. - */ - public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParametersUsingPUT( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPutEnabled.json - */ - /** - * Sample code: Enable a server's Advanced Threat Protection settings using PUT. - * - * @param manager Entry point to MySqlManager. - */ - public static void enableAServerSAdvancedThreatProtectionSettingsUsingPUT( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.ENABLED), - com.azure.core.util.Context.NONE); - } -} -``` - -### AzureADAdministrators_CreateOrUpdate - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; - -/** - * Samples for AzureADAdministrators CreateOrUpdate. - */ -public final class AzureADAdministratorsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorCreate.json - */ - /** - * Sample code: Create an azure ad administrator. - * - * @param manager Entry point to MySqlManager. - */ - public static void - createAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators() - .define(AdministratorName.ACTIVE_DIRECTORY) - .withExistingFlexibleServer("testrg", "mysqltestsvc4") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("bob@contoso.com") - .withSid("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c") - .withTenantId("c12b7025-bfe2-46c1-b463-993b5e4cd467") - .withIdentityResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi") - .create(); - } -} -``` - -### AzureADAdministrators_Delete - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** - * Samples for AzureADAdministrators Delete. - */ -public final class AzureADAdministratorsDeleteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorDelete.json - */ - /** - * Sample code: Delete an azure ad administrator. - * - * @param manager Entry point to MySqlManager. - */ - public static void - deleteAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators() - .delete("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE); - } -} -``` - -### AzureADAdministrators_Get - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** - * Samples for AzureADAdministrators Get. - */ -public final class AzureADAdministratorsGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorGet.json - */ - /** - * Sample code: Get an azure ad administrator. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators() - .getWithResponse("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, - com.azure.core.util.Context.NONE); - } -} -``` - -### AzureADAdministrators_ListByServer - -```java -/** - * Samples for AzureADAdministrators ListByServer. - */ -public final class AzureADAdministratorsListByServerSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorsListByServer.json - */ - /** - * Sample code: List Azure AD administrators in a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void - listAzureADAdministratorsInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators().listByServer("testrg", "mysqltestsvc4", com.azure.core.util.Context.NONE); - } -} -``` - -### BackupAndExport_Create - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; -import java.util.Arrays; - -/** - * Samples for BackupAndExport Create. - */ -public final class BackupAndExportCreateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * BackupAndExport.json - */ - /** - * Sample code: Create and Export Backup. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAndExportBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backupAndExports() - .create("TestGroup", "mysqltestserver", new BackupAndExportRequest() - .withBackupSettings(new BackupSettings().withBackupName("customer-backup-name")) - .withTargetDetails(new FullBackupStoreDetails().withSasUriList(Arrays.asList("sasuri1", "sasuri2"))), - com.azure.core.util.Context.NONE); - } -} -``` - -### BackupAndExport_ValidateBackup - -```java -/** - * Samples for BackupAndExport ValidateBackup. - */ -public final class BackupAndExportValidateBackupSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * ValidateBackup.json - */ - /** - * Sample code: Validate Backup. - * - * @param manager Entry point to MySqlManager. - */ - public static void validateBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backupAndExports() - .validateBackupWithResponse("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - ### Backups_Get ```java @@ -456,8 +76,7 @@ public final class BackupAndExportValidateBackupSamples { public final class BackupsGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupGet. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. @@ -480,8 +99,8 @@ public final class BackupsGetSamples { public final class BackupsListByServerSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * BackupsListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupsListByServer. + * json */ /** * Sample code: List backups for a server. @@ -494,29 +113,6 @@ public final class BackupsListByServerSamples { } ``` -### Backups_Put - -```java -/** - * Samples for Backups Put. - */ -public final class BackupsPutSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupPut. - * json - */ - /** - * Sample code: Create backup for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void createBackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backups().putWithResponse("TestGroup", "mysqltestserver", "mybackup", com.azure.core.util.Context.NONE); - } -} -``` - ### CheckNameAvailability_Execute ```java @@ -528,8 +124,8 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequ public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CheckNameAvailability.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability + * .json */ /** * Sample code: Check name availability. @@ -538,731 +134,405 @@ public final class CheckNameAvailabilityExecuteSamples { */ public static void checkNameAvailability(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager.checkNameAvailabilities() - .executeWithResponse("SouthEastAsia", - new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CheckNameAvailabilityWithoutLocation_Execute - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** - * Samples for CheckNameAvailabilityWithoutLocation Execute. - */ -public final class CheckNameAvailabilityWithoutLocationExecuteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CheckNameAvailability.json - */ - /** - * Sample code: Check name availability. - * - * @param manager Entry point to MySqlManager. - */ - public static void checkNameAvailability(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.checkNameAvailabilityWithoutLocations() - .executeWithResponse( - new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CheckVirtualNetworkSubnetUsage_Execute - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; - -/** - * Samples for CheckVirtualNetworkSubnetUsage Execute. - */ -public final class CheckVirtualNetworkSubnetUsageExecuteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CheckVirtualNetworkSubnetUsage.json - */ - /** - * Sample code: CheckVirtualNetworkSubnetUsage. - * - * @param manager Entry point to MySqlManager. - */ - public static void - checkVirtualNetworkSubnetUsage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.checkVirtualNetworkSubnetUsages() - .executeWithResponse("WestUS", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), - com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_BatchUpdate - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.util.Arrays; - -/** - * Samples for Configurations BatchUpdate. - */ -public final class ConfigurationsBatchUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationsBatchUpdate.json - */ - /** - * Sample code: ConfigurationList. - * - * @param manager Entry point to MySqlManager. - */ - public static void configurationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .batchUpdate("testrg", "mysqltestserver", new ConfigurationListForBatchUpdate() - .withValue(Arrays.asList(new ConfigurationForBatchUpdate().withName("event_scheduler").withValue("OFF"), - new ConfigurationForBatchUpdate().withName("div_precision_increment").withValue("8"))) - .withResetAllToDefault(ResetAllToDefault.FALSE), com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_CreateOrUpdate - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; - -/** - * Samples for Configurations CreateOrUpdate. - */ -public final class ConfigurationsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationCreateOrUpdate.json - */ - /** - * Sample code: ConfigurationCreateOrUpdate. - * - * @param manager Entry point to MySqlManager. - */ - public static void configurationCreateOrUpdate(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .define("event_scheduler") - .withExistingFlexibleServer("TestGroup", "testserver") - .withValue("off") - .withSource(ConfigurationSource.USER_OVERRIDE) - .create(); - } -} -``` - -### Configurations_Get - -```java -/** - * Samples for Configurations Get. - */ -public final class ConfigurationsGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationGet.json - */ - /** - * Sample code: Get a configuration. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .getWithResponse("TestGroup", "testserver", "event_scheduler", com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_ListByServer - -```java -/** - * Samples for Configurations ListByServer. - */ -public final class ConfigurationsListByServerSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationsListByServer.json - */ - /** - * Sample code: List all configurations for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void - listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .listByServer("testrg", "mysqltestserver", null, null, 1, 8, com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_Update - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; - -/** - * Samples for Configurations Update. - */ -public final class ConfigurationsUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationUpdate.json - */ - /** - * Sample code: Update a user configuration. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateAUserConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - Configuration resource = manager.configurations() - .getWithResponse("testrg", "testserver", "event_scheduler", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withValue("on").withSource(ConfigurationSource.USER_OVERRIDE).apply(); - } -} -``` - -### Databases_CreateOrUpdate - -```java -/** - * Samples for Databases CreateOrUpdate. - */ -public final class DatabasesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabaseCreate.json - */ - /** - * Sample code: Create a database. - * - * @param manager Entry point to MySqlManager. - */ - public static void createADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases() - .define("db1") - .withExistingFlexibleServer("TestGroup", "testserver") - .withCharset("utf8") - .withCollation("utf8_general_ci") - .create(); - } -} -``` - -### Databases_Delete - -```java -/** - * Samples for Databases Delete. - */ -public final class DatabasesDeleteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabaseDelete.json - */ - /** - * Sample code: Delete a database. - * - * @param manager Entry point to MySqlManager. - */ - public static void deleteADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); - } -} -``` - -### Databases_Get - -```java -/** - * Samples for Databases Get. - */ -public final class DatabasesGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabaseGet.json - */ - /** - * Sample code: Get a database. - * - * @param manager Entry point to MySqlManager. - */ - public static void getADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); - } -} -``` - -### Databases_ListByServer - -```java -/** - * Samples for Databases ListByServer. - */ -public final class DatabasesListByServerSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabasesListByServer.json - */ - /** - * Sample code: List databases in a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void listDatabasesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} -``` - -### FirewallRules_CreateOrUpdate - -```java -/** - * Samples for FirewallRules CreateOrUpdate. - */ -public final class FirewallRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRuleCreate.json - */ - /** - * Sample code: Create a firewall rule. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules() - .define("rule1") - .withExistingFlexibleServer("TestGroup", "testserver") - .withStartIpAddress("0.0.0.0") - .withEndIpAddress("255.255.255.255") - .create(); - } -} -``` - -### FirewallRules_Delete - -```java -/** - * Samples for FirewallRules Delete. - */ -public final class FirewallRulesDeleteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRuleDelete.json - */ - /** - * Sample code: Delete a firewall rule. - * - * @param manager Entry point to MySqlManager. - */ - public static void deleteAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().delete("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); + .executeWithResponse("SouthEastAsia", + new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), + com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_Get +### CheckNameAvailabilityWithoutLocation_Execute ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; + /** - * Samples for FirewallRules Get. + * Samples for CheckNameAvailabilityWithoutLocation Execute. */ -public final class FirewallRulesGetSamples { +public final class CheckNameAvailabilityWithoutLocationExecuteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRuleGet.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability + * .json */ /** - * Sample code: Get a firewall rule. + * Sample code: Check name availability. * * @param manager Entry point to MySqlManager. */ - public static void getAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().getWithResponse("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); + public static void checkNameAvailability(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.checkNameAvailabilityWithoutLocations() + .executeWithResponse( + new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), + com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_ListByServer +### CheckVirtualNetworkSubnetUsage_Execute ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; + /** - * Samples for FirewallRules ListByServer. + * Samples for CheckVirtualNetworkSubnetUsage Execute. */ -public final class FirewallRulesListByServerSamples { +public final class CheckVirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRulesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * CheckVirtualNetworkSubnetUsage.json */ /** - * Sample code: List all firewall rules in a server. + * Sample code: CheckVirtualNetworkSubnetUsage. * * @param manager Entry point to MySqlManager. */ public static void - listAllFirewallRulesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); + checkVirtualNetworkSubnetUsage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.checkVirtualNetworkSubnetUsages() + .executeWithResponse("WestUS", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), + com.azure.core.util.Context.NONE); } } ``` -### GetPrivateDnsZoneSuffix_Execute +### Configurations_BatchUpdate ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; +import java.util.Arrays; + /** - * Samples for GetPrivateDnsZoneSuffix Execute. + * Samples for Configurations BatchUpdate. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { +public final class ConfigurationsBatchUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * ConfigurationsBatchUpdate.json */ /** - * Sample code: GetPrivateDnsZoneSuffix. + * Sample code: ConfigurationList. * * @param manager Entry point to MySqlManager. */ - public static void getPrivateDnsZoneSuffix(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + public static void configurationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .batchUpdate("testrg", "mysqltestserver", + new ConfigurationListForBatchUpdate().withValue( + Arrays.asList(new ConfigurationForBatchUpdate().withName("event_scheduler").withValue("OFF"), + new ConfigurationForBatchUpdate().withName("div_precision_increment").withValue("8"))), + com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilities_List +### Configurations_Get ```java /** - * Samples for LocationBasedCapabilities List. + * Samples for Configurations Get. */ -public final class LocationBasedCapabilitiesListSamples { +public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CapabilitiesByLocationList.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationGet.json */ /** - * Sample code: CapabilitiesList. + * Sample code: Get a configuration. * * @param manager Entry point to MySqlManager. */ - public static void capabilitiesList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilities().list("WestUS", com.azure.core.util.Context.NONE); + public static void getAConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .getWithResponse("TestGroup", "testserver", "event_scheduler", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilitySet_Get +### Configurations_ListByServer ```java /** - * Samples for LocationBasedCapabilitySet Get. + * Samples for Configurations ListByServer. */ -public final class LocationBasedCapabilitySetGetSamples { +public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CapabilitySetByLocation.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * ConfigurationsListByServer.json */ /** - * Sample code: CapabilityResult. + * Sample code: List all configurations for a server. * * @param manager Entry point to MySqlManager. */ - public static void capabilityResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilitySets().getWithResponse("WestUS", "default", com.azure.core.util.Context.NONE); + public static void + listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations().listByServer("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilitySet_List +### Configurations_Update ```java +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; + /** - * Samples for LocationBasedCapabilitySet List. + * Samples for Configurations Update. */ -public final class LocationBasedCapabilitySetListSamples { +public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CapabilitySetListByLocation.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationUpdate. + * json */ /** - * Sample code: CapabilitySetsResult. + * Sample code: Update a user configuration. * * @param manager Entry point to MySqlManager. */ - public static void capabilitySetsResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilitySets().list("WestUS", com.azure.core.util.Context.NONE); + public static void updateAUserConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .update("testrg", "testserver", "event_scheduler", + new ConfigurationInner().withValue("on").withSource(ConfigurationSource.USER_OVERRIDE), + com.azure.core.util.Context.NONE); } } ``` -### LogFiles_ListByServer +### Databases_CreateOrUpdate ```java /** - * Samples for LogFiles ListByServer. + * Samples for Databases CreateOrUpdate. */ -public final class LogFilesListByServerSamples { +public final class DatabasesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2023-06-01-preview/examples/ - * LogFilesListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseCreate.json */ /** - * Sample code: List all server log files for a server. + * Sample code: Create a database. * * @param manager Entry point to MySqlManager. */ - public static void - listAllServerLogFilesForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.logFiles().listByServer("testrg", "mysqltestsvc1", com.azure.core.util.Context.NONE); + public static void createADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases() + .define("db1") + .withExistingFlexibleServer("TestGroup", "testserver") + .withCharset("utf8") + .withCollation("utf8_general_ci") + .create(); } } ``` -### LongRunningBackup_Create +### Databases_Delete ```java /** - * Samples for LongRunningBackup Create. + * Samples for Databases Delete. */ -public final class LongRunningBackupCreateSamples { +public final class DatabasesDeleteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * LongRunningBackup.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseDelete.json */ /** - * Sample code: Create backup for a server. + * Sample code: Delete a database. * * @param manager Entry point to MySqlManager. */ - public static void createBackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.longRunningBackups() - .define("testback") - .withExistingFlexibleServer("TestGroup", "mysqltestserver") - .create(); + public static void deleteADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } ``` -### LongRunningBackupsOperation_Get +### Databases_Get ```java /** - * Samples for LongRunningBackupsOperation Get. + * Samples for Databases Get. */ -public final class LongRunningBackupsOperationGetSamples { +public final class DatabasesGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * LongRunningBackupGet.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseGet.json */ /** - * Sample code: Get a backup for a server. + * Sample code: Get a database. * * @param manager Entry point to MySqlManager. */ - public static void getABackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.longRunningBackupsOperations() - .getWithResponse("TestGroup", "mysqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); + public static void getADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } ``` -### LongRunningBackupsOperation_List +### Databases_ListByServer ```java /** - * Samples for LongRunningBackupsOperation List. + * Samples for Databases ListByServer. */ -public final class LongRunningBackupsOperationListSamples { +public final class DatabasesListByServerSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * LongRunningBackupsListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabasesListByServer + * .json */ /** - * Sample code: List backups for a server. + * Sample code: List databases in a server. * * @param manager Entry point to MySqlManager. */ - public static void listBackupsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.longRunningBackupsOperations().list("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); + public static void listDatabasesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } } ``` -### Maintenances_List +### FirewallRules_CreateOrUpdate ```java /** - * Samples for Maintenances List. + * Samples for FirewallRules CreateOrUpdate. */ -public final class MaintenancesListSamples { +public final class FirewallRulesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/ - * MaintenancesListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleCreate. + * json */ /** - * Sample code: List maintenances on a server. + * Sample code: Create a firewall rule. * * @param manager Entry point to MySqlManager. */ - public static void listMaintenancesOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.maintenances().list("TestGroup", "testserver", com.azure.core.util.Context.NONE); + public static void createAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules() + .define("rule1") + .withExistingFlexibleServer("TestGroup", "testserver") + .withStartIpAddress("0.0.0.0") + .withEndIpAddress("255.255.255.255") + .create(); } } ``` -### Maintenances_Read +### FirewallRules_Delete ```java /** - * Samples for Maintenances Read. + * Samples for FirewallRules Delete. */ -public final class MaintenancesReadSamples { +public final class FirewallRulesDeleteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceRead.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleDelete. + * json */ /** - * Sample code: Read a maintenance. + * Sample code: Delete a firewall rule. * * @param manager Entry point to MySqlManager. */ - public static void readAMaintenance(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.maintenances() - .readWithResponse("TestGroup", "testserver", "_T9Q-TS8", com.azure.core.util.Context.NONE); + public static void deleteAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules().delete("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); } } ``` -### Maintenances_Update +### FirewallRules_Get ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import java.time.OffsetDateTime; - /** - * Samples for Maintenances Update. + * Samples for FirewallRules Get. */ -public final class MaintenancesUpdateSamples { +public final class FirewallRulesGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceUpdate.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleGet.json */ /** - * Sample code: Update maintenance on a server. + * Sample code: Get a firewall rule. * * @param manager Entry point to MySqlManager. */ - public static void updateMaintenanceOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.maintenances() - .update("TestGroup", "testserver", "_T9Q-TS8", - new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2024-01-20T00:00:00")), - com.azure.core.util.Context.NONE); + public static void getAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules().getWithResponse("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); } } ``` -### OperationProgress_Get +### FirewallRules_ListByServer ```java /** - * Samples for OperationProgress Get. + * Samples for FirewallRules ListByServer. */ -public final class OperationProgressGetSamples { +public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationProgress_Get_BackupAndExport.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * FirewallRulesListByServer.json */ /** - * Sample code: OperationProgress_Get BackupAndExport. + * Sample code: List all firewall rules in a server. * * @param manager Entry point to MySqlManager. */ public static void - operationProgressGetBackupAndExport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operationProgress() - .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + listAllFirewallRulesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } +} +``` +### GetPrivateDnsZoneSuffix_Execute + +```java +/** + * Samples for GetPrivateDnsZoneSuffix Execute. + */ +public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationProgress_Get_ImportFromStorage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * GetPrivateDnsZoneSuffix.json */ /** - * Sample code: OperationProgress_Get ImportFromStorage. + * Sample code: GetPrivateDnsZoneSuffix. * * @param manager Entry point to MySqlManager. */ - public static void - operationProgressGetImportFromStorage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operationProgress() - .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + public static void getPrivateDnsZoneSuffix(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); } } ``` -### OperationResults_Get +### LocationBasedCapabilities_List ```java /** - * Samples for OperationResults Get. + * Samples for LocationBasedCapabilities List. */ -public final class OperationResultsGetSamples { +public final class LocationBasedCapabilitiesListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationResults_Get.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * CapabilitiesByLocationList.json */ /** - * Sample code: OperationResults_Get. + * Sample code: CapabilitiesList. * * @param manager Entry point to MySqlManager. */ - public static void operationResultsGet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operationResults() - .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + public static void capabilitiesList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilities().list("WestUS", com.azure.core.util.Context.NONE); } } ``` @@ -1276,8 +546,7 @@ public final class OperationResultsGetSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationsList.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/OperationsList.json */ /** * Sample code: OperationList. @@ -1299,8 +568,8 @@ public final class OperationsListSamples { public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ReplicasListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ReplicasListByServer. + * json */ /** * Sample code: List replicas for a server. @@ -1325,11 +594,11 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; +import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; @@ -1342,8 +611,8 @@ import java.util.Map; public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerCreateReplica.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateReplica. + * json */ /** * Sample code: Create a replica server. @@ -1363,8 +632,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate - * .json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -1377,16 +645,14 @@ public final class ServersCreateSamples { .withRegion("southeastasia") .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) - .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) .withAvailabilityZone("1") .withCreateMode(CreateMode.DEFAULT) .withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(EnableStatusEnum.DISABLED)) - .withBackup(new Backup().withBackupRetentionDays(7) - .withBackupIntervalHours(24) - .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); @@ -1394,8 +660,8 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerCreateWithBYOK.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateWithBYOK. + * json */ /** * Sample code: Create a server with byok. @@ -1409,12 +675,12 @@ public final class ServersCreateSamples { .withRegion("southeastasia") .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) - .withIdentity(new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withIdentity(new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities(mapOf( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity", SerializerFactory.createDefaultManagementSerializerAdapter() .deserialize("{}", Object.class, SerializerEncoding.JSON)))) - .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) @@ -1428,17 +694,14 @@ public final class ServersCreateSamples { .withGeoBackupKeyUri("fakeTokenPlaceholder") .withType(DataEncryptionType.AZURE_KEY_VAULT)) .withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(EnableStatusEnum.DISABLED)) - .withBackup(new Backup().withBackupRetentionDays(7) - .withBackupIntervalHours(24) - .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ * ServerCreateWithPointInTimeRestore.json */ /** @@ -1453,7 +716,7 @@ public final class ServersCreateSamples { .withRegion("SoutheastAsia") .withExistingResourceGroup("TargetResourceGroup") .withTags(mapOf("num", "1")) - .withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D14_v2").withTier(SkuTier.GENERAL_PURPOSE)) .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver") @@ -1484,8 +747,7 @@ public final class ServersCreateSamples { public final class ServersDeleteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerDelete - * .json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerDelete.json */ /** * Sample code: Delete a server. @@ -1507,8 +769,7 @@ public final class ServersDeleteSamples { public final class ServersFailoverSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerFailover.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerFailover.json */ /** * Sample code: Restart a server. @@ -1530,8 +791,8 @@ public final class ServersFailoverSamples { public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerGetWithVnet.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGetWithVnet. + * json */ /** * Sample code: Get a server with vnet. @@ -1544,8 +805,7 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerGet. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGet.json */ /** * Sample code: Get a server. @@ -1567,8 +827,7 @@ public final class ServersGetByResourceGroupSamples { public final class ServersListSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServersList. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServersList.json */ /** * Sample code: List servers in a subscription. @@ -1589,8 +848,7 @@ public final class ServersListSamples { */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ * ServersListByResourceGroup.json */ /** @@ -1604,34 +862,6 @@ public final class ServersListByResourceGroupSamples { } ``` -### Servers_ResetGtid - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; - -/** - * Samples for Servers ResetGtid. - */ -public final class ServersResetGtidSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerResetGtid.json - */ - /** - * Sample code: Reset GTID on a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void resetGTIDOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers() - .resetGtid("TestGroup", "testserver", - new ServerGtidSetParameter().withGtidSet("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), - com.azure.core.util.Context.NONE); - } -} -``` - ### Servers_Restart ```java @@ -1644,8 +874,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParamet public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerRestart.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerRestart.json */ /** * Sample code: Restart a server. @@ -1671,8 +900,7 @@ public final class ServersRestartSamples { public final class ServersStartSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerStart. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStart.json */ /** * Sample code: Start a server. @@ -1694,8 +922,7 @@ public final class ServersStartSamples { public final class ServersStopSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerStop. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStop.json */ /** * Sample code: Stop a server. @@ -1716,10 +943,9 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -1731,8 +957,7 @@ import java.util.Map; */ public final class ServersUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ * ServerUpdateWithCustomerMaintenanceWindow.json */ /** @@ -1755,8 +980,8 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerUpdateWithBYOK.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdateWithBYOK. + * json */ /** * Sample code: Update server with byok. @@ -1769,7 +994,7 @@ public final class ServersUpdateSamples { .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withIdentity(new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withIdentity(new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities(mapOf( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity", SerializerFactory.createDefaultManagementSerializerAdapter() @@ -1786,8 +1011,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerUpdate - * .json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdate.json */ /** * Sample code: Update a server. @@ -1799,11 +1023,7 @@ public final class ServersUpdateSamples { .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withStorage(new Storage().withStorageSizeGB(30) - .withIops(200) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withAutoIoScaling(EnableStatusEnum.DISABLED)) - .withNetwork(new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED)) + .withStorage(new Storage().withStorageSizeGB(30).withIops(200).withAutoGrow(EnableStatusEnum.DISABLED)) .apply(); } @@ -1821,56 +1041,3 @@ public final class ServersUpdateSamples { } ``` -### Servers_ValidateEstimateHighAvailability - -```java -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; - -/** - * Samples for Servers ValidateEstimateHighAvailability. - */ -public final class ServersValidateEstimateHighAvailabilitySamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerValidateEstimateHighAvailability.json - */ - /** - * Sample code: Validate a validation and estimation of high availability. - * - * @param manager Entry point to MySqlManager. - */ - public static void validateAValidationAndEstimationOfHighAvailability( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers() - .validateEstimateHighAvailabilityWithResponse("TestGroup", "testserver", - new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("1"), - com.azure.core.util.Context.NONE); - } -} -``` - -### ServersMigration_CutoverMigration - -```java -/** - * Samples for ServersMigration CutoverMigration. - */ -public final class ServersMigrationCutoverMigrationSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * CutoverMigration.json - */ - /** - * Sample code: Cutover migration for MySQL import. - * - * @param manager Entry point to MySqlManager. - */ - public static void - cutoverMigrationForMySQLImport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.serversMigrations().cutoverMigration("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml index bfcf35116b459..74d8eae397193 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-mysqlflexibleserver - 1.0.0-beta.7 + 1.0.0 jar Microsoft Azure SDK for MySql Management - This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-30. + This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - true false diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java index 2c2ac44f7381e..40b537b0aa42e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java @@ -24,9 +24,6 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.AdvancedThreatProtectionSettingsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsImpl; @@ -36,21 +33,10 @@ import com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitySetsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LogFilesImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupsOperationsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.MaintenancesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationProgressImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationResultsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersMigrationsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; import com.azure.resourcemanager.mysqlflexibleserver.models.Backups; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilities; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilityWithoutLocations; @@ -60,17 +46,9 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRules; import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixes; import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilities; -import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFiles; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackups; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackupsOperations; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenances; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgress; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; import com.azure.resourcemanager.mysqlflexibleserver.models.Operations; import com.azure.resourcemanager.mysqlflexibleserver.models.Replicas; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -84,35 +62,19 @@ * including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. */ public final class MySqlManager { - private AzureADAdministrators azureADAdministrators; - - private Backups backups; - - private BackupAndExports backupAndExports; - - private LongRunningBackups longRunningBackups; - - private LongRunningBackupsOperations longRunningBackupsOperations; - - private Configurations configurations; - - private Databases databases; - - private FirewallRules firewallRules; - private Servers servers; private Replicas replicas; - private ServersMigrations serversMigrations; + private Backups backups; - private AdvancedThreatProtectionSettings advancedThreatProtectionSettings; + private FirewallRules firewallRules; - private LogFiles logFiles; + private Databases databases; - private LocationBasedCapabilities locationBasedCapabilities; + private Configurations configurations; - private LocationBasedCapabilitySets locationBasedCapabilitySets; + private LocationBasedCapabilities locationBasedCapabilities; private CheckVirtualNetworkSubnetUsages checkVirtualNetworkSubnetUsages; @@ -120,16 +82,10 @@ public final class MySqlManager { private CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocations; - private OperationResults operationResults; - - private OperationProgress operationProgress; - private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; private Operations operations; - private Maintenances maintenances; - private final MySqlManagementClient clientObject; private MySqlManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -294,7 +250,7 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.mysqlflexibleserver") .append("/") - .append("1.0.0-beta.6"); + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -340,103 +296,6 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil } } - /** - * Gets the resource collection API of AzureADAdministrators. It manages AzureADAdministrator. - * - * @return Resource collection API of AzureADAdministrators. - */ - public AzureADAdministrators azureADAdministrators() { - if (this.azureADAdministrators == null) { - this.azureADAdministrators = new AzureADAdministratorsImpl(clientObject.getAzureADAdministrators(), this); - } - return azureADAdministrators; - } - - /** - * Gets the resource collection API of Backups. - * - * @return Resource collection API of Backups. - */ - public Backups backups() { - if (this.backups == null) { - this.backups = new BackupsImpl(clientObject.getBackups(), this); - } - return backups; - } - - /** - * Gets the resource collection API of BackupAndExports. - * - * @return Resource collection API of BackupAndExports. - */ - public BackupAndExports backupAndExports() { - if (this.backupAndExports == null) { - this.backupAndExports = new BackupAndExportsImpl(clientObject.getBackupAndExports(), this); - } - return backupAndExports; - } - - /** - * Gets the resource collection API of LongRunningBackups. It manages ServerBackupV2. - * - * @return Resource collection API of LongRunningBackups. - */ - public LongRunningBackups longRunningBackups() { - if (this.longRunningBackups == null) { - this.longRunningBackups = new LongRunningBackupsImpl(clientObject.getLongRunningBackups(), this); - } - return longRunningBackups; - } - - /** - * Gets the resource collection API of LongRunningBackupsOperations. - * - * @return Resource collection API of LongRunningBackupsOperations. - */ - public LongRunningBackupsOperations longRunningBackupsOperations() { - if (this.longRunningBackupsOperations == null) { - this.longRunningBackupsOperations - = new LongRunningBackupsOperationsImpl(clientObject.getLongRunningBackupsOperations(), this); - } - return longRunningBackupsOperations; - } - - /** - * Gets the resource collection API of Configurations. It manages Configuration. - * - * @return Resource collection API of Configurations. - */ - public Configurations configurations() { - if (this.configurations == null) { - this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); - } - return configurations; - } - - /** - * Gets the resource collection API of Databases. It manages Database. - * - * @return Resource collection API of Databases. - */ - public Databases databases() { - if (this.databases == null) { - this.databases = new DatabasesImpl(clientObject.getDatabases(), this); - } - return databases; - } - - /** - * Gets the resource collection API of FirewallRules. It manages FirewallRule. - * - * @return Resource collection API of FirewallRules. - */ - public FirewallRules firewallRules() { - if (this.firewallRules == null) { - this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); - } - return firewallRules; - } - /** * Gets the resource collection API of Servers. It manages Server. * @@ -462,40 +321,51 @@ public Replicas replicas() { } /** - * Gets the resource collection API of ServersMigrations. + * Gets the resource collection API of Backups. + * + * @return Resource collection API of Backups. + */ + public Backups backups() { + if (this.backups == null) { + this.backups = new BackupsImpl(clientObject.getBackups(), this); + } + return backups; + } + + /** + * Gets the resource collection API of FirewallRules. It manages FirewallRule. * - * @return Resource collection API of ServersMigrations. + * @return Resource collection API of FirewallRules. */ - public ServersMigrations serversMigrations() { - if (this.serversMigrations == null) { - this.serversMigrations = new ServersMigrationsImpl(clientObject.getServersMigrations(), this); + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); } - return serversMigrations; + return firewallRules; } /** - * Gets the resource collection API of AdvancedThreatProtectionSettings. + * Gets the resource collection API of Databases. It manages Database. * - * @return Resource collection API of AdvancedThreatProtectionSettings. + * @return Resource collection API of Databases. */ - public AdvancedThreatProtectionSettings advancedThreatProtectionSettings() { - if (this.advancedThreatProtectionSettings == null) { - this.advancedThreatProtectionSettings - = new AdvancedThreatProtectionSettingsImpl(clientObject.getAdvancedThreatProtectionSettings(), this); + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(clientObject.getDatabases(), this); } - return advancedThreatProtectionSettings; + return databases; } /** - * Gets the resource collection API of LogFiles. + * Gets the resource collection API of Configurations. * - * @return Resource collection API of LogFiles. + * @return Resource collection API of Configurations. */ - public LogFiles logFiles() { - if (this.logFiles == null) { - this.logFiles = new LogFilesImpl(clientObject.getLogFiles(), this); + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); } - return logFiles; + return configurations; } /** @@ -511,19 +381,6 @@ public LocationBasedCapabilities locationBasedCapabilities() { return locationBasedCapabilities; } - /** - * Gets the resource collection API of LocationBasedCapabilitySets. - * - * @return Resource collection API of LocationBasedCapabilitySets. - */ - public LocationBasedCapabilitySets locationBasedCapabilitySets() { - if (this.locationBasedCapabilitySets == null) { - this.locationBasedCapabilitySets - = new LocationBasedCapabilitySetsImpl(clientObject.getLocationBasedCapabilitySets(), this); - } - return locationBasedCapabilitySets; - } - /** * Gets the resource collection API of CheckVirtualNetworkSubnetUsages. * @@ -563,30 +420,6 @@ public CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocatio return checkNameAvailabilityWithoutLocations; } - /** - * Gets the resource collection API of OperationResults. - * - * @return Resource collection API of OperationResults. - */ - public OperationResults operationResults() { - if (this.operationResults == null) { - this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); - } - return operationResults; - } - - /** - * Gets the resource collection API of OperationProgress. - * - * @return Resource collection API of OperationProgress. - */ - public OperationProgress operationProgress() { - if (this.operationProgress == null) { - this.operationProgress = new OperationProgressImpl(clientObject.getOperationProgress(), this); - } - return operationProgress; - } - /** * Gets the resource collection API of GetPrivateDnsZoneSuffixes. * @@ -612,18 +445,6 @@ public Operations operations() { return operations; } - /** - * Gets the resource collection API of Maintenances. - * - * @return Resource collection API of Maintenances. - */ - public Maintenances maintenances() { - if (this.maintenances == null) { - this.maintenances = new MaintenancesImpl(clientObject.getMaintenances(), this); - } - return maintenances; - } - /** * Gets wrapped service client MySqlManagementClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java deleted file mode 100644 index 0dbca6c9e9d32..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java +++ /dev/null @@ -1,217 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; - -/** - * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionSettingsClient. - */ -public interface AdvancedThreatProtectionSettingsClient { - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context); - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server's Advanced Threat Protection state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters, Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters, Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java deleted file mode 100644 index bd7e462531892..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java +++ /dev/null @@ -1,203 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** - * An instance of this class provides access to all the operations defined in AzureADAdministratorsClient. - */ -public interface AzureADAdministratorsClient { - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters); - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters, Context context); - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters); - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @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 Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters, Context context); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, - AdministratorName administratorName); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, AdministratorName administratorName); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureADAdministratorInner get(String resourceGroupName, String serverName, AdministratorName administratorName); - - /** - * List all the AAD administrators 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 com.azure.core.management.exception.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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the AAD administrators 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 com.azure.core.management.exception.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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java deleted file mode 100644 index 8c76ad0a8b9df..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java +++ /dev/null @@ -1,109 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; - -/** - * An instance of this class provides access to all the operations defined in BackupAndExportsClient. - */ -public interface BackupAndExportsClient { - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 the {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 the {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters, - Context context); - - /** - * Validates if backup can be performed for 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 com.azure.core.management.exception.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 ValidateBackup API Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context); - - /** - * Validates if backup can be performed for 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 com.azure.core.management.exception.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 ValidateBackup API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java index 8c3c6ff1a943b..e6a21fde6914b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java @@ -15,36 +15,6 @@ * An instance of this class provides access to all the operations defined in BackupsClient. */ public interface BackupsClient { - /** - * Create backup for a given server with specified backup name. - * - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Create backup for a given server with specified backup name. - * - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupInner put(String resourceGroupName, String serverName, String backupName); - /** * List all the backups for a given server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java index 75dd91fda6c51..63b2c4ec50485 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java @@ -19,72 +19,6 @@ * An instance of this class provides access to all the operations defined in ConfigurationsClient. */ public interface ConfigurationsClient { - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters, Context context); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters, Context context); - /** * Updates a configuration of a server. * @@ -261,10 +195,6 @@ ConfigurationListResultInner batchUpdate(String resourceGroupName, String server * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -272,6 +202,5 @@ ConfigurationListResultInner batchUpdate(String resourceGroupName, String server * @return a list of server configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context); + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java deleted file mode 100644 index 9e246e65de56a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java +++ /dev/null @@ -1,71 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; - -/** - * An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. - */ -public interface LocationBasedCapabilitySetsClient { - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @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 at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @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 at specified location in a given subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String capabilitySetName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 at specified location in a given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityInner get(String locationName, String capabilitySetName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java deleted file mode 100644 index b80c24e9385c5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; - -/** - * An instance of this class provides access to all the operations defined in LogFilesClient. - */ -public interface LogFilesClient { - /** - * 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 com.azure.core.management.exception.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) - PagedIterable listByServer(String resourceGroupName, String 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 com.azure.core.management.exception.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) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java deleted file mode 100644 index 2a765bd13d1b8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java +++ /dev/null @@ -1,80 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; - -/** - * An instance of this class provides access to all the operations defined in LongRunningBackupsClient. - */ -public interface LongRunningBackupsClient { - /** - * Create backup for a given server with specified backup name. - * - * @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 com.azure.core.management.exception.ManagementException 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 server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName); - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 the {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters, Context context); - - /** - * Create backup for a given server with specified backup name. - * - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName); - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsOperationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsOperationsClient.java deleted file mode 100644 index 7fa0a1d41d109..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsOperationsClient.java +++ /dev/null @@ -1,74 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; - -/** - * An instance of this class provides access to all the operations defined in LongRunningBackupsOperationsClient. - */ -public interface LongRunningBackupsOperationsClient { - /** - * Get backup for a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Get backup for a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupV2Inner get(String resourceGroupName, String serverName, String backupName); - - /** - * List all the backups for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List all the backups for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java deleted file mode 100644 index 5dd065380a19e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java +++ /dev/null @@ -1,140 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; - -/** - * An instance of this class provides access to all the operations defined in MaintenancesClient. - */ -public interface MaintenancesClient { - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @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 maintenance along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, - Context context); - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceInner read(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, String serverName, - String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, String serverName, - String maintenanceName, MaintenanceUpdate parameters, Context context); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context); - - /** - * List maintenances. - * - * @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 a list of maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List maintenances. - * - * @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 a list of maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java index 3de900b9fa497..727614c731261 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java @@ -12,7 +12,7 @@ */ public interface MySqlManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -25,6 +25,13 @@ public interface MySqlManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -39,62 +46,6 @@ public interface MySqlManagementClient { */ Duration getDefaultPollInterval(); - /** - * Gets the AzureADAdministratorsClient object to access its operations. - * - * @return the AzureADAdministratorsClient object. - */ - AzureADAdministratorsClient getAzureADAdministrators(); - - /** - * Gets the BackupsClient object to access its operations. - * - * @return the BackupsClient object. - */ - BackupsClient getBackups(); - - /** - * Gets the BackupAndExportsClient object to access its operations. - * - * @return the BackupAndExportsClient object. - */ - BackupAndExportsClient getBackupAndExports(); - - /** - * Gets the LongRunningBackupsClient object to access its operations. - * - * @return the LongRunningBackupsClient object. - */ - LongRunningBackupsClient getLongRunningBackups(); - - /** - * Gets the LongRunningBackupsOperationsClient object to access its operations. - * - * @return the LongRunningBackupsOperationsClient object. - */ - LongRunningBackupsOperationsClient getLongRunningBackupsOperations(); - - /** - * Gets the ConfigurationsClient object to access its operations. - * - * @return the ConfigurationsClient object. - */ - ConfigurationsClient getConfigurations(); - - /** - * Gets the DatabasesClient object to access its operations. - * - * @return the DatabasesClient object. - */ - DatabasesClient getDatabases(); - - /** - * Gets the FirewallRulesClient object to access its operations. - * - * @return the FirewallRulesClient object. - */ - FirewallRulesClient getFirewallRules(); - /** * Gets the ServersClient object to access its operations. * @@ -110,39 +61,39 @@ public interface MySqlManagementClient { ReplicasClient getReplicas(); /** - * Gets the ServersMigrationsClient object to access its operations. + * Gets the BackupsClient object to access its operations. * - * @return the ServersMigrationsClient object. + * @return the BackupsClient object. */ - ServersMigrationsClient getServersMigrations(); + BackupsClient getBackups(); /** - * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * Gets the FirewallRulesClient object to access its operations. * - * @return the AdvancedThreatProtectionSettingsClient object. + * @return the FirewallRulesClient object. */ - AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings(); + FirewallRulesClient getFirewallRules(); /** - * Gets the LogFilesClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the LogFilesClient object. + * @return the DatabasesClient object. */ - LogFilesClient getLogFiles(); + DatabasesClient getDatabases(); /** - * Gets the LocationBasedCapabilitiesClient object to access its operations. + * Gets the ConfigurationsClient object to access its operations. * - * @return the LocationBasedCapabilitiesClient object. + * @return the ConfigurationsClient object. */ - LocationBasedCapabilitiesClient getLocationBasedCapabilities(); + ConfigurationsClient getConfigurations(); /** - * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * Gets the LocationBasedCapabilitiesClient object to access its operations. * - * @return the LocationBasedCapabilitySetsClient object. + * @return the LocationBasedCapabilitiesClient object. */ - LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets(); + LocationBasedCapabilitiesClient getLocationBasedCapabilities(); /** * Gets the CheckVirtualNetworkSubnetUsagesClient object to access its operations. @@ -165,20 +116,6 @@ public interface MySqlManagementClient { */ CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWithoutLocations(); - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - OperationResultsClient getOperationResults(); - - /** - * Gets the OperationProgressClient object to access its operations. - * - * @return the OperationProgressClient object. - */ - OperationProgressClient getOperationProgress(); - /** * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. * @@ -192,11 +129,4 @@ public interface MySqlManagementClient { * @return the OperationsClient object. */ OperationsClient getOperations(); - - /** - * Gets the MaintenancesClient object to access its operations. - * - * @return the MaintenancesClient object. - */ - MaintenancesClient getMaintenances(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java deleted file mode 100644 index 4145eff4908c9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.OperationProgressResultInner; - -/** - * An instance of this class provides access to all the operations defined in OperationProgressClient. - */ -public interface OperationProgressClient { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String operationId, Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationProgressResultInner get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java deleted file mode 100644 index 8647fc063175c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; - -/** - * An instance of this class provides access to all the operations defined in OperationResultsClient. - */ -public interface OperationResultsClient { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String operationId, - Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusExtendedResultInner get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java index 12b95a2b0e190..ba7ffac6c34bc 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java @@ -11,10 +11,8 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; /** @@ -323,38 +321,6 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) void failover(String resourceGroupName, String serverName, Context context); - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @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 high availability validation properties of a server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context); - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HighAvailabilityValidationEstimationInner validateEstimateHighAvailability(String resourceGroupName, - String serverName, HighAvailabilityValidationEstimationInner parameters); - /** * Restarts a server. * @@ -516,62 +482,4 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void stop(String resourceGroupName, String serverName, Context context); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java deleted file mode 100644 index aa80c129bb97a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java +++ /dev/null @@ -1,72 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; - -/** - * An instance of this class provides access to all the operations defined in ServersMigrationsClient. - */ -public interface ServersMigrationsClient { - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 the {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 the {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName, - Context context); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner cutoverMigration(String resourceGroupName, String serverName); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java deleted file mode 100644 index 473688c6ec8e6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java +++ /dev/null @@ -1,208 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import java.io.IOException; - -/** - * The properties of an administrator. - */ -@Fluent -public final class AdministratorProperties implements JsonSerializable { - /* - * Type of the sever administrator. - */ - private AdministratorType administratorType; - - /* - * Login name of the server administrator. - */ - private String login; - - /* - * SID (object ID) of the server administrator. - */ - private String sid; - - /* - * Tenant ID of the administrator. - */ - private String tenantId; - - /* - * The resource id of the identity used for AAD Authentication. - */ - private String identityResourceId; - - /** - * Creates an instance of AdministratorProperties class. - */ - public AdministratorProperties() { - } - - /** - * Get the administratorType property: Type of the sever administrator. - * - * @return the administratorType value. - */ - public AdministratorType administratorType() { - return this.administratorType; - } - - /** - * Set the administratorType property: Type of the sever administrator. - * - * @param administratorType the administratorType value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withAdministratorType(AdministratorType administratorType) { - this.administratorType = administratorType; - return this; - } - - /** - * Get the login property: Login name of the server administrator. - * - * @return the login value. - */ - public String login() { - return this.login; - } - - /** - * Set the login property: Login name of the server administrator. - * - * @param login the login value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withLogin(String login) { - this.login = login; - return this; - } - - /** - * Get the sid property: SID (object ID) of the server administrator. - * - * @return the sid value. - */ - public String sid() { - return this.sid; - } - - /** - * Set the sid property: SID (object ID) of the server administrator. - * - * @param sid the sid value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withSid(String sid) { - this.sid = sid; - return this; - } - - /** - * Get the tenantId property: Tenant ID of the administrator. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: Tenant ID of the administrator. - * - * @param tenantId the tenantId value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @return the identityResourceId value. - */ - public String identityResourceId() { - return this.identityResourceId; - } - - /** - * Set the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @param identityResourceId the identityResourceId value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withIdentityResourceId(String identityResourceId) { - this.identityResourceId = identityResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("administratorType", - this.administratorType == null ? null : this.administratorType.toString()); - jsonWriter.writeStringField("login", this.login); - jsonWriter.writeStringField("sid", this.sid); - jsonWriter.writeStringField("tenantId", this.tenantId); - jsonWriter.writeStringField("identityResourceId", this.identityResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdministratorProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdministratorProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdministratorProperties. - */ - public static AdministratorProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdministratorProperties deserializedAdministratorProperties = new AdministratorProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("administratorType".equals(fieldName)) { - deserializedAdministratorProperties.administratorType - = AdministratorType.fromString(reader.getString()); - } else if ("login".equals(fieldName)) { - deserializedAdministratorProperties.login = reader.getString(); - } else if ("sid".equals(fieldName)) { - deserializedAdministratorProperties.sid = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedAdministratorProperties.tenantId = reader.getString(); - } else if ("identityResourceId".equals(fieldName)) { - deserializedAdministratorProperties.identityResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAdministratorProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java deleted file mode 100644 index 8b65a85bbe836..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java +++ /dev/null @@ -1,202 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * A server's Advanced Threat Protection. - */ -@Fluent -public final class AdvancedThreatProtectionInner extends ProxyResource { - /* - * Resource properties. - */ - private AdvancedThreatProtectionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AdvancedThreatProtectionInner class. - */ - public AdvancedThreatProtectionInner() { - } - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private AdvancedThreatProtectionProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the creationTime property: Specifies the UTC creation time of the policy. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.innerProperties() == null ? null : this.innerProperties().creationTime(); - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionInner object itself. - */ - public AdvancedThreatProtectionInner withState(AdvancedThreatProtectionState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AdvancedThreatProtectionProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Threat Protection. - * - * @return the provisioningState value. - */ - public AdvancedThreatProtectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionInner. - */ - public static AdvancedThreatProtectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionInner deserializedAdvancedThreatProtectionInner - = new AdvancedThreatProtectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.innerProperties - = AdvancedThreatProtectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java deleted file mode 100644 index 7a3c58b6cef53..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java +++ /dev/null @@ -1,136 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Properties of an Advanced Threat Protection setting. - */ -@Fluent -public final class AdvancedThreatProtectionProperties implements JsonSerializable { - /* - * Specifies the UTC creation time of the policy. - */ - private OffsetDateTime creationTime; - - /* - * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been - * applied yet on the specific database or server. - */ - private AdvancedThreatProtectionState state; - - /* - * Provisioning state of the Threat Protection. - */ - private AdvancedThreatProtectionProvisioningState provisioningState; - - /** - * Creates an instance of AdvancedThreatProtectionProperties class. - */ - public AdvancedThreatProtectionProperties() { - } - - /** - * Get the creationTime property: Specifies the UTC creation time of the policy. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.state; - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionProperties object itself. - */ - public AdvancedThreatProtectionProperties withState(AdvancedThreatProtectionState state) { - this.state = state; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Threat Protection. - * - * @return the provisioningState value. - */ - public AdvancedThreatProtectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionProperties. - */ - public static AdvancedThreatProtectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionProperties deserializedAdvancedThreatProtectionProperties - = new AdvancedThreatProtectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("creationTime".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.creationTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("state".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.state - = AdvancedThreatProtectionState.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.provisioningState - = AdvancedThreatProtectionProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java deleted file mode 100644 index 463d9d5a5f077..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java +++ /dev/null @@ -1,109 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.io.IOException; - -/** - * Properties of Advanced Threat Protection that can be updated. - */ -@Fluent -public final class AdvancedThreatProtectionUpdateProperties - implements JsonSerializable { - /* - * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been - * applied yet on the specific database or server. - */ - private AdvancedThreatProtectionState state; - - /** - * Creates an instance of AdvancedThreatProtectionUpdateProperties class. - */ - public AdvancedThreatProtectionUpdateProperties() { - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.state; - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionUpdateProperties object itself. - */ - public AdvancedThreatProtectionUpdateProperties withState(AdvancedThreatProtectionState state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (state() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property state in model AdvancedThreatProtectionUpdateProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionUpdateProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionUpdateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionUpdateProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionUpdateProperties. - */ - public static AdvancedThreatProtectionUpdateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionUpdateProperties deserializedAdvancedThreatProtectionUpdateProperties - = new AdvancedThreatProtectionUpdateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedAdvancedThreatProtectionUpdateProperties.state - = AdvancedThreatProtectionState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionUpdateProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java deleted file mode 100644 index ac756148dfc0e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java +++ /dev/null @@ -1,270 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import java.io.IOException; - -/** - * Represents a Administrator. - */ -@Fluent -public final class AzureADAdministratorInner extends ProxyResource { - /* - * The properties of an administrator. - */ - private AdministratorProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AzureADAdministratorInner class. - */ - public AzureADAdministratorInner() { - } - - /** - * Get the innerProperties property: The properties of an administrator. - * - * @return the innerProperties value. - */ - private AdministratorProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the administratorType property: Type of the sever administrator. - * - * @return the administratorType value. - */ - public AdministratorType administratorType() { - return this.innerProperties() == null ? null : this.innerProperties().administratorType(); - } - - /** - * Set the administratorType property: Type of the sever administrator. - * - * @param administratorType the administratorType value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withAdministratorType(AdministratorType administratorType) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withAdministratorType(administratorType); - return this; - } - - /** - * Get the login property: Login name of the server administrator. - * - * @return the login value. - */ - public String login() { - return this.innerProperties() == null ? null : this.innerProperties().login(); - } - - /** - * Set the login property: Login name of the server administrator. - * - * @param login the login value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withLogin(String login) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withLogin(login); - return this; - } - - /** - * Get the sid property: SID (object ID) of the server administrator. - * - * @return the sid value. - */ - public String sid() { - return this.innerProperties() == null ? null : this.innerProperties().sid(); - } - - /** - * Set the sid property: SID (object ID) of the server administrator. - * - * @param sid the sid value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withSid(String sid) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withSid(sid); - return this; - } - - /** - * Get the tenantId property: Tenant ID of the administrator. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); - } - - /** - * Set the tenantId property: Tenant ID of the administrator. - * - * @param tenantId the tenantId value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withTenantId(String tenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withTenantId(tenantId); - return this; - } - - /** - * Get the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @return the identityResourceId value. - */ - public String identityResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().identityResourceId(); - } - - /** - * Set the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @param identityResourceId the identityResourceId value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withIdentityResourceId(String identityResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withIdentityResourceId(identityResourceId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureADAdministratorInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureADAdministratorInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AzureADAdministratorInner. - */ - public static AzureADAdministratorInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureADAdministratorInner deserializedAzureADAdministratorInner = new AzureADAdministratorInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureADAdministratorInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureADAdministratorInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureADAdministratorInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAzureADAdministratorInner.innerProperties = AdministratorProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAzureADAdministratorInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureADAdministratorInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java deleted file mode 100644 index 2ce1d491e88e7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java +++ /dev/null @@ -1,376 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Represents BackupAndExport API Response. - */ -@Fluent -public final class BackupAndExportResponseInner extends ProxyResource { - /* - * The operation status - */ - private OperationStatus status; - - /* - * Start time - */ - private OffsetDateTime startTime; - - /* - * End time - */ - private OffsetDateTime endTime; - - /* - * Operation progress (0-100). - */ - private Double percentComplete; - - /* - * The response properties of a backup and export operation. - */ - private BackupAndExportResponseProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The error object. - */ - private ManagementError error; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupAndExportResponseInner class. - */ - public BackupAndExportResponseInner() { - } - - /** - * Get the status property: The operation status. - * - * @return the status value. - */ - public OperationStatus status() { - return this.status; - } - - /** - * Set the status property: The operation status. - * - * @param status the status value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withStatus(OperationStatus status) { - this.status = status; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the percentComplete property: Operation progress (0-100). - * - * @return the percentComplete value. - */ - public Double percentComplete() { - return this.percentComplete; - } - - /** - * Set the percentComplete property: Operation progress (0-100). - * - * @param percentComplete the percentComplete value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withPercentComplete(Double percentComplete) { - this.percentComplete = percentComplete; - return this; - } - - /** - * Get the innerProperties property: The response properties of a backup and export operation. - * - * @return the innerProperties value. - */ - private BackupAndExportResponseProperties 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 error property: The error object. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: The error object. - * - * @param error the error value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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 BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupAndExportResponseProperties(); - } - 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 BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withDataTransferredInBytes(Long dataTransferredInBytes) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupAndExportResponseProperties(); - } - this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes); - return this; - } - - /** - * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - public String backupMetadata() { - return this.innerProperties() == null ? null : this.innerProperties().backupMetadata(); - } - - /** - * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @param backupMetadata the backupMetadata value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withBackupMetadata(String backupMetadata) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupAndExportResponseProperties(); - } - this.innerProperties().withBackupMetadata(backupMetadata); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeNumberField("percentComplete", this.percentComplete); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportResponseInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupAndExportResponseInner. - */ - public static BackupAndExportResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportResponseInner deserializedBackupAndExportResponseInner = new BackupAndExportResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupAndExportResponseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupAndExportResponseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupAndExportResponseInner.type = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedBackupAndExportResponseInner.status = OperationStatus.fromString(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedBackupAndExportResponseInner.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedBackupAndExportResponseInner.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("percentComplete".equals(fieldName)) { - deserializedBackupAndExportResponseInner.percentComplete - = reader.getNullable(JsonReader::getDouble); - } else if ("properties".equals(fieldName)) { - deserializedBackupAndExportResponseInner.innerProperties - = BackupAndExportResponseProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedBackupAndExportResponseInner.systemData = SystemData.fromJson(reader); - } else if ("error".equals(fieldName)) { - deserializedBackupAndExportResponseInner.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportResponseInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java deleted file mode 100644 index d3a735bc7a4ca..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java +++ /dev/null @@ -1,154 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * BackupAndExport Response Properties. - */ -@Fluent -public final class BackupAndExportResponseProperties implements JsonSerializable { - /* - * Size of datasource in bytes - */ - private Long datasourceSizeInBytes; - - /* - * Data transferred in bytes - */ - private Long dataTransferredInBytes; - - /* - * Metadata related to backup to be stored for restoring resource in key-value pairs. - */ - private String backupMetadata; - - /** - * Creates an instance of BackupAndExportResponseProperties class. - */ - public BackupAndExportResponseProperties() { - } - - /** - * 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 BackupAndExportResponseProperties object itself. - */ - public BackupAndExportResponseProperties 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 BackupAndExportResponseProperties object itself. - */ - public BackupAndExportResponseProperties withDataTransferredInBytes(Long dataTransferredInBytes) { - this.dataTransferredInBytes = dataTransferredInBytes; - return this; - } - - /** - * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - public String backupMetadata() { - return this.backupMetadata; - } - - /** - * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @param backupMetadata the backupMetadata value to set. - * @return the BackupAndExportResponseProperties object itself. - */ - public BackupAndExportResponseProperties withBackupMetadata(String backupMetadata) { - this.backupMetadata = backupMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("datasourceSizeInBytes", this.datasourceSizeInBytes); - jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); - jsonWriter.writeStringField("backupMetadata", this.backupMetadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportResponseProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupAndExportResponseProperties. - */ - public static BackupAndExportResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportResponseProperties deserializedBackupAndExportResponseProperties - = new BackupAndExportResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("datasourceSizeInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseProperties.datasourceSizeInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("dataTransferredInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseProperties.dataTransferredInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("backupMetadata".equals(fieldName)) { - deserializedBackupAndExportResponseProperties.backupMetadata = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportResponseProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java deleted file mode 100644 index 867fdbaf4ccbb..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java +++ /dev/null @@ -1,184 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; -import java.io.IOException; -import java.util.List; - -/** - * Represents a location capability set. - */ -@Immutable -public final class CapabilityInner extends ProxyResource { - /* - * The properties of a location capability set. - */ - private CapabilityPropertiesV2 innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CapabilityInner class. - */ - public CapabilityInner() { - } - - /** - * Get the innerProperties property: The properties of a location capability set. - * - * @return the innerProperties value. - */ - private CapabilityPropertiesV2 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the supportedGeoBackupRegions property: supported geo backup regions. - * - * @return the supportedGeoBackupRegions value. - */ - public List supportedGeoBackupRegions() { - return this.innerProperties() == null ? null : this.innerProperties().supportedGeoBackupRegions(); - } - - /** - * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. - * - * @return the supportedFlexibleServerEditions value. - */ - public List supportedFlexibleServerEditions() { - return this.innerProperties() == null ? null : this.innerProperties().supportedFlexibleServerEditions(); - } - - /** - * Get the supportedServerVersions property: A list of supported server versions. - * - * @return the supportedServerVersions value. - */ - public List supportedServerVersions() { - return this.innerProperties() == null ? null : this.innerProperties().supportedServerVersions(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilityInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CapabilityInner. - */ - public static CapabilityInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityInner deserializedCapabilityInner = new CapabilityInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCapabilityInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCapabilityInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCapabilityInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCapabilityInner.innerProperties = CapabilityPropertiesV2.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCapabilityInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java deleted file mode 100644 index b4294d627a748..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; -import java.io.IOException; -import java.util.List; - -/** - * Location capability. - */ -@Immutable -public final class CapabilityPropertiesV2 implements JsonSerializable { - /* - * supported geo backup regions - */ - private List supportedGeoBackupRegions; - - /* - * A list of supported flexible server editions. - */ - private List supportedFlexibleServerEditions; - - /* - * A list of supported server versions. - */ - private List supportedServerVersions; - - /** - * Creates an instance of CapabilityPropertiesV2 class. - */ - public CapabilityPropertiesV2() { - } - - /** - * Get the supportedGeoBackupRegions property: supported geo backup regions. - * - * @return the supportedGeoBackupRegions value. - */ - public List supportedGeoBackupRegions() { - return this.supportedGeoBackupRegions; - } - - /** - * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. - * - * @return the supportedFlexibleServerEditions value. - */ - public List supportedFlexibleServerEditions() { - return this.supportedFlexibleServerEditions; - } - - /** - * Get the supportedServerVersions property: A list of supported server versions. - * - * @return the supportedServerVersions value. - */ - public List supportedServerVersions() { - return this.supportedServerVersions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedFlexibleServerEditions() != null) { - supportedFlexibleServerEditions().forEach(e -> e.validate()); - } - if (supportedServerVersions() != null) { - supportedServerVersions().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilityPropertiesV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityPropertiesV2 if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the CapabilityPropertiesV2. - */ - public static CapabilityPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityPropertiesV2 deserializedCapabilityPropertiesV2 = new CapabilityPropertiesV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("supportedGeoBackupRegions".equals(fieldName)) { - List supportedGeoBackupRegions = reader.readArray(reader1 -> reader1.getString()); - deserializedCapabilityPropertiesV2.supportedGeoBackupRegions = supportedGeoBackupRegions; - } else if ("supportedFlexibleServerEditions".equals(fieldName)) { - List supportedFlexibleServerEditions - = reader.readArray(reader1 -> ServerEditionCapabilityV2.fromJson(reader1)); - deserializedCapabilityPropertiesV2.supportedFlexibleServerEditions - = supportedFlexibleServerEditions; - } else if ("supportedServerVersions".equals(fieldName)) { - List supportedServerVersions - = reader.readArray(reader1 -> ServerVersionCapabilityV2.fromJson(reader1)); - deserializedCapabilityPropertiesV2.supportedServerVersions = supportedServerVersions; - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityPropertiesV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java index 7ab7fa162144b..abffbd42f30fd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java @@ -27,7 +27,7 @@ public final class ConfigurationInner extends ProxyResource { private ConfigurationProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The system metadata relating to this resource. */ private SystemData systemData; @@ -62,7 +62,7 @@ private ConfigurationProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -123,29 +123,6 @@ public ConfigurationInner withValue(String value) { return this; } - /** - * Get the currentValue property: Current value of the configuration. - * - * @return the currentValue value. - */ - public String currentValue() { - return this.innerProperties() == null ? null : this.innerProperties().currentValue(); - } - - /** - * Set the currentValue property: Current value of the configuration. - * - * @param currentValue the currentValue value to set. - * @return the ConfigurationInner object itself. - */ - public ConfigurationInner withCurrentValue(String currentValue) { - if (this.innerProperties() == null) { - this.innerProperties = new ConfigurationProperties(); - } - this.innerProperties().withCurrentValue(currentValue); - return this; - } - /** * Get the description property: Description of the configuration. * @@ -155,15 +132,6 @@ public String description() { return this.innerProperties() == null ? null : this.innerProperties().description(); } - /** - * Get the documentationLink property: The link used to get the document from community or Azure site. - * - * @return the documentationLink value. - */ - public String documentationLink() { - return this.innerProperties() == null ? null : this.innerProperties().documentationLink(); - } - /** * Get the defaultValue property: Default value of the configuration. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java index d97d297328c09..8c29eaa6b1861 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java @@ -25,21 +25,11 @@ public final class ConfigurationProperties implements JsonSerializable { - /* - * Estimated seconds of downtime for the deployment. - */ - private Integer estimatedDowntime; - - /* - * Scheduled Availability zone of the standby server. - */ - private String scheduledStandbyAvailabilityZone; - - /* - * Expected Availability zone of the standby server. - */ - private String expectedStandbyAvailabilityZone; - - /** - * Creates an instance of HighAvailabilityValidationEstimationInner class. - */ - public HighAvailabilityValidationEstimationInner() { - } - - /** - * Get the estimatedDowntime property: Estimated seconds of downtime for the deployment. - * - * @return the estimatedDowntime value. - */ - public Integer estimatedDowntime() { - return this.estimatedDowntime; - } - - /** - * Get the scheduledStandbyAvailabilityZone property: Scheduled Availability zone of the standby server. - * - * @return the scheduledStandbyAvailabilityZone value. - */ - public String scheduledStandbyAvailabilityZone() { - return this.scheduledStandbyAvailabilityZone; - } - - /** - * Get the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. - * - * @return the expectedStandbyAvailabilityZone value. - */ - public String expectedStandbyAvailabilityZone() { - return this.expectedStandbyAvailabilityZone; - } - - /** - * Set the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. - * - * @param expectedStandbyAvailabilityZone the expectedStandbyAvailabilityZone value to set. - * @return the HighAvailabilityValidationEstimationInner object itself. - */ - public HighAvailabilityValidationEstimationInner - withExpectedStandbyAvailabilityZone(String expectedStandbyAvailabilityZone) { - this.expectedStandbyAvailabilityZone = expectedStandbyAvailabilityZone; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("expectedStandbyAvailabilityZone", this.expectedStandbyAvailabilityZone); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HighAvailabilityValidationEstimationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HighAvailabilityValidationEstimationInner if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HighAvailabilityValidationEstimationInner. - */ - public static HighAvailabilityValidationEstimationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HighAvailabilityValidationEstimationInner deserializedHighAvailabilityValidationEstimationInner - = new HighAvailabilityValidationEstimationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("estimatedDowntime".equals(fieldName)) { - deserializedHighAvailabilityValidationEstimationInner.estimatedDowntime - = reader.getNullable(JsonReader::getInt); - } else if ("scheduledStandbyAvailabilityZone".equals(fieldName)) { - deserializedHighAvailabilityValidationEstimationInner.scheduledStandbyAvailabilityZone - = reader.getString(); - } else if ("expectedStandbyAvailabilityZone".equals(fieldName)) { - deserializedHighAvailabilityValidationEstimationInner.expectedStandbyAvailabilityZone - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHighAvailabilityValidationEstimationInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java deleted file mode 100644 index bd0e3d3cbeeb5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java +++ /dev/null @@ -1,270 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Represents a logFile. - */ -@Fluent -public final class LogFileInner extends ProxyResource { - /* - * The properties of a logFile. - */ - private LogFileProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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 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 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 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 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogFileInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogFileInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LogFileInner. - */ - public static LogFileInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogFileInner deserializedLogFileInner = new LogFileInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedLogFileInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedLogFileInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedLogFileInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedLogFileInner.innerProperties = LogFileProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedLogFileInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLogFileInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java deleted file mode 100644 index 4662c7bdf953d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java +++ /dev/null @@ -1,214 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a logFile. - */ -@Fluent -public final class LogFileProperties implements JsonSerializable { - /* - * The size in kb of the logFile. - */ - private Long sizeInKB; - - /* - * Creation timestamp of the log file. - */ - private OffsetDateTime createdTime; - - /* - * Type of the log file. - */ - private String type; - - /* - * Last modified timestamp of the log file. - */ - private OffsetDateTime lastModifiedTime; - - /* - * The url to download the log file from. - */ - private String url; - - /** - * Creates an instance of LogFileProperties class. - */ - public LogFileProperties() { - } - - /** - * 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 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 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 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 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("sizeInKB", this.sizeInKB); - jsonWriter.writeStringField("createdTime", - this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("lastModifiedTime", - this.lastModifiedTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); - jsonWriter.writeStringField("url", this.url); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogFileProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogFileProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the LogFileProperties. - */ - public static LogFileProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogFileProperties deserializedLogFileProperties = new LogFileProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sizeInKB".equals(fieldName)) { - deserializedLogFileProperties.sizeInKB = reader.getNullable(JsonReader::getLong); - } else if ("createdTime".equals(fieldName)) { - deserializedLogFileProperties.createdTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("type".equals(fieldName)) { - deserializedLogFileProperties.type = reader.getString(); - } else if ("lastModifiedTime".equals(fieldName)) { - deserializedLogFileProperties.lastModifiedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("url".equals(fieldName)) { - deserializedLogFileProperties.url = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLogFileProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java deleted file mode 100644 index cb6eaf3474e2e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java +++ /dev/null @@ -1,278 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Represents a maintenance. - */ -@Fluent -public final class MaintenanceInner extends ProxyResource { - /* - * The properties of a maintenance - */ - private MaintenanceProperties innerProperties = new MaintenanceProperties(); - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of MaintenanceInner class. - */ - public MaintenanceInner() { - } - - /** - * Get the innerProperties property: The properties of a maintenance. - * - * @return the innerProperties value. - */ - private MaintenanceProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the maintenanceType property: A string defines maintenance type. - * - * @return the maintenanceType value. - */ - public MaintenanceType maintenanceType() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceType(); - } - - /** - * Get the maintenanceState property: A string describes the maintenance status. - * - * @return the maintenanceState value. - */ - public MaintenanceState maintenanceState() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceState(); - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenanceInner object itself. - */ - public MaintenanceInner withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new MaintenanceProperties(); - } - this.innerProperties().withMaintenanceStartTime(maintenanceStartTime); - return this; - } - - /** - * Get the maintenanceEndTime property: The end time for a maintenance. - * - * @return the maintenanceEndTime value. - */ - public OffsetDateTime maintenanceEndTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceEndTime(); - } - - /** - * Get the maintenanceExecutionStartTime property: The start time for a maintenance execution. - * - * @return the maintenanceExecutionStartTime value. - */ - public OffsetDateTime maintenanceExecutionStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceExecutionStartTime(); - } - - /** - * Get the maintenanceExecutionEndTime property: The end time for a maintenance execution. - * - * @return the maintenanceExecutionEndTime value. - */ - public OffsetDateTime maintenanceExecutionEndTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceExecutionEndTime(); - } - - /** - * Get the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMinTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMinTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceAvailableScheduleMinTime(); - } - - /** - * Get the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMaxTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMaxTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceAvailableScheduleMaxTime(); - } - - /** - * Get the maintenanceTitle property: The maintenance title. - * - * @return the maintenanceTitle value. - */ - public String maintenanceTitle() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceTitle(); - } - - /** - * Get the maintenanceDescription property: The maintenance description. - * - * @return the maintenanceDescription value. - */ - public String maintenanceDescription() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceDescription(); - } - - /** - * Get the provisioningState property: Provisioning state of the Maintenance. - * - * @return the provisioningState value. - */ - public MaintenanceProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model MaintenanceInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MaintenanceInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenanceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the MaintenanceInner. - */ - public static MaintenanceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceInner deserializedMaintenanceInner = new MaintenanceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedMaintenanceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedMaintenanceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedMaintenanceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedMaintenanceInner.innerProperties = MaintenanceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedMaintenanceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java deleted file mode 100644 index 995c7d7d4ce39..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java +++ /dev/null @@ -1,270 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a maintenance resource. - */ -@Fluent -public final class MaintenanceProperties implements JsonSerializable { - /* - * A string defines maintenance type. - */ - private MaintenanceType maintenanceType; - - /* - * A string describes the maintenance status - */ - private MaintenanceState maintenanceState; - - /* - * The start time for a maintenance. - */ - private OffsetDateTime maintenanceStartTime; - - /* - * The end time for a maintenance. - */ - private OffsetDateTime maintenanceEndTime; - - /* - * The start time for a maintenance execution. - */ - private OffsetDateTime maintenanceExecutionStartTime; - - /* - * The end time for a maintenance execution. - */ - private OffsetDateTime maintenanceExecutionEndTime; - - /* - * The min time the maintenance can be rescheduled. - */ - private OffsetDateTime maintenanceAvailableScheduleMinTime; - - /* - * The max time the maintenance can be rescheduled. - */ - private OffsetDateTime maintenanceAvailableScheduleMaxTime; - - /* - * The maintenance title. - */ - private String maintenanceTitle; - - /* - * The maintenance description. - */ - private String maintenanceDescription; - - /* - * Provisioning state of the Maintenance. - */ - private MaintenanceProvisioningState provisioningState; - - /** - * Creates an instance of MaintenanceProperties class. - */ - public MaintenanceProperties() { - } - - /** - * Get the maintenanceType property: A string defines maintenance type. - * - * @return the maintenanceType value. - */ - public MaintenanceType maintenanceType() { - return this.maintenanceType; - } - - /** - * Get the maintenanceState property: A string describes the maintenance status. - * - * @return the maintenanceState value. - */ - public MaintenanceState maintenanceState() { - return this.maintenanceState; - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.maintenanceStartTime; - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenanceProperties object itself. - */ - public MaintenanceProperties withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - this.maintenanceStartTime = maintenanceStartTime; - return this; - } - - /** - * Get the maintenanceEndTime property: The end time for a maintenance. - * - * @return the maintenanceEndTime value. - */ - public OffsetDateTime maintenanceEndTime() { - return this.maintenanceEndTime; - } - - /** - * Get the maintenanceExecutionStartTime property: The start time for a maintenance execution. - * - * @return the maintenanceExecutionStartTime value. - */ - public OffsetDateTime maintenanceExecutionStartTime() { - return this.maintenanceExecutionStartTime; - } - - /** - * Get the maintenanceExecutionEndTime property: The end time for a maintenance execution. - * - * @return the maintenanceExecutionEndTime value. - */ - public OffsetDateTime maintenanceExecutionEndTime() { - return this.maintenanceExecutionEndTime; - } - - /** - * Get the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMinTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMinTime() { - return this.maintenanceAvailableScheduleMinTime; - } - - /** - * Get the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMaxTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMaxTime() { - return this.maintenanceAvailableScheduleMaxTime; - } - - /** - * Get the maintenanceTitle property: The maintenance title. - * - * @return the maintenanceTitle value. - */ - public String maintenanceTitle() { - return this.maintenanceTitle; - } - - /** - * Get the maintenanceDescription property: The maintenance description. - * - * @return the maintenanceDescription value. - */ - public String maintenanceDescription() { - return this.maintenanceDescription; - } - - /** - * Get the provisioningState property: Provisioning state of the Maintenance. - * - * @return the provisioningState value. - */ - public MaintenanceProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("maintenanceStartTime", - this.maintenanceStartTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maintenanceStartTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenanceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenanceProperties. - */ - public static MaintenanceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceProperties deserializedMaintenanceProperties = new MaintenanceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("maintenanceType".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceType = MaintenanceType.fromString(reader.getString()); - } else if ("maintenanceState".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceState - = MaintenanceState.fromString(reader.getString()); - } else if ("maintenanceStartTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceEndTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceExecutionStartTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceExecutionStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceExecutionEndTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceExecutionEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceAvailableScheduleMinTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceAvailableScheduleMinTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceAvailableScheduleMaxTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceAvailableScheduleMaxTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceTitle".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceTitle = reader.getString(); - } else if ("maintenanceDescription".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceDescription = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedMaintenanceProperties.provisioningState - = MaintenanceProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java deleted file mode 100644 index 70c63230412db..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java +++ /dev/null @@ -1,101 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a maintenance update parameter. - */ -@Fluent -public final class MaintenancePropertiesForUpdate implements JsonSerializable { - /* - * The start time for a maintenance. - */ - private OffsetDateTime maintenanceStartTime; - - /** - * Creates an instance of MaintenancePropertiesForUpdate class. - */ - public MaintenancePropertiesForUpdate() { - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.maintenanceStartTime; - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenancePropertiesForUpdate object itself. - */ - public MaintenancePropertiesForUpdate withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - this.maintenanceStartTime = maintenanceStartTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("maintenanceStartTime", - this.maintenanceStartTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maintenanceStartTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenancePropertiesForUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenancePropertiesForUpdate if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenancePropertiesForUpdate. - */ - public static MaintenancePropertiesForUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenancePropertiesForUpdate deserializedMaintenancePropertiesForUpdate - = new MaintenancePropertiesForUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("maintenanceStartTime".equals(fieldName)) { - deserializedMaintenancePropertiesForUpdate.maintenanceStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenancePropertiesForUpdate; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java deleted file mode 100644 index 5792530f69875..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java +++ /dev/null @@ -1,237 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Represents Operation Results API Response. - */ -@Fluent -public final class OperationProgressResultInner extends OperationStatusResult { - /* - * The response properties specific to the operation - */ - private OperationProgressResponseType properties; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /** - * Creates an instance of OperationProgressResultInner class. - */ - public OperationProgressResultInner() { - } - - /** - * Get the properties property: The response properties specific to the operation. - * - * @return the properties value. - */ - public OperationProgressResponseType properties() { - return this.properties; - } - - /** - * Set the properties property: The response properties specific to the operation. - * - * @param properties the properties value to set. - * @return the OperationProgressResultInner object itself. - */ - public OperationProgressResultInner withProperties(OperationProgressResponseType properties) { - this.properties = properties; - return this; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - @Override - public String resourceId() { - return this.resourceId; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withStatus(String status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withPercentComplete(Float percentComplete) { - super.withPercentComplete(percentComplete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withStartTime(OffsetDateTime startTime) { - super.withStartTime(startTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withEndTime(OffsetDateTime endTime) { - super.withEndTime(endTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withOperations(List operations) { - super.withOperations(operations); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withError(ManagementError error) { - super.withError(error); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model OperationProgressResultInner")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationProgressResultInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("id", id()); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeNumberField("percentComplete", percentComplete()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeArrayField("operations", operations(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", error()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationProgressResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationProgressResultInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationProgressResultInner. - */ - public static OperationProgressResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationProgressResultInner deserializedOperationProgressResultInner = new OperationProgressResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationProgressResultInner.withStatus(reader.getString()); - } else if ("id".equals(fieldName)) { - deserializedOperationProgressResultInner.withId(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationProgressResultInner.resourceId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationProgressResultInner.withName(reader.getString()); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationProgressResultInner - .withPercentComplete(reader.getNullable(JsonReader::getFloat)); - } else if ("startTime".equals(fieldName)) { - deserializedOperationProgressResultInner.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedOperationProgressResultInner.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationProgressResultInner.withOperations(operations); - } else if ("error".equals(fieldName)) { - deserializedOperationProgressResultInner.withError(ManagementError.fromJson(reader)); - } else if ("properties".equals(fieldName)) { - deserializedOperationProgressResultInner.properties - = OperationProgressResponseType.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationProgressResultInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java deleted file mode 100644 index 788cc02e22185..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java +++ /dev/null @@ -1,235 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Represents Operation Results API Response. - */ -@Fluent -public final class OperationStatusExtendedResultInner extends OperationStatusResult { - /* - * The extended properties of Operation Results - */ - private Map properties; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /** - * Creates an instance of OperationStatusExtendedResultInner class. - */ - public OperationStatusExtendedResultInner() { - } - - /** - * Get the properties property: The extended properties of Operation Results. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: The extended properties of Operation Results. - * - * @param properties the properties value to set. - * @return the OperationStatusExtendedResultInner object itself. - */ - public OperationStatusExtendedResultInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - @Override - public String resourceId() { - return this.resourceId; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withStatus(String status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withPercentComplete(Float percentComplete) { - super.withPercentComplete(percentComplete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withStartTime(OffsetDateTime startTime) { - super.withStartTime(startTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withEndTime(OffsetDateTime endTime) { - super.withEndTime(endTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withOperations(List operations) { - super.withOperations(operations); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withError(ManagementError error) { - super.withError(error); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model OperationStatusExtendedResultInner")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusExtendedResultInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("id", id()); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeNumberField("percentComplete", percentComplete()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeArrayField("operations", operations(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", error()); - jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusExtendedResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusExtendedResultInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationStatusExtendedResultInner. - */ - public static OperationStatusExtendedResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusExtendedResultInner deserializedOperationStatusExtendedResultInner - = new OperationStatusExtendedResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withStatus(reader.getString()); - } else if ("id".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withId(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.resourceId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withName(reader.getString()); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner - .withPercentComplete(reader.getNullable(JsonReader::getFloat)); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationStatusExtendedResultInner.withOperations(operations); - } else if ("error".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withError(ManagementError.fromJson(reader)); - } else if ("properties".equals(fieldName)) { - Map properties = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedOperationStatusExtendedResultInner.properties = properties; - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusExtendedResultInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 19ddbfdc2a73c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,179 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import java.io.IOException; -import java.util.List; - -/** - * Properties of the private endpoint connection. - */ -@Fluent -public final class PrivateEndpointConnectionProperties - implements JsonSerializable { - /* - * The group ids for the private endpoint resource. - */ - private List groupIds; - - /* - * The private endpoint resource. - */ - private PrivateEndpoint privateEndpoint; - - /* - * A collection of information about the state of the connection between service consumer and provider. - */ - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. - */ - private PrivateEndpointConnectionProvisioningState provisioningState; - - /** - * Creates an instance of PrivateEndpointConnectionProperties class. - */ - public PrivateEndpointConnectionProperties() { - } - - /** - * Get the groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.groupIds; - } - - /** - * Get the privateEndpoint property: The private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); - jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. - */ - public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties - = new PrivateEndpointConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("privateLinkServiceConnectionState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState - = PrivateLinkServiceConnectionState.fromJson(reader); - } else if ("groupIds".equals(fieldName)) { - List groupIds = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; - } else if ("privateEndpoint".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.provisioningState - = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java index 9a9bfd57250a3..fb2bcb081b039 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java @@ -24,7 +24,7 @@ public final class ServerBackupInner extends ProxyResource { private ServerBackupProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The system metadata relating to this resource. */ private SystemData systemData; @@ -59,7 +59,7 @@ private ServerBackupProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java deleted file mode 100644 index 7b6cc175c67c7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java +++ /dev/null @@ -1,201 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a server backup. - */ -@Fluent -public final class ServerBackupPropertiesV2 implements JsonSerializable { - /* - * Backup name - */ - private String backupNameV2; - - /* - * The backupType property. - */ - private BackupType backupType; - - /* - * Backup completed time (ISO8601 format). - */ - private OffsetDateTime completedTime; - - /* - * Backup source - */ - private String source; - - /* - * The provisioning state of backup resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of ServerBackupPropertiesV2 class. - */ - public ServerBackupPropertiesV2() { - } - - /** - * Get the backupNameV2 property: Backup name. - * - * @return the backupNameV2 value. - */ - public String backupNameV2() { - return this.backupNameV2; - } - - /** - * Set the backupNameV2 property: Backup name. - * - * @param backupNameV2 the backupNameV2 value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withBackupNameV2(String backupNameV2) { - this.backupNameV2 = backupNameV2; - return this; - } - - /** - * Get the backupType property: The backupType property. - * - * @return the backupType value. - */ - public BackupType backupType() { - return this.backupType; - } - - /** - * Set the backupType property: The backupType property. - * - * @param backupType the backupType value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withBackupType(BackupType backupType) { - this.backupType = backupType; - return this; - } - - /** - * Get the completedTime property: Backup completed time (ISO8601 format). - * - * @return the completedTime value. - */ - public OffsetDateTime completedTime() { - return this.completedTime; - } - - /** - * Set the completedTime property: Backup completed time (ISO8601 format). - * - * @param completedTime the completedTime value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withCompletedTime(OffsetDateTime completedTime) { - this.completedTime = completedTime; - return this; - } - - /** - * Get the source property: Backup source. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Backup source. - * - * @param source the source value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of backup resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupNameV2", this.backupNameV2); - jsonWriter.writeStringField("backupType", this.backupType == null ? null : this.backupType.toString()); - jsonWriter.writeStringField("completedTime", - this.completedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedTime)); - jsonWriter.writeStringField("source", this.source); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerBackupPropertiesV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerBackupPropertiesV2 if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerBackupPropertiesV2. - */ - public static ServerBackupPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerBackupPropertiesV2 deserializedServerBackupPropertiesV2 = new ServerBackupPropertiesV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupNameV2".equals(fieldName)) { - deserializedServerBackupPropertiesV2.backupNameV2 = reader.getString(); - } else if ("backupType".equals(fieldName)) { - deserializedServerBackupPropertiesV2.backupType = BackupType.fromString(reader.getString()); - } else if ("completedTime".equals(fieldName)) { - deserializedServerBackupPropertiesV2.completedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("source".equals(fieldName)) { - deserializedServerBackupPropertiesV2.source = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedServerBackupPropertiesV2.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedServerBackupPropertiesV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java deleted file mode 100644 index e916cd8a708c2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java +++ /dev/null @@ -1,258 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Server backup properties. - */ -@Fluent -public final class ServerBackupV2Inner extends ProxyResource { - /* - * The properties of a server backup. - */ - private ServerBackupPropertiesV2 innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ServerBackupV2Inner class. - */ - public ServerBackupV2Inner() { - } - - /** - * Get the innerProperties property: The properties of a server backup. - * - * @return the innerProperties value. - */ - private ServerBackupPropertiesV2 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the backupNameV2 property: Backup name. - * - * @return the backupNameV2 value. - */ - public String backupNameV2() { - return this.innerProperties() == null ? null : this.innerProperties().backupNameV2(); - } - - /** - * Set the backupNameV2 property: Backup name. - * - * @param backupNameV2 the backupNameV2 value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withBackupNameV2(String backupNameV2) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withBackupNameV2(backupNameV2); - return this; - } - - /** - * Get the backupType property: The backupType property. - * - * @return the backupType value. - */ - public BackupType backupType() { - return this.innerProperties() == null ? null : this.innerProperties().backupType(); - } - - /** - * Set the backupType property: The backupType property. - * - * @param backupType the backupType value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withBackupType(BackupType backupType) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withBackupType(backupType); - return this; - } - - /** - * Get the completedTime property: Backup completed time (ISO8601 format). - * - * @return the completedTime value. - */ - public OffsetDateTime completedTime() { - return this.innerProperties() == null ? null : this.innerProperties().completedTime(); - } - - /** - * Set the completedTime property: Backup completed time (ISO8601 format). - * - * @param completedTime the completedTime value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withCompletedTime(OffsetDateTime completedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withCompletedTime(completedTime); - return this; - } - - /** - * Get the source property: Backup source. - * - * @return the source value. - */ - public String source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Backup source. - * - * @param source the source value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withSource(String source) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of backup resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerBackupV2Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerBackupV2Inner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ServerBackupV2Inner. - */ - public static ServerBackupV2Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerBackupV2Inner deserializedServerBackupV2Inner = new ServerBackupV2Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedServerBackupV2Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedServerBackupV2Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedServerBackupV2Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedServerBackupV2Inner.innerProperties = ServerBackupPropertiesV2.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedServerBackupV2Inner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServerBackupV2Inner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java index d50518bed3b80..508feeccbf1a2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java @@ -14,19 +14,16 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; -import java.util.List; import java.util.Map; /** @@ -37,12 +34,12 @@ public final class ServerInner extends Resource { /* * The cmk identity for the server. */ - private MySqlServerIdentity identity; + private Identity identity; /* * The SKU (pricing tier) of the server. */ - private MySqlServerSku sku; + private Sku sku; /* * Properties of the server. @@ -50,7 +47,7 @@ public final class ServerInner extends Resource { private ServerProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The system metadata relating to this resource. */ private SystemData systemData; @@ -80,7 +77,7 @@ public ServerInner() { * * @return the identity value. */ - public MySqlServerIdentity identity() { + public Identity identity() { return this.identity; } @@ -90,7 +87,7 @@ public MySqlServerIdentity identity() { * @param identity the identity value to set. * @return the ServerInner object itself. */ - public ServerInner withIdentity(MySqlServerIdentity identity) { + public ServerInner withIdentity(Identity identity) { this.identity = identity; return this; } @@ -100,7 +97,7 @@ public ServerInner withIdentity(MySqlServerIdentity identity) { * * @return the sku value. */ - public MySqlServerSku sku() { + public Sku sku() { return this.sku; } @@ -110,7 +107,7 @@ public MySqlServerSku sku() { * @param sku the sku value to set. * @return the ServerInner object itself. */ - public ServerInner withSku(MySqlServerSku sku) { + public ServerInner withSku(Sku sku) { this.sku = sku; return this; } @@ -125,7 +122,7 @@ private ServerProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -513,15 +510,6 @@ public ServerInner withNetwork(Network network) { return this; } - /** - * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); - } - /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -545,29 +533,6 @@ public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { return this; } - /** - * Get the importSourceProperties property: Source properties for import from storage. - * - * @return the importSourceProperties value. - */ - public ImportSourceProperties importSourceProperties() { - return this.innerProperties() == null ? null : this.innerProperties().importSourceProperties(); - } - - /** - * Set the importSourceProperties property: Source properties for import from storage. - * - * @param importSourceProperties the importSourceProperties value to set. - * @return the ServerInner object itself. - */ - public ServerInner withImportSourceProperties(ImportSourceProperties importSourceProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withImportSourceProperties(importSourceProperties); - return this; - } - /** * Validates the instance. * @@ -627,9 +592,9 @@ public static ServerInner fromJson(JsonReader jsonReader) throws IOException { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedServerInner.withTags(tags); } else if ("identity".equals(fieldName)) { - deserializedServerInner.identity = MySqlServerIdentity.fromJson(reader); + deserializedServerInner.identity = Identity.fromJson(reader); } else if ("sku".equals(fieldName)) { - deserializedServerInner.sku = MySqlServerSku.fromJson(reader); + deserializedServerInner.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedServerInner.innerProperties = ServerProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java index 04d68b4f983e2..6dd62aff6100f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java @@ -14,10 +14,8 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; @@ -25,7 +23,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -import java.util.List; /** * The properties of a server. @@ -113,21 +110,11 @@ public final class ServerProperties implements JsonSerializable privateEndpointConnections; - /* * Maintenance window of a server. */ private MaintenanceWindow maintenanceWindow; - /* - * Source properties for import from storage. - */ - private ImportSourceProperties importSourceProperties; - /** * Creates an instance of ServerProperties class. */ @@ -427,15 +414,6 @@ public ServerProperties withNetwork(Network network) { return this; } - /** - * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -456,26 +434,6 @@ public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindo return this; } - /** - * Get the importSourceProperties property: Source properties for import from storage. - * - * @return the importSourceProperties value. - */ - public ImportSourceProperties importSourceProperties() { - return this.importSourceProperties; - } - - /** - * Set the importSourceProperties property: Source properties for import from storage. - * - * @param importSourceProperties the importSourceProperties value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withImportSourceProperties(ImportSourceProperties importSourceProperties) { - this.importSourceProperties = importSourceProperties; - return this; - } - /** * Validates the instance. * @@ -497,15 +455,9 @@ public void validate() { if (network() != null) { network().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } if (maintenanceWindow() != null) { maintenanceWindow().validate(); } - if (importSourceProperties() != null) { - importSourceProperties().validate(); - } } /** @@ -532,7 +484,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("highAvailability", this.highAvailability); jsonWriter.writeJsonField("network", this.network); jsonWriter.writeJsonField("maintenanceWindow", this.maintenanceWindow); - jsonWriter.writeJsonField("importSourceProperties", this.importSourceProperties); return jsonWriter.writeEndObject(); } @@ -584,14 +535,8 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedServerProperties.highAvailability = HighAvailability.fromJson(reader); } else if ("network".equals(fieldName)) { deserializedServerProperties.network = Network.fromJson(reader); - } else if ("privateEndpointConnections".equals(fieldName)) { - List privateEndpointConnections - = reader.readArray(reader1 -> PrivateEndpointConnection.fromJson(reader1)); - deserializedServerProperties.privateEndpointConnections = privateEndpointConnections; } else if ("maintenanceWindow".equals(fieldName)) { deserializedServerProperties.maintenanceWindow = MaintenanceWindow.fromJson(reader); - } else if ("importSourceProperties".equals(fieldName)) { - deserializedServerProperties.importSourceProperties = ImportSourceProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java index 49dddaa9514e8..e4db5bc6ca0e3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java @@ -13,9 +13,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -29,11 +27,6 @@ public final class ServerPropertiesForUpdate implements JsonSerializable { - /* - * The response properties of a pre backup operation. - */ - private ValidateBackupResponseProperties innerProperties; - - /** - * Creates an instance of ValidateBackupResponseInner class. - */ - public ValidateBackupResponseInner() { - } - - /** - * Get the innerProperties property: The response properties of a pre backup operation. - * - * @return the innerProperties value. - */ - private ValidateBackupResponseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @return the numberOfContainers value. - */ - public Integer numberOfContainers() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfContainers(); - } - - /** - * Set the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @param numberOfContainers the numberOfContainers value to set. - * @return the ValidateBackupResponseInner object itself. - */ - public ValidateBackupResponseInner withNumberOfContainers(Integer numberOfContainers) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateBackupResponseProperties(); - } - this.innerProperties().withNumberOfContainers(numberOfContainers); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateBackupResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateBackupResponseInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ValidateBackupResponseInner. - */ - public static ValidateBackupResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateBackupResponseInner deserializedValidateBackupResponseInner = new ValidateBackupResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedValidateBackupResponseInner.innerProperties - = ValidateBackupResponseProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateBackupResponseInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java deleted file mode 100644 index a09825eb03a74..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java +++ /dev/null @@ -1,97 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * ValidateBackup Response Properties. - */ -@Fluent -public final class ValidateBackupResponseProperties implements JsonSerializable { - /* - * Estimated no of storage containers required for resource data to be backed up. - */ - private Integer numberOfContainers; - - /** - * Creates an instance of ValidateBackupResponseProperties class. - */ - public ValidateBackupResponseProperties() { - } - - /** - * Get the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @return the numberOfContainers value. - */ - public Integer numberOfContainers() { - return this.numberOfContainers; - } - - /** - * Set the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @param numberOfContainers the numberOfContainers value to set. - * @return the ValidateBackupResponseProperties object itself. - */ - public ValidateBackupResponseProperties withNumberOfContainers(Integer numberOfContainers) { - this.numberOfContainers = numberOfContainers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("numberOfContainers", this.numberOfContainers); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateBackupResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateBackupResponseProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ValidateBackupResponseProperties. - */ - public static ValidateBackupResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateBackupResponseProperties deserializedValidateBackupResponseProperties - = new ValidateBackupResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("numberOfContainers".equals(fieldName)) { - deserializedValidateBackupResponseProperties.numberOfContainers - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateBackupResponseProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java deleted file mode 100644 index f16ea1cbff87f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java +++ /dev/null @@ -1,60 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.time.OffsetDateTime; - -public final class AdvancedThreatProtectionImpl implements AdvancedThreatProtection { - private AdvancedThreatProtectionInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - AdvancedThreatProtectionImpl(AdvancedThreatProtectionInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 creationTime() { - return this.innerModel().creationTime(); - } - - public AdvancedThreatProtectionState state() { - return this.innerModel().state(); - } - - public AdvancedThreatProtectionProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public AdvancedThreatProtectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java deleted file mode 100644 index 851a980aec005..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java +++ /dev/null @@ -1,990 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -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 AdvancedThreatProtectionSettingsClient. - */ -public final class AdvancedThreatProtectionSettingsClientImpl implements AdvancedThreatProtectionSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AdvancedThreatProtectionSettingsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of AdvancedThreatProtectionSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AdvancedThreatProtectionSettingsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(AdvancedThreatProtectionSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientAdvancedThreatProtectionSettings to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface AdvancedThreatProtectionSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AdvancedThreatProtectionForUpdate parameters, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updatePut(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AdvancedThreatProtectionInner parameters, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, serverName, - advancedThreatProtectionName, this.client.getSubscriptionId(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, serverName, advancedThreatProtectionName, - this.client.getSubscriptionId(), apiVersion, accept, context); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName) { - return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, context).block(); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName) { - return getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, Context.NONE).getValue(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, serverName, - advancedThreatProtectionName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, serverName, advancedThreatProtectionName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - this.client.getContext()); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - return updateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).block(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - return updateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).block(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updatePutWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updatePut(this.client.getEndpoint(), resourceGroupName, serverName, - advancedThreatProtectionName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updatePutWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updatePut(this.client.getEndpoint(), resourceGroupName, serverName, advancedThreatProtectionName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdatePutAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters) { - Mono>> mono - = updatePutWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - this.client.getContext()); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdatePutAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updatePutWithResponseAsync(resourceGroupName, serverName, - advancedThreatProtectionName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters) { - return this.beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters, Context context) { - return this - .beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updatePutAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - return beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updatePutAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - return beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - return updatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).block(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - return updatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).block(); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 server's Advanced Threat Protection states along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, serverName, - this.client.getSubscriptionId(), apiVersion, 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 a list of server's Advanced Threat Protection states. - * - * @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 server's Advanced Threat Protection states along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, serverName, this.client.getSubscriptionId(), apiVersion, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of the server's Advanced Threat Protection configurations along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of the server's Advanced Threat Protection configurations along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java deleted file mode 100644 index 7a90939f638c8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java +++ /dev/null @@ -1,119 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; - -public final class AdvancedThreatProtectionSettingsImpl implements AdvancedThreatProtectionSettings { - private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionSettingsImpl.class); - - private final AdvancedThreatProtectionSettingsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public AdvancedThreatProtectionSettingsImpl(AdvancedThreatProtectionSettingsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AdvancedThreatProtectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AdvancedThreatProtection get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName) { - AdvancedThreatProtectionInner inner - = this.serviceClient().get(resourceGroupName, serverName, advancedThreatProtectionName); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - AdvancedThreatProtectionInner inner - = this.serviceClient().update(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - AdvancedThreatProtectionInner inner = this.serviceClient() - .update(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - AdvancedThreatProtectionInner inner - = this.serviceClient().updatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - AdvancedThreatProtectionInner inner = this.serviceClient() - .updatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); - } - - private AdvancedThreatProtectionSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java deleted file mode 100644 index 7bdadb8ff89d1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java +++ /dev/null @@ -1,169 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; - -public final class AzureADAdministratorImpl - implements AzureADAdministrator, AzureADAdministrator.Definition, AzureADAdministrator.Update { - private AzureADAdministratorInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 AdministratorType administratorType() { - return this.innerModel().administratorType(); - } - - public String login() { - return this.innerModel().login(); - } - - public String sid() { - return this.innerModel().sid(); - } - - public String tenantId() { - return this.innerModel().tenantId(); - } - - public String identityResourceId() { - return this.innerModel().identityResourceId(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureADAdministratorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private AdministratorName administratorName; - - public AzureADAdministratorImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public AzureADAdministrator create() { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), Context.NONE); - return this; - } - - public AzureADAdministrator create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), context); - return this; - } - - AzureADAdministratorImpl(AdministratorName name, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new AzureADAdministratorInner(); - this.serviceManager = serviceManager; - this.administratorName = name; - } - - public AzureADAdministratorImpl update() { - return this; - } - - public AzureADAdministrator apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), Context.NONE); - return this; - } - - public AzureADAdministrator apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), context); - return this; - } - - AzureADAdministratorImpl(AzureADAdministratorInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.administratorName = AdministratorName - .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "administrators")); - } - - public AzureADAdministrator refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE) - .getValue(); - return this; - } - - public AzureADAdministrator refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .getWithResponse(resourceGroupName, serverName, administratorName, context) - .getValue(); - return this; - } - - public AzureADAdministratorImpl withAdministratorType(AdministratorType administratorType) { - this.innerModel().withAdministratorType(administratorType); - return this; - } - - public AzureADAdministratorImpl withLogin(String login) { - this.innerModel().withLogin(login); - return this; - } - - public AzureADAdministratorImpl withSid(String sid) { - this.innerModel().withSid(sid); - return this; - } - - public AzureADAdministratorImpl withTenantId(String tenantId) { - this.innerModel().withTenantId(tenantId); - return this; - } - - public AzureADAdministratorImpl withIdentityResourceId(String identityResourceId) { - this.innerModel().withIdentityResourceId(identityResourceId); - return this; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java deleted file mode 100644 index 980f0d89350ed..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java +++ /dev/null @@ -1,945 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -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 AzureADAdministratorsClient. - */ -public final class AzureADAdministratorsClientImpl implements AzureADAdministratorsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureADAdministratorsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of AzureADAdministratorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureADAdministratorsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(AzureADAdministratorsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientAzureADAdministrators to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface AzureADAdministratorsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("administratorName") AdministratorName administratorName, - @BodyParam("application/json") AzureADAdministratorInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("administratorName") AdministratorName administratorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") - @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("administratorName") AdministratorName administratorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators") - @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); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Administrator along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, AdministratorName administratorName, AzureADAdministratorInner 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 (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName 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 apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Administrator along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, AdministratorName administratorName, AzureADAdministratorInner 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 (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName 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 apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, administratorName, parameters, accept, context); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureADAdministratorInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, administratorName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureADAdministratorInner.class, AzureADAdministratorInner.class, - this.client.getContext()); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureADAdministratorInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, administratorName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureADAdministratorInner.class, AzureADAdministratorInner.class, context); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Administrator on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Administrator on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters).block(); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters, context).block(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, - AdministratorName administratorName) { - 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 (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, 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 (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, administratorName, accept, context); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, - AdministratorName administratorName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, serverName, administratorName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, serverName, administratorName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, - AdministratorName administratorName) { - return this.beginDeleteAsync(resourceGroupName, serverName, administratorName).getSyncPoller(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - return this.beginDeleteAsync(resourceGroupName, serverName, administratorName, context).getSyncPoller(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, AdministratorName administratorName) { - return beginDeleteAsync(resourceGroupName, serverName, administratorName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, AdministratorName administratorName, - Context context) { - return beginDeleteAsync(resourceGroupName, serverName, administratorName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, AdministratorName administratorName) { - deleteAsync(resourceGroupName, serverName, administratorName).block(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, AdministratorName administratorName, - Context context) { - deleteAsync(resourceGroupName, serverName, administratorName, context).block(); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - AdministratorName administratorName) { - 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 (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, administratorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, 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 (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, administratorName, accept, context); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, - AdministratorName administratorName) { - return getWithResponseAsync(resourceGroupName, serverName, administratorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, administratorName, context).block(); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureADAdministratorInner get(String resourceGroupName, String serverName, - AdministratorName administratorName) { - return getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE).getValue(); - } - - /** - * List all the AAD administrators 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 azure ad administrators 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 apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, - 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 AAD administrators 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 azure ad administrators 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 apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), apiVersion, 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 AAD administrators 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 azure ad administrators as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * List all the AAD administrators 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 azure ad administrators 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 AAD administrators 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 azure ad administrators 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 AAD administrators 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 azure ad administrators 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 azure ad administrators 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 azure ad administrators 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java deleted file mode 100644 index 23e322189c45d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java +++ /dev/null @@ -1,165 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.AzureADAdministratorsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; - -public final class AzureADAdministratorsImpl implements AzureADAdministrators { - private static final ClientLogger LOGGER = new ClientLogger(AzureADAdministratorsImpl.class); - - private final AzureADAdministratorsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public AzureADAdministratorsImpl(AzureADAdministratorsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String resourceGroupName, String serverName, AdministratorName administratorName) { - this.serviceClient().delete(resourceGroupName, serverName, administratorName); - } - - public void delete(String resourceGroupName, String serverName, AdministratorName administratorName, - Context context) { - this.serviceClient().delete(resourceGroupName, serverName, administratorName, context); - } - - public Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, serverName, administratorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureADAdministratorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AzureADAdministrator get(String resourceGroupName, String serverName, AdministratorName administratorName) { - AzureADAdministratorInner inner = this.serviceClient().get(resourceGroupName, serverName, administratorName); - if (inner != null) { - return new AzureADAdministratorImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, - Context context) { - PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); - } - - public AzureADAdministrator getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - return this.getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - return this.getWithResponse(resourceGroupName, serverName, administratorName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - this.delete(resourceGroupName, serverName, administratorName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - this.delete(resourceGroupName, serverName, administratorName, context); - } - - private AzureADAdministratorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public AzureADAdministratorImpl define(AdministratorName name) { - return new AzureADAdministratorImpl(name, this.manager()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java deleted file mode 100644 index 5b23fc76bddd7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java +++ /dev/null @@ -1,80 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.time.OffsetDateTime; - -public final class BackupAndExportResponseImpl implements BackupAndExportResponse { - private BackupAndExportResponseInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - BackupAndExportResponseImpl(BackupAndExportResponseInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 OperationStatus 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public Long datasourceSizeInBytes() { - return this.innerModel().datasourceSizeInBytes(); - } - - public Long dataTransferredInBytes() { - return this.innerModel().dataTransferredInBytes(); - } - - public String backupMetadata() { - return this.innerModel().backupMetadata(); - } - - public BackupAndExportResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java deleted file mode 100644 index 16a2767fbe01c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java +++ /dev/null @@ -1,445 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.BackupAndExportsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -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 BackupAndExportsClient. - */ -public final class BackupAndExportsClientImpl implements BackupAndExportsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupAndExportsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of BackupAndExportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupAndExportsClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(BackupAndExportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientBackupAndExports to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface BackupAndExportsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") BackupAndExportRequest parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateBackup") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateBackup(@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); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - BackupAndExportRequest 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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - BackupAndExportRequest 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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, parameters, accept, context); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 {@link PollerFlux} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupAndExportResponseInner> - beginCreateAsync(String resourceGroupName, String serverName, BackupAndExportRequest parameters) { - Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupAndExportResponseInner.class, BackupAndExportResponseInner.class, - this.client.getContext()); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 {@link PollerFlux} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupAndExportResponseInner> beginCreateAsync( - String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupAndExportResponseInner.class, BackupAndExportResponseInner.class, - context); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters) { - return this.beginCreateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - return beginCreateAsync(resourceGroupName, serverName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - return beginCreateAsync(resourceGroupName, serverName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupAndExportResponseInner create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - return createAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupAndExportResponseInner create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - return createAsync(resourceGroupName, serverName, parameters, context).block(); - } - - /** - * Validates if backup can be performed for 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 represents ValidateBackup API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateBackupWithResponseAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validateBackup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates if backup can be performed for 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 represents ValidateBackup API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateBackupWithResponseAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validateBackup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); - } - - /** - * Validates if backup can be performed for 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 represents ValidateBackup API Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateBackupAsync(String resourceGroupName, String serverName) { - return validateBackupWithResponseAsync(resourceGroupName, serverName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validates if backup can be performed for 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 represents ValidateBackup API Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context) { - return validateBackupWithResponseAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Validates if backup can be performed for 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 represents ValidateBackup API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName) { - return validateBackupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java deleted file mode 100644 index bb4bf15d4d9f6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java +++ /dev/null @@ -1,81 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.BackupAndExportsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; - -public final class BackupAndExportsImpl implements BackupAndExports { - private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportsImpl.class); - - private final BackupAndExportsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public BackupAndExportsImpl(BackupAndExportsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public BackupAndExportResponse create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - BackupAndExportResponseInner inner = this.serviceClient().create(resourceGroupName, serverName, parameters); - if (inner != null) { - return new BackupAndExportResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public BackupAndExportResponse create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - BackupAndExportResponseInner inner - = this.serviceClient().create(resourceGroupName, serverName, parameters, context); - if (inner != null) { - return new BackupAndExportResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context) { - Response inner - = this.serviceClient().validateBackupWithResponse(resourceGroupName, serverName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ValidateBackupResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ValidateBackupResponse validateBackup(String resourceGroupName, String serverName) { - ValidateBackupResponseInner inner = this.serviceClient().validateBackup(resourceGroupName, serverName); - if (inner != null) { - return new ValidateBackupResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private BackupAndExportsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java index ec2fa0fe8f2e7..713b6d936e36f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -62,15 +61,6 @@ public final class BackupsClientImpl implements BackupsClient { @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") public interface BackupsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put(@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.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") @ExpectedResponses({ 200 }) @@ -98,137 +88,6 @@ Mono> listByServerNext( @HeaderParam("Accept") String accept, Context context); } - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.put(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, accept, context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync(String resourceGroupName, String serverName, String backupName) { - return putWithResponseAsync(resourceGroupName, serverName, backupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context) { - return putWithResponseAsync(resourceGroupName, serverName, backupName, context).block(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupInner put(String resourceGroupName, String serverName, String backupName) { - return putWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); - } - /** * List all the backups for a given server. * @@ -261,11 +120,10 @@ private Mono> getWithResponseAsync(String resourceGr if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, accept, context)) + .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())); } @@ -302,11 +160,10 @@ private Mono> getWithResponseAsync(String resourceGr if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, backupName, accept, context); } /** @@ -388,10 +245,9 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .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)) @@ -427,12 +283,11 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .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)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java index 7b8809b8c41b1..978c5749d31e0 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java @@ -27,27 +27,6 @@ public BackupsImpl(BackupsClient innerClient, this.serviceManager = serviceManager; } - public Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context) { - Response inner - = this.serviceClient().putWithResponse(resourceGroupName, serverName, backupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerBackupImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerBackup put(String resourceGroupName, String serverName, String backupName) { - ServerBackupInner inner = this.serviceClient().put(resourceGroupName, serverName, backupName); - if (inner != null) { - return new ServerBackupImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceGroupName, String serverName, String backupName, Context context) { Response inner diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java deleted file mode 100644 index 95da88844c6a6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java +++ /dev/null @@ -1,76 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; -import java.util.Collections; -import java.util.List; - -public final class CapabilityImpl implements Capability { - private CapabilityInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - CapabilityImpl(CapabilityInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 List supportedGeoBackupRegions() { - List inner = this.innerModel().supportedGeoBackupRegions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List supportedFlexibleServerEditions() { - List inner = this.innerModel().supportedFlexibleServerEditions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List supportedServerVersions() { - List inner = this.innerModel().supportedServerVersions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public CapabilityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java index b175f018d2587..a8426abeb5a38 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java @@ -101,10 +101,9 @@ private Mono> executeWithResponseAsync(String lo } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, nameAvailabilityRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -141,11 +140,10 @@ private Mono> executeWithResponseAsync(String lo } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, - nameAvailabilityRequest, accept, context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, nameAvailabilityRequest, accept, context); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java index 3bcaab571016b..abf77aa3d9ca3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java @@ -98,10 +98,9 @@ Mono> execute(@HostParam("$host") String endpoin } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), nameAvailabilityRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -134,10 +133,9 @@ Mono> execute(@HostParam("$host") String endpoin } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), nameAvailabilityRequest, accept, context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java index 3f3a94f7ca4a0..a29199c633626 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java @@ -100,10 +100,9 @@ private Mono> executeWithResponse } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -139,11 +138,10 @@ private Mono> executeWithResponse } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, - parameters, accept, context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, parameters, accept, context); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java index 787d8f9e07147..fb3b8b3776a35 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; import com.azure.core.management.SystemData; -import com.azure.core.util.Context; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; @@ -13,11 +12,17 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig; import com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly; -public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update { +public final class ConfigurationImpl implements Configuration { private ConfigurationInner innerObject; private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + ConfigurationImpl(ConfigurationInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + public String id() { return this.innerModel().id(); } @@ -38,18 +43,10 @@ public String value() { return this.innerModel().value(); } - public String currentValue() { - return this.innerModel().currentValue(); - } - public String description() { return this.innerModel().description(); } - public String documentationLink() { - return this.innerModel().documentationLink(); - } - public String defaultValue() { return this.innerModel().defaultValue(); } @@ -78,10 +75,6 @@ public IsDynamicConfig isDynamicConfig() { return this.innerModel().isDynamicConfig(); } - public String resourceGroupName() { - return resourceGroupName; - } - public ConfigurationInner innerModel() { return this.innerObject; } @@ -89,94 +82,4 @@ public ConfigurationInner innerModel() { private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } - - private String resourceGroupName; - - private String serverName; - - private String configurationName; - - public ConfigurationImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public Configuration create() { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); - return this; - } - - public Configuration create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), context); - return this; - } - - ConfigurationImpl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new ConfigurationInner(); - this.serviceManager = serviceManager; - this.configurationName = name; - } - - public ConfigurationImpl update() { - return this; - } - - public Configuration apply() { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .update(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); - return this; - } - - public Configuration apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .update(resourceGroupName, serverName, configurationName, this.innerModel(), context); - return this; - } - - ConfigurationImpl(ConfigurationInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.configurationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurations"); - } - - public Configuration refresh() { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE) - .getValue(); - return this; - } - - public Configuration refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .getWithResponse(resourceGroupName, serverName, configurationName, context) - .getValue(); - return this; - } - - public ConfigurationImpl withValue(String value) { - this.innerModel().withValue(value); - return this; - } - - public ConfigurationImpl withCurrentValue(String currentValue) { - this.innerModel().withCurrentValue(currentValue); - return this; - } - - public ConfigurationImpl withSource(ConfigurationSource source) { - this.innerModel().withSource(source); - return this; - } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java index 9ee5d2dda5ee8..03a5ceba6549f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java @@ -14,7 +14,6 @@ import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -72,17 +71,6 @@ public final class ConfigurationsClientImpl implements ConfigurationsClient { @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") public interface ConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("configurationName") String configurationName, - @BodyParam("application/json") ConfigurationInner parameters, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") @ExpectedResponses({ 200, 202 }) @@ -121,8 +109,7 @@ Mono>> batchUpdate(@HostParam("$host") String endpoint Mono> listByServer(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @QueryParam("tags") String tags, @QueryParam("keyword") String keyword, @QueryParam("page") Integer page, - @QueryParam("pageSize") Integer pageSize, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -133,261 +120,6 @@ Mono> listByServerNext( @HeaderParam("Accept") String accept, Context context); } - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner 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 (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner 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 (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, parameters, accept, context); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ConfigurationInner.class, ConfigurationInner.class, this.client.getContext()); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ConfigurationInner.class, ConfigurationInner.class, context); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters) - .getSyncPoller(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - String configurationName, ConfigurationInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - String configurationName, ConfigurationInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).block(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); - } - /** * Updates a configuration of a server. * @@ -427,12 +159,11 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, parameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -476,11 +207,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, configurationName, parameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, configurationName, parameters, accept, context); } /** @@ -675,11 +405,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -718,11 +447,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, configurationName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, configurationName, accept, context); } /** @@ -810,10 +538,9 @@ private Mono>> batchUpdateWithResponseAsync(String res } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.batchUpdate(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -853,11 +580,10 @@ private Mono>> batchUpdateWithResponseAsync(String res } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.batchUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); + return service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); } /** @@ -1015,10 +741,6 @@ public ConfigurationListResultInner batchUpdate(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1027,7 +749,7 @@ public ConfigurationListResultInner batchUpdate(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, String tags, String keyword, Integer page, Integer pageSize) { + String serverName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1043,12 +765,10 @@ private Mono> listByServerSinglePageAsync(Stri if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, tags, keyword, page, pageSize, accept, context)) + .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())); @@ -1059,10 +779,6 @@ private Mono> listByServerSinglePageAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1072,7 +788,7 @@ private Mono> listByServerSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, String tags, String keyword, Integer page, Integer pageSize, Context context) { + String serverName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1088,38 +804,15 @@ private Mono> listByServerSinglePageAsync(Stri if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, tags, keyword, page, pageSize, accept, context) + .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 configurations 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 tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - /** * List all the configurations in a given server. * @@ -1132,12 +825,7 @@ private PagedFlux listByServerAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - final String tags = null; - final String keyword = null; - final Integer page = null; - final Integer pageSize = null; - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize), + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), nextLink -> listByServerNextSinglePageAsync(nextLink)); } @@ -1146,10 +834,6 @@ private PagedFlux listByServerAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1157,10 +841,9 @@ private PagedFlux listByServerAsync(String resourceGroupName * @return a list of server configurations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize, context), + private PagedFlux listByServerAsync(String resourceGroupName, String serverName, + Context context) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), nextLink -> listByServerNextSinglePageAsync(nextLink, context)); } @@ -1176,11 +859,7 @@ private PagedFlux listByServerAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { - final String tags = null; - final String keyword = null; - final Integer page = null; - final Integer pageSize = null; - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, tags, keyword, page, pageSize)); + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); } /** @@ -1188,10 +867,6 @@ public PagedIterable listByServer(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1199,10 +874,9 @@ public PagedIterable listByServer(String resourceGroupName, * @return a list of server configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context) { - return new PagedIterable<>( - listByServerAsync(resourceGroupName, serverName, tags, keyword, page, pageSize, context)); + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java index ba67ccfaed888..95d286bf23eed 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java @@ -30,6 +30,28 @@ public ConfigurationsImpl(ConfigurationsClient innerClient, this.serviceManager = serviceManager; } + public Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters) { + ConfigurationInner inner + = this.serviceClient().update(resourceGroupName, serverName, configurationName, parameters); + if (inner != null) { + return new ConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context) { + ConfigurationInner inner + = this.serviceClient().update(resourceGroupName, serverName, configurationName, parameters, context); + if (inner != null) { + return new ConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + public Response getWithResponse(String resourceGroupName, String serverName, String configurationName, Context context) { Response inner @@ -78,51 +100,12 @@ public PagedIterable listByServer(String resourceGroupName, Strin return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); } - public PagedIterable listByServer(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context) { + public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName, tags, keyword, page, pageSize, context); + = this.serviceClient().listByServer(resourceGroupName, serverName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); } - public Configuration getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "configurations"); - if (configurationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "configurations"); - if (configurationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, configurationName, context); - } - private ConfigurationsClient serviceClient() { return this.innerClient; } @@ -130,8 +113,4 @@ private ConfigurationsClient serviceClient() { private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } - - public ConfigurationImpl define(String name) { - return new ConfigurationImpl(name, this.manager()); - } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java index 7059393931d5e..a386d6d810e7f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java @@ -154,10 +154,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, context)) + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -200,11 +201,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, databaseName, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, context); } /** @@ -397,10 +397,9 @@ private Mono>> deleteWithResponseAsync(String resource if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -438,11 +437,10 @@ private Mono>> deleteWithResponseAsync(String resource if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, databaseName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, databaseName, accept, context); } /** @@ -619,11 +617,10 @@ private Mono> getWithResponseAsync(String resourceGroupN if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, databaseName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -660,11 +657,10 @@ private Mono> getWithResponseAsync(String resourceGroupN if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, databaseName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, databaseName, accept, context); } /** @@ -746,10 +742,9 @@ private Mono> listByServerSinglePageAsync(String re if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .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)) @@ -785,12 +780,11 @@ private Mono> listByServerSinglePageAsync(String re if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .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)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java index 27aab06e0327b..3316f56e000f2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java @@ -158,10 +158,9 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -207,11 +206,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, firewallRuleName, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, parameters, accept, + context); } /** @@ -407,10 +406,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -449,11 +447,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, firewallRuleName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, firewallRuleName, accept, context); } /** @@ -634,11 +631,10 @@ private Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, firewallRuleName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -677,11 +673,10 @@ private Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, firewallRuleName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, firewallRuleName, accept, context); } /** @@ -763,10 +758,9 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .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)) @@ -802,12 +796,11 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .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)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java index b2e05216b8c7b..7f48312bd655a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java @@ -78,9 +78,10 @@ private Mono> executeWithResponse return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -100,10 +101,9 @@ private Mono> executeWithResponse return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, accept, context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java deleted file mode 100644 index cfdb0c3a4eea5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.implementation; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; - -public final class HighAvailabilityValidationEstimationImpl implements HighAvailabilityValidationEstimation { - private HighAvailabilityValidationEstimationInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - HighAvailabilityValidationEstimationImpl(HighAvailabilityValidationEstimationInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Integer estimatedDowntime() { - return this.innerModel().estimatedDowntime(); - } - - public String scheduledStandbyAvailabilityZone() { - return this.innerModel().scheduledStandbyAvailabilityZone(); - } - - public String expectedStandbyAvailabilityZone() { - return this.innerModel().expectedStandbyAvailabilityZone(); - } - - public HighAvailabilityValidationEstimationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java index 910ede01abfd5..eea36cc4a3319 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java @@ -101,11 +101,10 @@ private Mono> listSinglePageAsync(Strin if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - locationName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, 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())); @@ -135,11 +134,11 @@ private Mono> listSinglePageAsync(Strin if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java deleted file mode 100644 index 27a4969d005fd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java +++ /dev/null @@ -1,386 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitySetsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. - */ -public final class LocationBasedCapabilitySetsClientImpl implements LocationBasedCapabilitySetsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LocationBasedCapabilitySetsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LocationBasedCapabilitySetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationBasedCapabilitySetsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LocationBasedCapabilitySetsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLocationBasedCapabilitySets to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LocationBasedCapabilitySetsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @PathParam("capabilitySetName") String capabilitySetName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - locationName, 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 capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName) { - return new PagedIterable<>(listAsync(locationName)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, Context context) { - return new PagedIterable<>(listAsync(locationName, context)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String capabilitySetName) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (capabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilitySetName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - locationName, capabilitySetName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String capabilitySetName, - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (capabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilitySetName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, - capabilitySetName, accept, context); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String capabilitySetName) { - return getWithResponseAsync(locationName, capabilitySetName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String capabilitySetName, Context context) { - return getWithResponseAsync(locationName, capabilitySetName, context).block(); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 at specified location in a given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityInner get(String locationName, String capabilitySetName) { - return getWithResponse(locationName, capabilitySetName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability set along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability set along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java deleted file mode 100644 index 9d1560ca158a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java +++ /dev/null @@ -1,67 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; - -public final class LocationBasedCapabilitySetsImpl implements LocationBasedCapabilitySets { - private static final ClientLogger LOGGER = new ClientLogger(LocationBasedCapabilitySetsImpl.class); - - private final LocationBasedCapabilitySetsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LocationBasedCapabilitySetsImpl(LocationBasedCapabilitySetsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String locationName) { - PagedIterable inner = this.serviceClient().list(locationName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); - } - - public PagedIterable list(String locationName, Context context) { - PagedIterable inner = this.serviceClient().list(locationName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); - } - - public Response getWithResponse(String locationName, String capabilitySetName, Context context) { - Response inner - = this.serviceClient().getWithResponse(locationName, capabilitySetName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CapabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Capability get(String locationName, String capabilitySetName) { - CapabilityInner inner = this.serviceClient().get(locationName, capabilitySetName); - if (inner != null) { - return new CapabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - private LocationBasedCapabilitySetsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java deleted file mode 100644 index e0b9fc6ffa020..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java +++ /dev/null @@ -1,65 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import java.time.OffsetDateTime; - -public final class LogFileImpl implements LogFile { - private LogFileInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - LogFileImpl(LogFileInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 sizeInKB() { - return this.innerModel().sizeInKB(); - } - - public OffsetDateTime createdTime() { - return this.innerModel().createdTime(); - } - - public String typePropertiesType() { - return this.innerModel().typePropertiesType(); - } - - public OffsetDateTime lastModifiedTime() { - return this.innerModel().lastModifiedTime(); - } - - public String url() { - return this.innerModel().url(); - } - - public LogFileInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java deleted file mode 100644 index 36c182eab4cd8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java +++ /dev/null @@ -1,273 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LogFilesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.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 MySqlManagementClientImpl client; - - /** - * Initializes an instance of LogFilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LogFilesClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LogFilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLogFiles to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LogFilesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/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 apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, - 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 apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), apiVersion, 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) - private 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java deleted file mode 100644 index f102763920eee..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java +++ /dev/null @@ -1,45 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LogFilesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import com.azure.resourcemanager.mysqlflexibleserver.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.mysqlflexibleserver.MySqlManager serviceManager; - - public LogFilesImpl(LogFilesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - private LogFilesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java deleted file mode 100644 index 4ce1c25cb42f1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java +++ /dev/null @@ -1,360 +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.mysqlflexibleserver.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.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.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.mysqlflexibleserver.fluent.LongRunningBackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -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 LongRunningBackupsClient. - */ -public final class LongRunningBackupsClientImpl implements LongRunningBackupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LongRunningBackupsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LongRunningBackupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LongRunningBackupsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LongRunningBackupsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLongRunningBackups to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LongRunningBackupsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@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, @BodyParam("application/json") ServerBackupV2Inner parameters, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - String backupName, ServerBackupV2Inner 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 (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - String backupName, ServerBackupV2Inner 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 (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, parameters, accept, context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 {@link PollerFlux} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerBackupV2Inner.class, ServerBackupV2Inner.class, this.client.getContext()); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 {@link PollerFlux} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, - String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerBackupV2Inner.class, ServerBackupV2Inner.class, this.client.getContext()); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 {@link PollerFlux} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerBackupV2Inner.class, ServerBackupV2Inner.class, context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - return this.beginCreateAsync(resourceGroupName, serverName, backupName, parameters).getSyncPoller(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, serverName, backupName, parameters, context).getSyncPoller(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters) { - return beginCreateAsync(resourceGroupName, serverName, backupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - return beginCreateAsync(resourceGroupName, serverName, backupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters, Context context) { - return beginCreateAsync(resourceGroupName, serverName, backupName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - return createAsync(resourceGroupName, serverName, backupName, parameters).block(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @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 parameters The required parameters for creating and exporting backup of the given 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 server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters, Context context) { - return createAsync(resourceGroupName, serverName, backupName, parameters, context).block(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java deleted file mode 100644 index 9d8ca1a3b55eb..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java +++ /dev/null @@ -1,35 +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.mysqlflexibleserver.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackups; - -public final class LongRunningBackupsImpl implements LongRunningBackups { - private static final ClientLogger LOGGER = new ClientLogger(LongRunningBackupsImpl.class); - - private final LongRunningBackupsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LongRunningBackupsImpl(LongRunningBackupsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - private LongRunningBackupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public ServerBackupV2Impl define(String name) { - return new ServerBackupV2Impl(name, this.manager()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsClientImpl.java deleted file mode 100644 index 61b1b4486c772..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsClientImpl.java +++ /dev/null @@ -1,413 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LongRunningBackupsOperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2ListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LongRunningBackupsOperationsClient. - */ -public final class LongRunningBackupsOperationsClientImpl implements LongRunningBackupsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LongRunningBackupsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LongRunningBackupsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LongRunningBackupsOperationsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LongRunningBackupsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLongRunningBackupsOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LongRunningBackupsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{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.DBforMySQL/flexibleServers/{serverName}/backupsV2") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get backup for a given 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 backup for a given server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private 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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get backup for a given 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 backup for a given 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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, accept, context); - } - - /** - * Get backup for a given 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 backup for a given server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String backupName) { - return getWithResponseAsync(resourceGroupName, serverName, backupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get backup for a given 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 backup for a given 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(); - } - - /** - * Get backup for a given 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 backup for a given server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupV2Inner get(String resourceGroupName, String serverName, String backupName) { - return getWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); - } - - /** - * List all the backups for 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 server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 backups for 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 server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, 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 backups for 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 server backups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the backups for 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 server backups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the backups for 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 server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * List all the backups for 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 server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsImpl.java deleted file mode 100644 index 11b02bcb2f9d3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsImpl.java +++ /dev/null @@ -1,68 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LongRunningBackupsOperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackupsOperations; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; - -public final class LongRunningBackupsOperationsImpl implements LongRunningBackupsOperations { - private static final ClientLogger LOGGER = new ClientLogger(LongRunningBackupsOperationsImpl.class); - - private final LongRunningBackupsOperationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LongRunningBackupsOperationsImpl(LongRunningBackupsOperationsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 ServerBackupV2Impl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerBackupV2 get(String resourceGroupName, String serverName, String backupName) { - ServerBackupV2Inner inner = this.serviceClient().get(resourceGroupName, serverName, backupName); - if (inner != null) { - return new ServerBackupV2Impl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupV2Impl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupV2Impl(inner1, this.manager())); - } - - private LongRunningBackupsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java deleted file mode 100644 index 0a925ebbd3b20..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; -import java.time.OffsetDateTime; - -public final class MaintenanceImpl implements Maintenance { - private MaintenanceInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - MaintenanceImpl(MaintenanceInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 MaintenanceType maintenanceType() { - return this.innerModel().maintenanceType(); - } - - public MaintenanceState maintenanceState() { - return this.innerModel().maintenanceState(); - } - - public OffsetDateTime maintenanceStartTime() { - return this.innerModel().maintenanceStartTime(); - } - - public OffsetDateTime maintenanceEndTime() { - return this.innerModel().maintenanceEndTime(); - } - - public OffsetDateTime maintenanceExecutionStartTime() { - return this.innerModel().maintenanceExecutionStartTime(); - } - - public OffsetDateTime maintenanceExecutionEndTime() { - return this.innerModel().maintenanceExecutionEndTime(); - } - - public OffsetDateTime maintenanceAvailableScheduleMinTime() { - return this.innerModel().maintenanceAvailableScheduleMinTime(); - } - - public OffsetDateTime maintenanceAvailableScheduleMaxTime() { - return this.innerModel().maintenanceAvailableScheduleMaxTime(); - } - - public String maintenanceTitle() { - return this.innerModel().maintenanceTitle(); - } - - public String maintenanceDescription() { - return this.innerModel().maintenanceDescription(); - } - - public MaintenanceProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public MaintenanceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java deleted file mode 100644 index d3b8bc2c917d9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java +++ /dev/null @@ -1,721 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -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 MaintenancesClient. - */ -public final class MaintenancesClientImpl implements MaintenancesClient { - /** - * The proxy service used to perform REST calls. - */ - private final MaintenancesService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of MaintenancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MaintenancesClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(MaintenancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientMaintenances to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface MaintenancesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> read(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("maintenanceName") String maintenanceName, - @BodyParam("application/json") MaintenanceUpdate parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> readWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName) { - 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 (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.read(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, maintenanceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> readWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName, 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 (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.read(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, maintenanceName, accept, context); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono readAsync(String resourceGroupName, String serverName, String maintenanceName) { - return readWithResponseAsync(resourceGroupName, serverName, maintenanceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response readWithResponse(String resourceGroupName, String serverName, - String maintenanceName, Context context) { - return readWithResponseAsync(resourceGroupName, serverName, maintenanceName, context).block(); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceInner read(String resourceGroupName, String serverName, String maintenanceName) { - return readWithResponse(resourceGroupName, serverName, maintenanceName, Context.NONE).getValue(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName, MaintenanceUpdate 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 (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, maintenanceName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName, MaintenanceUpdate 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 (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, maintenanceName, parameters, accept, context); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 {@link PollerFlux} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, - String serverName, String maintenanceName, MaintenanceUpdate parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - MaintenanceInner.class, MaintenanceInner.class, this.client.getContext()); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, - String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - MaintenanceInner.class, MaintenanceInner.class, this.client.getContext()); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 {@link PollerFlux} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, - String serverName, String maintenanceName, MaintenanceUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - MaintenanceInner.class, MaintenanceInner.class, context); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, - String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - return this.beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).getSyncPoller(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, - String serverName, String maintenanceName, MaintenanceUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters, context) - .getSyncPoller(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters) { - return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - return updateAsync(resourceGroupName, serverName, maintenanceName, parameters).block(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context) { - return updateAsync(resourceGroupName, serverName, maintenanceName, parameters, context).block(); - } - - /** - * List maintenances. - * - * @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 maintenances along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 maintenances. - * - * @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 maintenances along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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 apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, 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 maintenances. - * - * @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 maintenances as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List maintenances. - * - * @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 maintenances as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List maintenances. - * - * @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 maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * List maintenances. - * - * @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 maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of maintenances along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of maintenances along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java deleted file mode 100644 index b37e390b02fe1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java +++ /dev/null @@ -1,89 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.MaintenancesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenances; - -public final class MaintenancesImpl implements Maintenances { - private static final ClientLogger LOGGER = new ClientLogger(MaintenancesImpl.class); - - private final MaintenancesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public MaintenancesImpl(MaintenancesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, - Context context) { - Response inner - = this.serviceClient().readWithResponse(resourceGroupName, serverName, maintenanceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MaintenanceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Maintenance read(String resourceGroupName, String serverName, String maintenanceName) { - MaintenanceInner inner = this.serviceClient().read(resourceGroupName, serverName, maintenanceName); - if (inner != null) { - return new MaintenanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Maintenance update(String resourceGroupName, String serverName, String maintenanceName) { - MaintenanceInner inner = this.serviceClient().update(resourceGroupName, serverName, maintenanceName); - if (inner != null) { - return new MaintenanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Maintenance update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context) { - MaintenanceInner inner - = this.serviceClient().update(resourceGroupName, serverName, maintenanceName, parameters, context); - if (inner != null) { - return new MaintenanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); - } - - private MaintenancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java index ddfb0fbdc088d..b9b230a8ac638 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { MySqlManagementClientImpl.class }) public final class MySqlManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the MySqlManagementClientBuilder. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java index bb2dc176c9377..b02b285661f5e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java @@ -23,9 +23,6 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient; @@ -35,18 +32,10 @@ import com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsOperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -62,12 +51,12 @@ @ServiceClient(builder = MySqlManagementClientBuilder.class) public final class MySqlManagementClientImpl implements MySqlManagementClient { /** - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -89,6 +78,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -131,118 +134,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** - * The AzureADAdministratorsClient object to access its operations. - */ - private final AzureADAdministratorsClient azureADAdministrators; - - /** - * Gets the AzureADAdministratorsClient object to access its operations. - * - * @return the AzureADAdministratorsClient object. - */ - public AzureADAdministratorsClient getAzureADAdministrators() { - return this.azureADAdministrators; - } - - /** - * The BackupsClient object to access its operations. - */ - private final BackupsClient backups; - - /** - * Gets the BackupsClient object to access its operations. - * - * @return the BackupsClient object. - */ - public BackupsClient getBackups() { - return this.backups; - } - - /** - * The BackupAndExportsClient object to access its operations. - */ - private final BackupAndExportsClient backupAndExports; - - /** - * Gets the BackupAndExportsClient object to access its operations. - * - * @return the BackupAndExportsClient object. - */ - public BackupAndExportsClient getBackupAndExports() { - return this.backupAndExports; - } - - /** - * The LongRunningBackupsClient object to access its operations. - */ - private final LongRunningBackupsClient longRunningBackups; - - /** - * Gets the LongRunningBackupsClient object to access its operations. - * - * @return the LongRunningBackupsClient object. - */ - public LongRunningBackupsClient getLongRunningBackups() { - return this.longRunningBackups; - } - - /** - * The LongRunningBackupsOperationsClient object to access its operations. - */ - private final LongRunningBackupsOperationsClient longRunningBackupsOperations; - - /** - * Gets the LongRunningBackupsOperationsClient object to access its operations. - * - * @return the LongRunningBackupsOperationsClient object. - */ - public LongRunningBackupsOperationsClient getLongRunningBackupsOperations() { - return this.longRunningBackupsOperations; - } - - /** - * The ConfigurationsClient object to access its operations. - */ - private final ConfigurationsClient configurations; - - /** - * Gets the ConfigurationsClient object to access its operations. - * - * @return the ConfigurationsClient object. - */ - public ConfigurationsClient getConfigurations() { - return this.configurations; - } - - /** - * The DatabasesClient object to access its operations. - */ - private final DatabasesClient databases; - - /** - * Gets the DatabasesClient object to access its operations. - * - * @return the DatabasesClient object. - */ - public DatabasesClient getDatabases() { - return this.databases; - } - - /** - * The FirewallRulesClient object to access its operations. - */ - private final FirewallRulesClient firewallRules; - - /** - * Gets the FirewallRulesClient object to access its operations. - * - * @return the FirewallRulesClient object. - */ - public FirewallRulesClient getFirewallRules() { - return this.firewallRules; - } - /** * The ServersClient object to access its operations. */ @@ -272,73 +163,73 @@ public ReplicasClient getReplicas() { } /** - * The ServersMigrationsClient object to access its operations. + * The BackupsClient object to access its operations. */ - private final ServersMigrationsClient serversMigrations; + private final BackupsClient backups; /** - * Gets the ServersMigrationsClient object to access its operations. + * Gets the BackupsClient object to access its operations. * - * @return the ServersMigrationsClient object. + * @return the BackupsClient object. */ - public ServersMigrationsClient getServersMigrations() { - return this.serversMigrations; + public BackupsClient getBackups() { + return this.backups; } /** - * The AdvancedThreatProtectionSettingsClient object to access its operations. + * The FirewallRulesClient object to access its operations. */ - private final AdvancedThreatProtectionSettingsClient advancedThreatProtectionSettings; + private final FirewallRulesClient firewallRules; /** - * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * Gets the FirewallRulesClient object to access its operations. * - * @return the AdvancedThreatProtectionSettingsClient object. + * @return the FirewallRulesClient object. */ - public AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings() { - return this.advancedThreatProtectionSettings; + public FirewallRulesClient getFirewallRules() { + return this.firewallRules; } /** - * The LogFilesClient object to access its operations. + * The DatabasesClient object to access its operations. */ - private final LogFilesClient logFiles; + private final DatabasesClient databases; /** - * Gets the LogFilesClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the LogFilesClient object. + * @return the DatabasesClient object. */ - public LogFilesClient getLogFiles() { - return this.logFiles; + public DatabasesClient getDatabases() { + return this.databases; } /** - * The LocationBasedCapabilitiesClient object to access its operations. + * The ConfigurationsClient object to access its operations. */ - private final LocationBasedCapabilitiesClient locationBasedCapabilities; + private final ConfigurationsClient configurations; /** - * Gets the LocationBasedCapabilitiesClient object to access its operations. + * Gets the ConfigurationsClient object to access its operations. * - * @return the LocationBasedCapabilitiesClient object. + * @return the ConfigurationsClient object. */ - public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { - return this.locationBasedCapabilities; + public ConfigurationsClient getConfigurations() { + return this.configurations; } /** - * The LocationBasedCapabilitySetsClient object to access its operations. + * The LocationBasedCapabilitiesClient object to access its operations. */ - private final LocationBasedCapabilitySetsClient locationBasedCapabilitySets; + private final LocationBasedCapabilitiesClient locationBasedCapabilities; /** - * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * Gets the LocationBasedCapabilitiesClient object to access its operations. * - * @return the LocationBasedCapabilitySetsClient object. + * @return the LocationBasedCapabilitiesClient object. */ - public LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets() { - return this.locationBasedCapabilitySets; + public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { + return this.locationBasedCapabilities; } /** @@ -383,34 +274,6 @@ public CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWitho return this.checkNameAvailabilityWithoutLocations; } - /** - * The OperationResultsClient object to access its operations. - */ - private final OperationResultsClient operationResults; - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - public OperationResultsClient getOperationResults() { - return this.operationResults; - } - - /** - * The OperationProgressClient object to access its operations. - */ - private final OperationProgressClient operationProgress; - - /** - * Gets the OperationProgressClient object to access its operations. - * - * @return the OperationProgressClient object. - */ - public OperationProgressClient getOperationProgress() { - return this.operationProgress; - } - /** * The GetPrivateDnsZoneSuffixesClient object to access its operations. */ @@ -439,20 +302,6 @@ public OperationsClient getOperations() { return this.operations; } - /** - * The MaintenancesClient object to access its operations. - */ - private final MaintenancesClient maintenances; - - /** - * Gets the MaintenancesClient object to access its operations. - * - * @return the MaintenancesClient object. - */ - public MaintenancesClient getMaintenances() { - return this.maintenances; - } - /** * Initializes an instance of MySqlManagementClient client. * @@ -460,7 +309,7 @@ public MaintenancesClient getMaintenances() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ MySqlManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -470,29 +319,19 @@ public MaintenancesClient getMaintenances() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.azureADAdministrators = new AzureADAdministratorsClientImpl(this); - this.backups = new BackupsClientImpl(this); - this.backupAndExports = new BackupAndExportsClientImpl(this); - this.longRunningBackups = new LongRunningBackupsClientImpl(this); - this.longRunningBackupsOperations = new LongRunningBackupsOperationsClientImpl(this); - this.configurations = new ConfigurationsClientImpl(this); - this.databases = new DatabasesClientImpl(this); - this.firewallRules = new FirewallRulesClientImpl(this); + this.apiVersion = "2021-05-01"; this.servers = new ServersClientImpl(this); this.replicas = new ReplicasClientImpl(this); - this.serversMigrations = new ServersMigrationsClientImpl(this); - this.advancedThreatProtectionSettings = new AdvancedThreatProtectionSettingsClientImpl(this); - this.logFiles = new LogFilesClientImpl(this); + this.backups = new BackupsClientImpl(this); + this.firewallRules = new FirewallRulesClientImpl(this); + this.databases = new DatabasesClientImpl(this); + this.configurations = new ConfigurationsClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); - this.locationBasedCapabilitySets = new LocationBasedCapabilitySetsClientImpl(this); this.checkVirtualNetworkSubnetUsages = new CheckVirtualNetworkSubnetUsagesClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); this.checkNameAvailabilityWithoutLocations = new CheckNameAvailabilityWithoutLocationsClientImpl(this); - this.operationResults = new OperationResultsClientImpl(this); - this.operationProgress = new OperationProgressClientImpl(this); this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); this.operations = new OperationsClientImpl(this); - this.maintenances = new MaintenancesClientImpl(this); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java deleted file mode 100644 index 734b1b53f5339..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java +++ /dev/null @@ -1,187 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationProgressClient. - */ -public final class OperationProgressClientImpl implements OperationProgressClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationProgressService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of OperationProgressClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationProgressClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(OperationProgressService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientOperationProgress to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface OperationProgressService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationProgress/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String operationId) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, - locationName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async 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 operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String operationId, - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, locationName, - operationId, accept, context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String operationId) { - return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async 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 operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String operationId, - Context context) { - return getWithResponseAsync(locationName, operationId, context).block(); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationProgressResultInner get(String locationName, String operationId) { - return getWithResponse(locationName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java deleted file mode 100644 index c1a98930348a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java +++ /dev/null @@ -1,56 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.OperationProgressClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgress; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResult; - -public final class OperationProgressImpl implements OperationProgress { - private static final ClientLogger LOGGER = new ClientLogger(OperationProgressImpl.class); - - private final OperationProgressClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public OperationProgressImpl(OperationProgressClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String locationName, String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(locationName, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationProgressResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationProgressResult get(String locationName, String operationId) { - OperationProgressResultInner inner = this.serviceClient().get(locationName, operationId); - if (inner != null) { - return new OperationProgressResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private OperationProgressClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java deleted file mode 100644 index 3b1dd848a679e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java +++ /dev/null @@ -1,79 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class OperationProgressResultImpl implements OperationProgressResult { - private OperationProgressResultInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - OperationProgressResultImpl(OperationProgressResultInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String resourceId() { - return this.innerModel().resourceId(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public Float percentComplete() { - return this.innerModel().percentComplete(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public OperationProgressResponseType properties() { - return this.innerModel().properties(); - } - - public OperationProgressResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java deleted file mode 100644 index e33b9a0b3cd2f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java +++ /dev/null @@ -1,188 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationResultsClient. - */ -public final class OperationResultsClientImpl implements OperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of OperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationResultsClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientOperationResults to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface OperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, - String operationId) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, - locationName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, - String operationId, 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, locationName, - operationId, accept, context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String operationId) { - return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String operationId, - Context context) { - return getWithResponseAsync(locationName, operationId, context).block(); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusExtendedResultInner get(String locationName, String operationId) { - return getWithResponse(locationName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java deleted file mode 100644 index 24864ffbdf717..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java +++ /dev/null @@ -1,57 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.OperationResultsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; - -public final class OperationResultsImpl implements OperationResults { - private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); - - private final OperationResultsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public OperationResultsImpl(OperationResultsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String locationName, String operationId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(locationName, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusExtendedResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationStatusExtendedResult get(String locationName, String operationId) { - OperationStatusExtendedResultInner inner = this.serviceClient().get(locationName, operationId); - if (inner != null) { - return new OperationStatusExtendedResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private OperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java deleted file mode 100644 index 04f5f577984bd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java +++ /dev/null @@ -1,84 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class OperationStatusExtendedResultImpl implements OperationStatusExtendedResult { - private OperationStatusExtendedResultInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - OperationStatusExtendedResultImpl(OperationStatusExtendedResultInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String resourceId() { - return this.innerModel().resourceId(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public Float percentComplete() { - return this.innerModel().percentComplete(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public Map properties() { - Map inner = this.innerModel().properties(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public OperationStatusExtendedResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java index dc6c989cea754..75f050fdcb9f9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java @@ -91,9 +91,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -115,10 +116,9 @@ private Mono> listSinglePageAsync(Context context) return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java index 1f56b4c468d8e..ec468bda9bbed 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java @@ -106,10 +106,9 @@ private Mono> listByServerSinglePageAsync(String reso if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .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)) @@ -145,12 +144,11 @@ private Mono> listByServerSinglePageAsync(String reso if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .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)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java deleted file mode 100644 index 47c3ca6d0404c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java +++ /dev/null @@ -1,121 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.time.OffsetDateTime; - -public final class ServerBackupV2Impl implements ServerBackupV2, ServerBackupV2.Definition { - private ServerBackupV2Inner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - ServerBackupV2Impl(ServerBackupV2Inner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String backupNameV2() { - return this.innerModel().backupNameV2(); - } - - public BackupType backupType() { - return this.innerModel().backupType(); - } - - public OffsetDateTime completedTime() { - return this.innerModel().completedTime(); - } - - public String source() { - return this.innerModel().source(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ServerBackupV2Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private String backupName; - - public ServerBackupV2Impl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public ServerBackupV2 create() { - this.innerObject = serviceManager.serviceClient() - .getLongRunningBackups() - .create(resourceGroupName, serverName, backupName, this.innerModel(), Context.NONE); - return this; - } - - public ServerBackupV2 create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getLongRunningBackups() - .create(resourceGroupName, serverName, backupName, this.innerModel(), context); - return this; - } - - ServerBackupV2Impl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new ServerBackupV2Inner(); - this.serviceManager = serviceManager; - this.backupName = name; - } - - public ServerBackupV2Impl withBackupNameV2(String backupNameV2) { - this.innerModel().withBackupNameV2(backupNameV2); - return this; - } - - public ServerBackupV2Impl withBackupType(BackupType backupType) { - this.innerModel().withBackupType(backupType); - return this; - } - - public ServerBackupV2Impl withCompletedTime(OffsetDateTime completedTime) { - this.innerModel().withCompletedTime(completedTime); - return this; - } - - public ServerBackupV2Impl withSource(String source) { - this.innerModel().withSource(source); - return this; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java index 601ad76ad9063..ca044f5d8bf52 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java @@ -4,34 +4,27 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; -import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Backup; import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.time.OffsetDateTime; import java.util.Collections; -import java.util.List; import java.util.Map; public final class ServerImpl implements Server, Server.Definition, Server.Update { @@ -64,11 +57,11 @@ public Map tags() { } } - public MySqlServerIdentity identity() { + public Identity identity() { return this.innerModel().identity(); } - public MySqlServerSku sku() { + public Sku sku() { return this.innerModel().sku(); } @@ -140,23 +133,10 @@ public Network network() { return this.innerModel().network(); } - public List privateEndpointConnections() { - List inner = this.innerModel().privateEndpointConnections(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - public MaintenanceWindow maintenanceWindow() { return this.innerModel().maintenanceWindow(); } - public ImportSourceProperties importSourceProperties() { - return this.innerModel().importSourceProperties(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -258,17 +238,6 @@ public void failover(Context context) { serviceManager.servers().failover(resourceGroupName, serverName, context); } - public Response validateEstimateHighAvailabilityWithResponse( - HighAvailabilityValidationEstimationInner parameters, Context context) { - return serviceManager.servers() - .validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, context); - } - - public HighAvailabilityValidationEstimation - validateEstimateHighAvailability(HighAvailabilityValidationEstimationInner parameters) { - return serviceManager.servers().validateEstimateHighAvailability(resourceGroupName, serverName, parameters); - } - public void restart(ServerRestartParameter parameters) { serviceManager.servers().restart(resourceGroupName, serverName, parameters); } @@ -293,14 +262,6 @@ public void stop(Context context) { serviceManager.servers().stop(resourceGroupName, serverName, context); } - public void resetGtid(ServerGtidSetParameter parameters) { - serviceManager.servers().resetGtid(resourceGroupName, serverName, parameters); - } - - public void resetGtid(ServerGtidSetParameter parameters, Context context) { - serviceManager.servers().resetGtid(resourceGroupName, serverName, parameters, context); - } - public ServerImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -321,7 +282,7 @@ public ServerImpl withTags(Map tags) { } } - public ServerImpl withIdentity(MySqlServerIdentity identity) { + public ServerImpl withIdentity(Identity identity) { if (isInCreateMode()) { this.innerModel().withIdentity(identity); return this; @@ -331,7 +292,7 @@ public ServerImpl withIdentity(MySqlServerIdentity identity) { } } - public ServerImpl withSku(MySqlServerSku sku) { + public ServerImpl withSku(Sku sku) { if (isInCreateMode()) { this.innerModel().withSku(sku); return this; @@ -357,13 +318,8 @@ public ServerImpl withAdministratorLoginPassword(String administratorLoginPasswo } public ServerImpl withVersion(ServerVersion version) { - if (isInCreateMode()) { - this.innerModel().withVersion(version); - return this; - } else { - this.updateParameters.withVersion(version); - return this; - } + this.innerModel().withVersion(version); + return this; } public ServerImpl withAvailabilityZone(String availabilityZone) { @@ -437,17 +393,7 @@ public ServerImpl withHighAvailability(HighAvailability highAvailability) { } public ServerImpl withNetwork(Network network) { - if (isInCreateMode()) { - this.innerModel().withNetwork(network); - return this; - } else { - this.updateParameters.withNetwork(network); - return this; - } - } - - public ServerImpl withImportSourceProperties(ImportSourceProperties importSourceProperties) { - this.innerModel().withImportSourceProperties(importSourceProperties); + this.innerModel().withNetwork(network); return this; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java index 90f4c558bc584..885a4c053a4b1 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java @@ -34,10 +34,8 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerListResult; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import java.nio.ByteBuffer; @@ -139,17 +137,6 @@ Mono>> failover(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateEstimateHighAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateEstimateHighAvailability( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") HighAvailabilityValidationEstimationInner parameters, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart") @ExpectedResponses({ 200, 202 }) @@ -178,16 +165,6 @@ Mono>> stop(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/resetGtid") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetGtid(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerGtidSetParameter parameters, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -238,10 +215,9 @@ private Mono>> createWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -281,11 +257,10 @@ private Mono>> createWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, parameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, parameters, accept, context); } /** @@ -468,10 +443,9 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -512,11 +486,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, parameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, parameters, accept, context); } /** @@ -700,10 +673,9 @@ private Mono>> deleteWithResponseAsync(String resource if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -737,11 +709,10 @@ private Mono>> deleteWithResponseAsync(String resource if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); } /** @@ -902,10 +873,9 @@ private Mono> getByResourceGroupWithResponseAsync(String r if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -939,11 +909,10 @@ private Mono> getByResourceGroupWithResponseAsync(String r if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); } /** @@ -1017,10 +986,9 @@ private Mono> listByResourceGroupSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1052,12 +1020,11 @@ private Mono> listByResourceGroupSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1139,11 +1106,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1168,10 +1134,11 @@ private Mono> listSinglePageAsync(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1256,10 +1223,9 @@ private Mono>> failoverWithResponseAsync(String resour if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.failover(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1293,10 +1259,9 @@ private Mono>> failoverWithResponseAsync(String resour if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.failover(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + return service.failover(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); } @@ -1430,149 +1395,6 @@ public void failover(String resourceGroupName, String serverName, Context contex failoverAsync(resourceGroupName, serverName, context).block(); } - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateEstimateHighAvailabilityWithResponseAsync( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validateEstimateHighAvailability(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateEstimateHighAvailabilityWithResponseAsync( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validateEstimateHighAvailability(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateEstimateHighAvailabilityAsync( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters) { - return validateEstimateHighAvailabilityWithResponseAsync(resourceGroupName, serverName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context) { - return validateEstimateHighAvailabilityWithResponseAsync(resourceGroupName, serverName, parameters, context) - .block(); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HighAvailabilityValidationEstimationInner validateEstimateHighAvailability(String resourceGroupName, - String serverName, HighAvailabilityValidationEstimationInner parameters) { - return validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, Context.NONE) - .getValue(); - } - /** * Restarts a server. * @@ -1607,10 +1429,9 @@ private Mono>> restartWithResponseAsync(String resourc } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1650,10 +1471,9 @@ private Mono>> restartWithResponseAsync(String resourc } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.restart(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + return service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); } @@ -1828,10 +1648,9 @@ private Mono>> startWithResponseAsync(String resourceG if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1865,11 +1684,10 @@ private Mono>> startWithResponseAsync(String resourceG if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); } /** @@ -2028,11 +1846,10 @@ private Mono>> stopWithResponseAsync(String resourceGr if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2065,11 +1882,10 @@ private Mono>> stopWithResponseAsync(String resourceGr if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.stop(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context); + return service.stop(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); } /** @@ -2201,234 +2017,6 @@ public void stop(String resourceGroupName, String serverName, Context context) { stopAsync(resourceGroupName, serverName, context).block(); } - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetGtidWithResponseAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.resetGtid(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetGtidWithResponseAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.resetGtid(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResetGtidAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters) { - Mono>> mono = resetGtidWithResponseAsync(resourceGroupName, serverName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResetGtidAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = resetGtidWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters) { - return this.beginResetGtidAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context) { - return this.beginResetGtidAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetGtidAsync(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { - return beginResetGtidAsync(resourceGroupName, serverName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetGtidAsync(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, - Context context) { - return beginResetGtidAsync(resourceGroupName, serverName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { - resetGtidAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, - Context context) { - resetGtidAsync(resourceGroupName, serverName, parameters, context).block(); - } - /** * Get the next page of items. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java index 191412501e483..bbfc5770775ab 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java @@ -10,11 +10,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; @@ -88,30 +85,6 @@ public void failover(String resourceGroupName, String serverName, Context contex this.serviceClient().failover(resourceGroupName, serverName, context); } - public Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context) { - Response inner = this.serviceClient() - .validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HighAvailabilityValidationEstimationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public HighAvailabilityValidationEstimation validateEstimateHighAvailability(String resourceGroupName, - String serverName, HighAvailabilityValidationEstimationInner parameters) { - HighAvailabilityValidationEstimationInner inner - = this.serviceClient().validateEstimateHighAvailability(resourceGroupName, serverName, parameters); - if (inner != null) { - return new HighAvailabilityValidationEstimationImpl(inner, this.manager()); - } else { - return null; - } - } - public void restart(String resourceGroupName, String serverName, ServerRestartParameter parameters) { this.serviceClient().restart(resourceGroupName, serverName, parameters); } @@ -137,15 +110,6 @@ public void stop(String resourceGroupName, String serverName, Context context) { this.serviceClient().stop(resourceGroupName, serverName, context); } - public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { - this.serviceClient().resetGtid(resourceGroupName, serverName, parameters); - } - - public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, - Context context) { - this.serviceClient().resetGtid(resourceGroupName, serverName, parameters, context); - } - public Server getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java deleted file mode 100644 index 6d8755649aeaf..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java +++ /dev/null @@ -1,282 +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.mysqlflexibleserver.implementation; - -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.mysqlflexibleserver.fluent.ServersMigrationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -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 ServersMigrationsClient. - */ -public final class ServersMigrationsClientImpl implements ServersMigrationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ServersMigrationsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of ServersMigrationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServersMigrationsClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(ServersMigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientServersMigrations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface ServersMigrationsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cutoverMigration(@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); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cutoverMigrationWithResponseAsync(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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cutoverMigration(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cutoverMigrationWithResponseAsync(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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cutoverMigration(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 {@link PollerFlux} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginCutoverMigrationAsync(String resourceGroupName, - String serverName) { - Mono>> mono = cutoverMigrationWithResponseAsync(resourceGroupName, serverName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerInner.class, ServerInner.class, this.client.getContext()); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 {@link PollerFlux} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginCutoverMigrationAsync(String resourceGroupName, - String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = cutoverMigrationWithResponseAsync(resourceGroupName, serverName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerInner.class, ServerInner.class, context); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, - String serverName) { - return this.beginCutoverMigrationAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, - String serverName, Context context) { - return this.beginCutoverMigrationAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cutoverMigrationAsync(String resourceGroupName, String serverName) { - return beginCutoverMigrationAsync(resourceGroupName, serverName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cutoverMigrationAsync(String resourceGroupName, String serverName, Context context) { - return beginCutoverMigrationAsync(resourceGroupName, serverName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner cutoverMigration(String resourceGroupName, String serverName) { - return cutoverMigrationAsync(resourceGroupName, serverName).block(); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context) { - return cutoverMigrationAsync(resourceGroupName, serverName, context).block(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java deleted file mode 100644 index 448b2b695bde4..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java +++ /dev/null @@ -1,52 +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.mysqlflexibleserver.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Server; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; - -public final class ServersMigrationsImpl implements ServersMigrations { - private static final ClientLogger LOGGER = new ClientLogger(ServersMigrationsImpl.class); - - private final ServersMigrationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public ServersMigrationsImpl(ServersMigrationsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Server cutoverMigration(String resourceGroupName, String serverName) { - ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName); - if (inner != null) { - return new ServerImpl(inner, this.manager()); - } else { - return null; - } - } - - public Server cutoverMigration(String resourceGroupName, String serverName, Context context) { - ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName, context); - if (inner != null) { - return new ServerImpl(inner, this.manager()); - } else { - return null; - } - } - - private ServersMigrationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java deleted file mode 100644 index a197d52ae8ddc..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.implementation; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; - -public final class ValidateBackupResponseImpl implements ValidateBackupResponse { - private ValidateBackupResponseInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - ValidateBackupResponseImpl(ValidateBackupResponseInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Integer numberOfContainers() { - return this.innerModel().numberOfContainers(); - } - - public ValidateBackupResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.java deleted file mode 100644 index b2683fa051f60..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import java.io.IOException; -import java.util.List; - -/** - * A List of azure ad administrators. - */ -@Fluent -public final class AdministratorListResult implements JsonSerializable { - /* - * The list of azure ad administrator of a server - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of AdministratorListResult class. - */ - public AdministratorListResult() { - } - - /** - * Get the value property: The list of azure ad administrator of a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of azure ad administrator of a server. - * - * @param value the value value to set. - * @return the AdministratorListResult object itself. - */ - public AdministratorListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the AdministratorListResult object itself. - */ - public AdministratorListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdministratorListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdministratorListResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdministratorListResult. - */ - public static AdministratorListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdministratorListResult deserializedAdministratorListResult = new AdministratorListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureADAdministratorInner.fromJson(reader1)); - deserializedAdministratorListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAdministratorListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAdministratorListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java deleted file mode 100644 index dc950d24168ed..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AdministratorName. - */ -public final class AdministratorName extends ExpandableStringEnum { - /** - * Static value ActiveDirectory for AdministratorName. - */ - public static final AdministratorName ACTIVE_DIRECTORY = fromString("ActiveDirectory"); - - /** - * Creates a new instance of AdministratorName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdministratorName() { - } - - /** - * Creates or finds a AdministratorName from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdministratorName. - */ - public static AdministratorName fromString(String name) { - return fromString(name, AdministratorName.class); - } - - /** - * Gets known AdministratorName values. - * - * @return known AdministratorName values. - */ - public static Collection values() { - return values(AdministratorName.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java deleted file mode 100644 index 07fd8e249c574..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of the sever administrator. - */ -public final class AdministratorType extends ExpandableStringEnum { - /** - * Static value ActiveDirectory for AdministratorType. - */ - public static final AdministratorType ACTIVE_DIRECTORY = fromString("ActiveDirectory"); - - /** - * Creates a new instance of AdministratorType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdministratorType() { - } - - /** - * Creates or finds a AdministratorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdministratorType. - */ - public static AdministratorType fromString(String name) { - return fromString(name, AdministratorType.class); - } - - /** - * Gets known AdministratorType values. - * - * @return known AdministratorType values. - */ - public static Collection values() { - return values(AdministratorType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java deleted file mode 100644 index f4415f7a71008..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java +++ /dev/null @@ -1,71 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of AdvancedThreatProtection. - */ -public interface AdvancedThreatProtection { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the creationTime property: Specifies the UTC creation time of the policy. - * - * @return the creationTime value. - */ - OffsetDateTime creationTime(); - - /** - * Gets the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - AdvancedThreatProtectionState state(); - - /** - * Gets the provisioningState property: Provisioning state of the Threat Protection. - * - * @return the provisioningState value. - */ - AdvancedThreatProtectionProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner object. - * - * @return the inner object. - */ - AdvancedThreatProtectionInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java deleted file mode 100644 index b106214a27f85..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java +++ /dev/null @@ -1,113 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; -import java.io.IOException; - -/** - * Parameters allowed to update advanced threat protection for a server. - */ -@Fluent -public final class AdvancedThreatProtectionForUpdate implements JsonSerializable { - /* - * Resource update properties. - */ - private AdvancedThreatProtectionUpdateProperties innerProperties; - - /** - * Creates an instance of AdvancedThreatProtectionForUpdate class. - */ - public AdvancedThreatProtectionForUpdate() { - } - - /** - * Get the innerProperties property: Resource update properties. - * - * @return the innerProperties value. - */ - private AdvancedThreatProtectionUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionForUpdate object itself. - */ - public AdvancedThreatProtectionForUpdate withState(AdvancedThreatProtectionState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AdvancedThreatProtectionUpdateProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionForUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionForUpdate if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionForUpdate. - */ - public static AdvancedThreatProtectionForUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionForUpdate deserializedAdvancedThreatProtectionForUpdate - = new AdvancedThreatProtectionForUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedAdvancedThreatProtectionForUpdate.innerProperties - = AdvancedThreatProtectionUpdateProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionForUpdate; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java deleted file mode 100644 index 92cf11d8f4d5b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java +++ /dev/null @@ -1,105 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of the server's Advanced Threat Protection configurations. - */ -@Immutable -public final class AdvancedThreatProtectionListResult implements JsonSerializable { - /* - * Array of results. - */ - private List value; - - /* - * Link to retrieve next page of results. - */ - private String nextLink; - - /** - * Creates an instance of AdvancedThreatProtectionListResult class. - */ - public AdvancedThreatProtectionListResult() { - } - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionListResult if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionListResult. - */ - public static AdvancedThreatProtectionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionListResult deserializedAdvancedThreatProtectionListResult - = new AdvancedThreatProtectionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AdvancedThreatProtectionInner.fromJson(reader1)); - deserializedAdvancedThreatProtectionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAdvancedThreatProtectionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java deleted file mode 100644 index 023d0d7c35fd6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AdvancedThreatProtectionName. - */ -public final class AdvancedThreatProtectionName extends ExpandableStringEnum { - /** - * Static value Default for AdvancedThreatProtectionName. - */ - public static final AdvancedThreatProtectionName DEFAULT = fromString("Default"); - - /** - * Creates a new instance of AdvancedThreatProtectionName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdvancedThreatProtectionName() { - } - - /** - * Creates or finds a AdvancedThreatProtectionName from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdvancedThreatProtectionName. - */ - public static AdvancedThreatProtectionName fromString(String name) { - return fromString(name, AdvancedThreatProtectionName.class); - } - - /** - * Gets known AdvancedThreatProtectionName values. - * - * @return known AdvancedThreatProtectionName values. - */ - public static Collection values() { - return values(AdvancedThreatProtectionName.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java deleted file mode 100644 index bbad474bf05fa..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java +++ /dev/null @@ -1,62 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class AdvancedThreatProtectionProvisioningState - extends ExpandableStringEnum { - /** - * Static value Succeeded for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Updating for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState UPDATING = fromString("Updating"); - - /** - * Static value Canceled for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState CANCELED = fromString("Canceled"); - - /** - * Static value Failed for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates a new instance of AdvancedThreatProtectionProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdvancedThreatProtectionProvisioningState() { - } - - /** - * Creates or finds a AdvancedThreatProtectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdvancedThreatProtectionProvisioningState. - */ - public static AdvancedThreatProtectionProvisioningState fromString(String name) { - return fromString(name, AdvancedThreatProtectionProvisioningState.class); - } - - /** - * Gets known AdvancedThreatProtectionProvisioningState values. - * - * @return known AdvancedThreatProtectionProvisioningState values. - */ - public static Collection values() { - return values(AdvancedThreatProtectionProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java deleted file mode 100644 index 638dbf4a1e8c6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java +++ /dev/null @@ -1,133 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; - -/** - * Resource collection API of AdvancedThreatProtectionSettings. - */ -public interface AdvancedThreatProtectionSettings { - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context); - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server's Advanced Threat Protection state. - */ - AdvancedThreatProtection get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server's Advanced Threat Protection. - */ - AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server's Advanced Threat Protection. - */ - AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @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 a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java deleted file mode 100644 index d8d4b6586bf4d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled on the server. - */ -public final class AdvancedThreatProtectionState extends ExpandableStringEnum { - /** - * Static value Enabled for AdvancedThreatProtectionState. - */ - public static final AdvancedThreatProtectionState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for AdvancedThreatProtectionState. - */ - public static final AdvancedThreatProtectionState DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of AdvancedThreatProtectionState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdvancedThreatProtectionState() { - } - - /** - * Creates or finds a AdvancedThreatProtectionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdvancedThreatProtectionState. - */ - public static AdvancedThreatProtectionState fromString(String name) { - return fromString(name, AdvancedThreatProtectionState.class); - } - - /** - * Gets known AdvancedThreatProtectionState values. - * - * @return known AdvancedThreatProtectionState values. - */ - public static Collection values() { - return values(AdvancedThreatProtectionState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java deleted file mode 100644 index 09121a32fbf32..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java +++ /dev/null @@ -1,323 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; - -/** - * An immutable client-side representation of AzureADAdministrator. - */ -public interface AzureADAdministrator { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the administratorType property: Type of the sever administrator. - * - * @return the administratorType value. - */ - AdministratorType administratorType(); - - /** - * Gets the login property: Login name of the server administrator. - * - * @return the login value. - */ - String login(); - - /** - * Gets the sid property: SID (object ID) of the server administrator. - * - * @return the sid value. - */ - String sid(); - - /** - * Gets the tenantId property: Tenant ID of the administrator. - * - * @return the tenantId value. - */ - String tenantId(); - - /** - * Gets the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @return the identityResourceId value. - */ - String identityResourceId(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner object. - * - * @return the inner object. - */ - AzureADAdministratorInner innerModel(); - - /** - * The entirety of the AzureADAdministrator definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureADAdministrator definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureADAdministrator definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); - } - - /** - * The stage of the AzureADAdministrator definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithAdministratorType, DefinitionStages.WithLogin, - DefinitionStages.WithSid, DefinitionStages.WithTenantId, DefinitionStages.WithIdentityResourceId { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureADAdministrator create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureADAdministrator create(Context context); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify administratorType. - */ - interface WithAdministratorType { - /** - * Specifies the administratorType property: Type of the sever administrator.. - * - * @param administratorType Type of the sever administrator. - * @return the next definition stage. - */ - WithCreate withAdministratorType(AdministratorType administratorType); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify login. - */ - interface WithLogin { - /** - * Specifies the login property: Login name of the server administrator.. - * - * @param login Login name of the server administrator. - * @return the next definition stage. - */ - WithCreate withLogin(String login); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify sid. - */ - interface WithSid { - /** - * Specifies the sid property: SID (object ID) of the server administrator.. - * - * @param sid SID (object ID) of the server administrator. - * @return the next definition stage. - */ - WithCreate withSid(String sid); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify tenantId. - */ - interface WithTenantId { - /** - * Specifies the tenantId property: Tenant ID of the administrator.. - * - * @param tenantId Tenant ID of the administrator. - * @return the next definition stage. - */ - WithCreate withTenantId(String tenantId); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify identityResourceId. - */ - interface WithIdentityResourceId { - /** - * Specifies the identityResourceId property: The resource id of the identity used for AAD Authentication.. - * - * @param identityResourceId The resource id of the identity used for AAD Authentication. - * @return the next definition stage. - */ - WithCreate withIdentityResourceId(String identityResourceId); - } - } - - /** - * Begins update for the AzureADAdministrator resource. - * - * @return the stage of resource update. - */ - AzureADAdministrator.Update update(); - - /** - * The template for AzureADAdministrator update. - */ - interface Update extends UpdateStages.WithAdministratorType, UpdateStages.WithLogin, UpdateStages.WithSid, - UpdateStages.WithTenantId, UpdateStages.WithIdentityResourceId { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureADAdministrator apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureADAdministrator apply(Context context); - } - - /** - * The AzureADAdministrator update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureADAdministrator update allowing to specify administratorType. - */ - interface WithAdministratorType { - /** - * Specifies the administratorType property: Type of the sever administrator.. - * - * @param administratorType Type of the sever administrator. - * @return the next definition stage. - */ - Update withAdministratorType(AdministratorType administratorType); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify login. - */ - interface WithLogin { - /** - * Specifies the login property: Login name of the server administrator.. - * - * @param login Login name of the server administrator. - * @return the next definition stage. - */ - Update withLogin(String login); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify sid. - */ - interface WithSid { - /** - * Specifies the sid property: SID (object ID) of the server administrator.. - * - * @param sid SID (object ID) of the server administrator. - * @return the next definition stage. - */ - Update withSid(String sid); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify tenantId. - */ - interface WithTenantId { - /** - * Specifies the tenantId property: Tenant ID of the administrator.. - * - * @param tenantId Tenant ID of the administrator. - * @return the next definition stage. - */ - Update withTenantId(String tenantId); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify identityResourceId. - */ - interface WithIdentityResourceId { - /** - * Specifies the identityResourceId property: The resource id of the identity used for AAD Authentication.. - * - * @param identityResourceId The resource id of the identity used for AAD Authentication. - * @return the next definition stage. - */ - Update withIdentityResourceId(String identityResourceId); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureADAdministrator refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureADAdministrator refresh(Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java deleted file mode 100644 index d4f1d6c81043e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java +++ /dev/null @@ -1,144 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureADAdministrators. - */ -public interface AzureADAdministrators { - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, AdministratorName administratorName); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator. - */ - AzureADAdministrator get(String resourceGroupName, String serverName, AdministratorName administratorName); - - /** - * List all the AAD administrators 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 com.azure.core.management.exception.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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the AAD administrators 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 com.azure.core.management.exception.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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - AzureADAdministrator getById(String id); - - /** - * Gets information about an azure ad administrator. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes an Azure AD Administrator. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an Azure AD Administrator. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureADAdministrator resource. - * - * @param name resource name. - * @return the first stage of the new AzureADAdministrator definition. - */ - AzureADAdministrator.DefinitionStages.Blank define(AdministratorName name); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java index 59689fe7b872c..236dec961dcd4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java @@ -23,11 +23,6 @@ public final class Backup implements JsonSerializable { */ private Integer backupRetentionDays; - /* - * Backup interval hours for the server. - */ - private Integer backupIntervalHours; - /* * Whether or not geo redundant backup is enabled. */ @@ -64,26 +59,6 @@ public Backup withBackupRetentionDays(Integer backupRetentionDays) { return this; } - /** - * Get the backupIntervalHours property: Backup interval hours for the server. - * - * @return the backupIntervalHours value. - */ - public Integer backupIntervalHours() { - return this.backupIntervalHours; - } - - /** - * Set the backupIntervalHours property: Backup interval hours for the server. - * - * @param backupIntervalHours the backupIntervalHours value to set. - * @return the Backup object itself. - */ - public Backup withBackupIntervalHours(Integer backupIntervalHours) { - this.backupIntervalHours = backupIntervalHours; - return this; - } - /** * Get the geoRedundantBackup property: Whether or not geo redundant backup is enabled. * @@ -128,7 +103,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("backupRetentionDays", this.backupRetentionDays); - jsonWriter.writeNumberField("backupIntervalHours", this.backupIntervalHours); jsonWriter.writeStringField("geoRedundantBackup", this.geoRedundantBackup == null ? null : this.geoRedundantBackup.toString()); return jsonWriter.writeEndObject(); @@ -151,8 +125,6 @@ public static Backup fromJson(JsonReader jsonReader) throws IOException { if ("backupRetentionDays".equals(fieldName)) { deserializedBackup.backupRetentionDays = reader.getNullable(JsonReader::getInt); - } else if ("backupIntervalHours".equals(fieldName)) { - deserializedBackup.backupIntervalHours = reader.getNullable(JsonReader::getInt); } else if ("geoRedundantBackup".equals(fieldName)) { deserializedBackup.geoRedundantBackup = EnableStatusEnum.fromString(reader.getString()); } else if ("earliestRestoreDate".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java deleted file mode 100644 index ac921396d9333..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java +++ /dev/null @@ -1,123 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * BackupAndExport API Request. - */ -@Fluent -public final class BackupAndExportRequest extends BackupRequestBase { - /* - * Backup Target Store Details - */ - private BackupStoreDetails targetDetails; - - /** - * Creates an instance of BackupAndExportRequest class. - */ - public BackupAndExportRequest() { - } - - /** - * Get the targetDetails property: Backup Target Store Details. - * - * @return the targetDetails value. - */ - public BackupStoreDetails targetDetails() { - return this.targetDetails; - } - - /** - * Set the targetDetails property: Backup Target Store Details. - * - * @param targetDetails the targetDetails value to set. - * @return the BackupAndExportRequest object itself. - */ - public BackupAndExportRequest withTargetDetails(BackupStoreDetails targetDetails) { - this.targetDetails = targetDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public BackupAndExportRequest withBackupSettings(BackupSettings backupSettings) { - super.withBackupSettings(backupSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (targetDetails() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property targetDetails in model BackupAndExportRequest")); - } else { - targetDetails().validate(); - } - if (backupSettings() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property backupSettings in model BackupAndExportRequest")); - } else { - backupSettings().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportRequest.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("backupSettings", backupSettings()); - jsonWriter.writeJsonField("targetDetails", this.targetDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportRequest if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupAndExportRequest. - */ - public static BackupAndExportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportRequest deserializedBackupAndExportRequest = new BackupAndExportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupSettings".equals(fieldName)) { - deserializedBackupAndExportRequest.withBackupSettings(BackupSettings.fromJson(reader)); - } else if ("targetDetails".equals(fieldName)) { - deserializedBackupAndExportRequest.targetDetails = BackupStoreDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportRequest; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java deleted file mode 100644 index 199b0c5422b97..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java +++ /dev/null @@ -1,107 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of BackupAndExportResponse. - */ -public interface BackupAndExportResponse { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the status property: The operation status. - * - * @return the status value. - */ - OperationStatus status(); - - /** - * Gets the startTime property: Start time. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: End time. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the percentComplete property: Operation progress (0-100). - * - * @return the percentComplete value. - */ - Double percentComplete(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the error property: The error object. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @return the datasourceSizeInBytes value. - */ - Long datasourceSizeInBytes(); - - /** - * Gets the dataTransferredInBytes property: Data transferred in bytes. - * - * @return the dataTransferredInBytes value. - */ - Long dataTransferredInBytes(); - - /** - * Gets the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - String backupMetadata(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner object. - * - * @return the inner object. - */ - BackupAndExportResponseInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java deleted file mode 100644 index 47534c95a6f19..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java +++ /dev/null @@ -1,171 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * BackupAndExport Response Properties. - */ -@Fluent -public final class BackupAndExportResponseType extends OperationProgressResponseType { - /* - * Identifies the type of source operation - */ - private ObjectType objectType = ObjectType.BACKUP_AND_EXPORT_RESPONSE; - - /* - * Size of datasource in bytes - */ - private Long datasourceSizeInBytes; - - /* - * Data transferred in bytes - */ - private Long dataTransferredInBytes; - - /* - * Metadata related to backup to be stored for restoring resource in key-value pairs. - */ - private String backupMetadata; - - /** - * Creates an instance of BackupAndExportResponseType class. - */ - public BackupAndExportResponseType() { - } - - /** - * Get the objectType property: Identifies the type of source operation. - * - * @return the objectType value. - */ - @Override - public ObjectType objectType() { - return this.objectType; - } - - /** - * 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 BackupAndExportResponseType object itself. - */ - public BackupAndExportResponseType 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 BackupAndExportResponseType object itself. - */ - public BackupAndExportResponseType withDataTransferredInBytes(Long dataTransferredInBytes) { - this.dataTransferredInBytes = dataTransferredInBytes; - return this; - } - - /** - * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - public String backupMetadata() { - return this.backupMetadata; - } - - /** - * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @param backupMetadata the backupMetadata value to set. - * @return the BackupAndExportResponseType object itself. - */ - public BackupAndExportResponseType withBackupMetadata(String backupMetadata) { - this.backupMetadata = backupMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); - jsonWriter.writeNumberField("datasourceSizeInBytes", this.datasourceSizeInBytes); - jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); - jsonWriter.writeStringField("backupMetadata", this.backupMetadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportResponseType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportResponseType if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupAndExportResponseType. - */ - public static BackupAndExportResponseType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportResponseType deserializedBackupAndExportResponseType = new BackupAndExportResponseType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedBackupAndExportResponseType.objectType = ObjectType.fromString(reader.getString()); - } else if ("datasourceSizeInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseType.datasourceSizeInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("dataTransferredInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseType.dataTransferredInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("backupMetadata".equals(fieldName)) { - deserializedBackupAndExportResponseType.backupMetadata = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportResponseType; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java deleted file mode 100644 index d1244651847ce..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java +++ /dev/null @@ -1,67 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupAndExports. - */ -public interface BackupAndExports { - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response. - */ - BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given 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 represents BackupAndExport API Response. - */ - BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters, - Context context); - - /** - * Validates if backup can be performed for 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 com.azure.core.management.exception.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 ValidateBackup API Response along with {@link Response}. - */ - Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context); - - /** - * Validates if backup can be performed for 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 com.azure.core.management.exception.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 ValidateBackup API Response. - */ - ValidateBackupResponse validateBackup(String resourceGroupName, String serverName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java deleted file mode 100644 index 74a26620dc094..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). - */ -public final class BackupFormat extends ExpandableStringEnum { - /** - * Static value CollatedFormat for BackupFormat. - */ - public static final BackupFormat COLLATED_FORMAT = fromString("CollatedFormat"); - - /** - * Static value Raw for BackupFormat. - */ - public static final BackupFormat RAW = fromString("Raw"); - - /** - * Creates a new instance of BackupFormat value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupFormat() { - } - - /** - * Creates or finds a BackupFormat from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupFormat. - */ - public static BackupFormat fromString(String name) { - return fromString(name, BackupFormat.class); - } - - /** - * Gets known BackupFormat values. - * - * @return known BackupFormat values. - */ - public static Collection values() { - return values(BackupFormat.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java deleted file mode 100644 index 2fababa3850c1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java +++ /dev/null @@ -1,104 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * BackupRequestBase is the base for all backup request. - */ -@Fluent -public class BackupRequestBase implements JsonSerializable { - /* - * Backup Settings - */ - private BackupSettings backupSettings; - - /** - * Creates an instance of BackupRequestBase class. - */ - public BackupRequestBase() { - } - - /** - * Get the backupSettings property: Backup Settings. - * - * @return the backupSettings value. - */ - public BackupSettings backupSettings() { - return this.backupSettings; - } - - /** - * Set the backupSettings property: Backup Settings. - * - * @param backupSettings the backupSettings value to set. - * @return the BackupRequestBase object itself. - */ - public BackupRequestBase withBackupSettings(BackupSettings backupSettings) { - this.backupSettings = backupSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backupSettings() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property backupSettings in model BackupRequestBase")); - } else { - backupSettings().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupRequestBase.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("backupSettings", this.backupSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRequestBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRequestBase if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupRequestBase. - */ - public static BackupRequestBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRequestBase deserializedBackupRequestBase = new BackupRequestBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupSettings".equals(fieldName)) { - deserializedBackupRequestBase.backupSettings = BackupSettings.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRequestBase; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java deleted file mode 100644 index 7660a3e76f57a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java +++ /dev/null @@ -1,129 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Backup Settings. - */ -@Fluent -public final class BackupSettings implements JsonSerializable { - /* - * The name of the backup. - */ - private String backupName; - - /* - * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE) - */ - private BackupFormat backupFormat; - - /** - * Creates an instance of BackupSettings class. - */ - public BackupSettings() { - } - - /** - * Get the backupName property: The name of the backup. - * - * @return the backupName value. - */ - public String backupName() { - return this.backupName; - } - - /** - * Set the backupName property: The name of the backup. - * - * @param backupName the backupName value to set. - * @return the BackupSettings object itself. - */ - public BackupSettings withBackupName(String backupName) { - this.backupName = backupName; - return this; - } - - /** - * Get the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). - * - * @return the backupFormat value. - */ - public BackupFormat backupFormat() { - return this.backupFormat; - } - - /** - * Set the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). - * - * @param backupFormat the backupFormat value to set. - * @return the BackupSettings object itself. - */ - public BackupSettings withBackupFormat(BackupFormat backupFormat) { - this.backupFormat = backupFormat; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backupName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property backupName in model BackupSettings")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupName", this.backupName); - jsonWriter.writeStringField("backupFormat", this.backupFormat == null ? null : this.backupFormat.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupSettings if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupSettings. - */ - public static BackupSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupSettings deserializedBackupSettings = new BackupSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupName".equals(fieldName)) { - deserializedBackupSettings.backupName = reader.getString(); - } else if ("backupFormat".equals(fieldName)) { - deserializedBackupSettings.backupFormat = BackupFormat.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupSettings; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java deleted file mode 100644 index d03ce96d022f1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java +++ /dev/null @@ -1,107 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details about the target where the backup content will be stored. - */ -@Immutable -public class BackupStoreDetails implements JsonSerializable { - /* - * Type of the specific object - used for deserializing - */ - private String objectType = "BackupStoreDetails"; - - /** - * Creates an instance of BackupStoreDetails class. - */ - public BackupStoreDetails() { - } - - /** - * Get the objectType property: Type of the specific object - used for deserializing. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupStoreDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupStoreDetails if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupStoreDetails. - */ - public static BackupStoreDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("FullBackupStoreDetails".equals(discriminatorValue)) { - return FullBackupStoreDetails.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static BackupStoreDetails fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupStoreDetails deserializedBackupStoreDetails = new BackupStoreDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedBackupStoreDetails.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupStoreDetails; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java deleted file mode 100644 index 262cd8fd319e8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for BackupType. - */ -public final class BackupType extends ExpandableStringEnum { - /** - * Static value FULL for BackupType. - */ - public static final BackupType FULL = fromString("FULL"); - - /** - * Creates a new instance of BackupType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupType() { - } - - /** - * Creates or finds a BackupType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupType. - */ - public static BackupType fromString(String name) { - return fromString(name, BackupType.class); - } - - /** - * Gets known BackupType values. - * - * @return known BackupType values. - */ - public static Collection values() { - return values(BackupType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java index 0009b2c7b3bba..45ff69d4c2ab9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java @@ -12,34 +12,6 @@ * Resource collection API of Backups. */ public interface Backups { - /** - * Create backup for a given server with specified backup name. - * - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response}. - */ - Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Create backup for a given server with specified backup name. - * - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - ServerBackup put(String resourceGroupName, String serverName, String backupName); - /** * List all the backups for a given server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java deleted file mode 100644 index 51ea78ecbaf99..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java +++ /dev/null @@ -1,70 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import java.util.List; - -/** - * An immutable client-side representation of Capability. - */ -public interface Capability { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the supportedGeoBackupRegions property: supported geo backup regions. - * - * @return the supportedGeoBackupRegions value. - */ - List supportedGeoBackupRegions(); - - /** - * Gets the supportedFlexibleServerEditions property: A list of supported flexible server editions. - * - * @return the supportedFlexibleServerEditions value. - */ - List supportedFlexibleServerEditions(); - - /** - * Gets the supportedServerVersions property: A list of supported server versions. - * - * @return the supportedServerVersions value. - */ - List supportedServerVersions(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner object. - * - * @return the inner object. - */ - CapabilityInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java deleted file mode 100644 index ba7148299164c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java +++ /dev/null @@ -1,103 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import java.io.IOException; -import java.util.List; - -/** - * location capability set. - */ -@Immutable -public final class CapabilitySetsList implements JsonSerializable { - /* - * A list of supported capability sets. - */ - private List value; - - /* - * Link to retrieve next page of results. - */ - private String nextLink; - - /** - * Creates an instance of CapabilitySetsList class. - */ - public CapabilitySetsList() { - } - - /** - * Get the value property: A list of supported capability sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilitySetsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilitySetsList if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the CapabilitySetsList. - */ - public static CapabilitySetsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilitySetsList deserializedCapabilitySetsList = new CapabilitySetsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> CapabilityInner.fromJson(reader1)); - deserializedCapabilitySetsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCapabilitySetsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilitySetsList; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java index bbd0927deed50..037b36f883c15 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.management.SystemData; -import com.azure.core.util.Context; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** @@ -34,7 +33,7 @@ public interface Configuration { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -47,13 +46,6 @@ public interface Configuration { */ String value(); - /** - * Gets the currentValue property: Current value of the configuration. - * - * @return the currentValue value. - */ - String currentValue(); - /** * Gets the description property: Description of the configuration. * @@ -61,13 +53,6 @@ public interface Configuration { */ String description(); - /** - * Gets the documentationLink property: The link used to get the document from community or Azure site. - * - * @return the documentationLink value. - */ - String documentationLink(); - /** * Gets the defaultValue property: Default value of the configuration. * @@ -117,196 +102,10 @@ public interface Configuration { */ IsDynamicConfig isDynamicConfig(); - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - /** * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner object. * * @return the inner object. */ ConfigurationInner innerModel(); - - /** - * The entirety of the Configuration definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Configuration definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Configuration definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Configuration definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); - } - - /** - * The stage of the Configuration definition which contains all the minimum required properties for the resource - * to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithValue, DefinitionStages.WithCurrentValue, DefinitionStages.WithSource { - /** - * Executes the create request. - * - * @return the created resource. - */ - Configuration create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Configuration create(Context context); - } - - /** - * The stage of the Configuration definition allowing to specify value. - */ - interface WithValue { - /** - * Specifies the value property: Value of the configuration.. - * - * @param value Value of the configuration. - * @return the next definition stage. - */ - WithCreate withValue(String value); - } - - /** - * The stage of the Configuration definition allowing to specify currentValue. - */ - interface WithCurrentValue { - /** - * Specifies the currentValue property: Current value of the configuration.. - * - * @param currentValue Current value of the configuration. - * @return the next definition stage. - */ - WithCreate withCurrentValue(String currentValue); - } - - /** - * The stage of the Configuration definition allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Source of the configuration.. - * - * @param source Source of the configuration. - * @return the next definition stage. - */ - WithCreate withSource(ConfigurationSource source); - } - } - - /** - * Begins update for the Configuration resource. - * - * @return the stage of resource update. - */ - Configuration.Update update(); - - /** - * The template for Configuration update. - */ - interface Update extends UpdateStages.WithValue, UpdateStages.WithCurrentValue, UpdateStages.WithSource { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Configuration apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Configuration apply(Context context); - } - - /** - * The Configuration update stages. - */ - interface UpdateStages { - /** - * The stage of the Configuration update allowing to specify value. - */ - interface WithValue { - /** - * Specifies the value property: Value of the configuration.. - * - * @param value Value of the configuration. - * @return the next definition stage. - */ - Update withValue(String value); - } - - /** - * The stage of the Configuration update allowing to specify currentValue. - */ - interface WithCurrentValue { - /** - * Specifies the currentValue property: Current value of the configuration.. - * - * @param currentValue Current value of the configuration. - * @return the next definition stage. - */ - Update withCurrentValue(String currentValue); - } - - /** - * The stage of the Configuration update allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Source of the configuration.. - * - * @param source Source of the configuration. - * @return the next definition stage. - */ - Update withSource(ConfigurationSource source); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Configuration refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Configuration refresh(Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java index 5ffaff7ff86be..054b7f696f035 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java @@ -22,11 +22,6 @@ public final class ConfigurationListForBatchUpdate implements JsonSerializable value; - /* - * Whether to reset all server parameters to default. - */ - private ResetAllToDefault resetAllToDefault; - /** * Creates an instance of ConfigurationListForBatchUpdate class. */ @@ -53,26 +48,6 @@ public ConfigurationListForBatchUpdate withValue(List writer.writeJson(element)); - jsonWriter.writeStringField("resetAllToDefault", - this.resetAllToDefault == null ? null : this.resetAllToDefault.toString()); return jsonWriter.writeEndObject(); } @@ -116,9 +89,6 @@ public static ConfigurationListForBatchUpdate fromJson(JsonReader jsonReader) th List value = reader.readArray(reader1 -> ConfigurationForBatchUpdate.fromJson(reader1)); deserializedConfigurationListForBatchUpdate.value = value; - } else if ("resetAllToDefault".equals(fieldName)) { - deserializedConfigurationListForBatchUpdate.resetAllToDefault - = ResetAllToDefault.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java index 8ce828341e093..51959fa6fc4f5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java @@ -7,11 +7,43 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** * Resource collection API of Configurations. */ public interface Configurations { + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters); + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context); + /** * Gets information about a configuration of server. * @@ -86,47 +118,11 @@ ConfigurationListResult batchUpdate(String resourceGroupName, String serverName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of server configurations as paginated response with {@link PagedIterable}. */ - PagedIterable listByServer(String resourceGroupName, String serverName, String tags, String keyword, - Integer page, Integer pageSize, Context context); - - /** - * Gets information about a configuration of server. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a configuration of server along with {@link Response}. - */ - Configuration getById(String id); - - /** - * Gets information about a configuration of server. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a configuration of server along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Configuration resource. - * - * @param name resource name. - * @return the first stage of the new Configuration definition. - */ - Configuration.DefinitionStages.Blank define(String name); + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java index 41d3de0098b62..d65974e460490 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java @@ -34,7 +34,7 @@ public interface Database { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java index 1f1ccf8f82afb..06e69bb6c5056 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java @@ -34,7 +34,7 @@ public interface FirewallRule { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java deleted file mode 100644 index d9403b050fb34..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java +++ /dev/null @@ -1,122 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination. - */ -@Fluent -public final class FullBackupStoreDetails extends BackupStoreDetails { - /* - * Type of the specific object - used for deserializing - */ - private String objectType = "FullBackupStoreDetails"; - - /* - * SASUriList of storage containers where backup data is to be streamed/copied. - */ - private List sasUriList; - - /** - * Creates an instance of FullBackupStoreDetails class. - */ - public FullBackupStoreDetails() { - } - - /** - * Get the objectType property: Type of the specific object - used for deserializing. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. - * - * @return the sasUriList value. - */ - public List sasUriList() { - return this.sasUriList; - } - - /** - * Set the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. - * - * @param sasUriList the sasUriList value to set. - * @return the FullBackupStoreDetails object itself. - */ - public FullBackupStoreDetails withSasUriList(List sasUriList) { - this.sasUriList = sasUriList; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (sasUriList() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sasUriList in model FullBackupStoreDetails")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FullBackupStoreDetails.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("sasUriList", this.sasUriList, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FullBackupStoreDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FullBackupStoreDetails if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FullBackupStoreDetails. - */ - public static FullBackupStoreDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FullBackupStoreDetails deserializedFullBackupStoreDetails = new FullBackupStoreDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sasUriList".equals(fieldName)) { - List sasUriList = reader.readArray(reader1 -> reader1.getString()); - deserializedFullBackupStoreDetails.sasUriList = sasUriList; - } else if ("objectType".equals(fieldName)) { - deserializedFullBackupStoreDetails.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFullBackupStoreDetails; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java index 24696521a61e9..647d477795ff0 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java @@ -12,7 +12,7 @@ import java.io.IOException; /** - * High availability properties of a server. + * Network related properties of a server. */ @Fluent public final class HighAvailability implements JsonSerializable { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java deleted file mode 100644 index 0dc4f5d2491cd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; - -/** - * An immutable client-side representation of HighAvailabilityValidationEstimation. - */ -public interface HighAvailabilityValidationEstimation { - /** - * Gets the estimatedDowntime property: Estimated seconds of downtime for the deployment. - * - * @return the estimatedDowntime value. - */ - Integer estimatedDowntime(); - - /** - * Gets the scheduledStandbyAvailabilityZone property: Scheduled Availability zone of the standby server. - * - * @return the scheduledStandbyAvailabilityZone value. - */ - String scheduledStandbyAvailabilityZone(); - - /** - * Gets the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. - * - * @return the expectedStandbyAvailabilityZone value. - */ - String expectedStandbyAvailabilityZone(); - - /** - * Gets the inner - * com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner object. - * - * @return the inner object. - */ - HighAvailabilityValidationEstimationInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java similarity index 73% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java index 297d9df04291d..a799f2769e57f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java @@ -16,7 +16,7 @@ * Properties to configure Identity for Bring your Own Keys. */ @Fluent -public final class MySqlServerIdentity implements JsonSerializable { +public final class Identity implements JsonSerializable { /* * ObjectId from the KeyVault */ @@ -38,9 +38,9 @@ public final class MySqlServerIdentity implements JsonSerializable userAssignedIdentities; /** - * Creates an instance of MySqlServerIdentity class. + * Creates an instance of Identity class. */ - public MySqlServerIdentity() { + public Identity() { } /** @@ -74,9 +74,9 @@ public ManagedServiceIdentityType type() { * Set the type property: Type of managed service identity. * * @param type the type value to set. - * @return the MySqlServerIdentity object itself. + * @return the Identity object itself. */ - public MySqlServerIdentity withType(ManagedServiceIdentityType type) { + public Identity withType(ManagedServiceIdentityType type) { this.type = type; return this; } @@ -94,9 +94,9 @@ public Map userAssignedIdentities() { * Set the userAssignedIdentities property: Metadata of user assigned identity. * * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the MySqlServerIdentity object itself. + * @return the Identity object itself. */ - public MySqlServerIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { this.userAssignedIdentities = userAssignedIdentities; return this; } @@ -122,35 +122,35 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MySqlServerIdentity from the JsonReader. + * Reads an instance of Identity from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MySqlServerIdentity if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MySqlServerIdentity. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Identity. */ - public static MySqlServerIdentity fromJson(JsonReader jsonReader) throws IOException { + public static Identity fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - MySqlServerIdentity deserializedMySqlServerIdentity = new MySqlServerIdentity(); + Identity deserializedIdentity = new Identity(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("principalId".equals(fieldName)) { - deserializedMySqlServerIdentity.principalId = reader.getString(); + deserializedIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { - deserializedMySqlServerIdentity.tenantId = reader.getString(); + deserializedIdentity.tenantId = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedMySqlServerIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + deserializedIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedMySqlServerIdentity.userAssignedIdentities = userAssignedIdentities; + deserializedIdentity.userAssignedIdentities = userAssignedIdentities; } else { reader.skipChildren(); } } - return deserializedMySqlServerIdentity; + return deserializedIdentity; }); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java deleted file mode 100644 index 577ae901827a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java +++ /dev/null @@ -1,119 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * ImportFromStorage Response Properties. - */ -@Fluent -public final class ImportFromStorageResponseType extends OperationProgressResponseType { - /* - * Identifies the type of source operation - */ - private ObjectType objectType = ObjectType.IMPORT_FROM_STORAGE_RESPONSE; - - /* - * The estimated time of operation completion. - */ - private OffsetDateTime estimatedCompletionTime; - - /** - * Creates an instance of ImportFromStorageResponseType class. - */ - public ImportFromStorageResponseType() { - } - - /** - * Get the objectType property: Identifies the type of source operation. - * - * @return the objectType value. - */ - @Override - public ObjectType objectType() { - return this.objectType; - } - - /** - * Get the estimatedCompletionTime property: The estimated time of operation completion. - * - * @return the estimatedCompletionTime value. - */ - public OffsetDateTime estimatedCompletionTime() { - return this.estimatedCompletionTime; - } - - /** - * Set the estimatedCompletionTime property: The estimated time of operation completion. - * - * @param estimatedCompletionTime the estimatedCompletionTime value to set. - * @return the ImportFromStorageResponseType object itself. - */ - public ImportFromStorageResponseType withEstimatedCompletionTime(OffsetDateTime estimatedCompletionTime) { - this.estimatedCompletionTime = estimatedCompletionTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); - jsonWriter.writeStringField("estimatedCompletionTime", - this.estimatedCompletionTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.estimatedCompletionTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImportFromStorageResponseType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImportFromStorageResponseType if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ImportFromStorageResponseType. - */ - public static ImportFromStorageResponseType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImportFromStorageResponseType deserializedImportFromStorageResponseType - = new ImportFromStorageResponseType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedImportFromStorageResponseType.objectType = ObjectType.fromString(reader.getString()); - } else if ("estimatedCompletionTime".equals(fieldName)) { - deserializedImportFromStorageResponseType.estimatedCompletionTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedImportFromStorageResponseType; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java deleted file mode 100644 index 3f9cfe6ade35d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java +++ /dev/null @@ -1,180 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Import source related properties. - */ -@Fluent -public final class ImportSourceProperties implements JsonSerializable { - /* - * Storage type of import source. - */ - private ImportSourceStorageType storageType; - - /* - * Uri of the import source storage. - */ - private String storageUrl; - - /* - * Sas token for accessing source storage. Read and list permissions are required for sas token. - */ - private String sasToken; - - /* - * Relative path of data directory in storage. - */ - private String dataDirPath; - - /** - * Creates an instance of ImportSourceProperties class. - */ - public ImportSourceProperties() { - } - - /** - * Get the storageType property: Storage type of import source. - * - * @return the storageType value. - */ - public ImportSourceStorageType storageType() { - return this.storageType; - } - - /** - * Set the storageType property: Storage type of import source. - * - * @param storageType the storageType value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withStorageType(ImportSourceStorageType storageType) { - this.storageType = storageType; - return this; - } - - /** - * Get the storageUrl property: Uri of the import source storage. - * - * @return the storageUrl value. - */ - public String storageUrl() { - return this.storageUrl; - } - - /** - * Set the storageUrl property: Uri of the import source storage. - * - * @param storageUrl the storageUrl value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withStorageUrl(String storageUrl) { - this.storageUrl = storageUrl; - return this; - } - - /** - * Get the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas - * token. - * - * @return the sasToken value. - */ - public String sasToken() { - return this.sasToken; - } - - /** - * Set the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas - * token. - * - * @param sasToken the sasToken value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withSasToken(String sasToken) { - this.sasToken = sasToken; - return this; - } - - /** - * Get the dataDirPath property: Relative path of data directory in storage. - * - * @return the dataDirPath value. - */ - public String dataDirPath() { - return this.dataDirPath; - } - - /** - * Set the dataDirPath property: Relative path of data directory in storage. - * - * @param dataDirPath the dataDirPath value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withDataDirPath(String dataDirPath) { - this.dataDirPath = dataDirPath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); - jsonWriter.writeStringField("storageUrl", this.storageUrl); - jsonWriter.writeStringField("sasToken", this.sasToken); - jsonWriter.writeStringField("dataDirPath", this.dataDirPath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImportSourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImportSourceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ImportSourceProperties. - */ - public static ImportSourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImportSourceProperties deserializedImportSourceProperties = new ImportSourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("storageType".equals(fieldName)) { - deserializedImportSourceProperties.storageType - = ImportSourceStorageType.fromString(reader.getString()); - } else if ("storageUrl".equals(fieldName)) { - deserializedImportSourceProperties.storageUrl = reader.getString(); - } else if ("sasToken".equals(fieldName)) { - deserializedImportSourceProperties.sasToken = reader.getString(); - } else if ("dataDirPath".equals(fieldName)) { - deserializedImportSourceProperties.dataDirPath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedImportSourceProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java deleted file mode 100644 index 5fb618c0a57b2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Storage type of import source. - */ -public final class ImportSourceStorageType extends ExpandableStringEnum { - /** - * Static value AzureBlob for ImportSourceStorageType. - */ - public static final ImportSourceStorageType AZURE_BLOB = fromString("AzureBlob"); - - /** - * Creates a new instance of ImportSourceStorageType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ImportSourceStorageType() { - } - - /** - * Creates or finds a ImportSourceStorageType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImportSourceStorageType. - */ - public static ImportSourceStorageType fromString(String name) { - return fromString(name, ImportSourceStorageType.class); - } - - /** - * Gets known ImportSourceStorageType values. - * - * @return known ImportSourceStorageType values. - */ - public static Collection values() { - return values(ImportSourceStorageType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java deleted file mode 100644 index 23081bfc935cf..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java +++ /dev/null @@ -1,64 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of LocationBasedCapabilitySets. - */ -public interface LocationBasedCapabilitySets { - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String locationName); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @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 at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String locationName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @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 at specified location in a given subscription along with {@link Response}. - */ - Response getWithResponse(String locationName, String capabilitySetName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 at specified location in a given subscription. - */ - Capability get(String locationName, String capabilitySetName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java deleted file mode 100644 index f90b425bda874..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java +++ /dev/null @@ -1,84 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of LogFile. - */ -public interface LogFile { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the sizeInKB property: The size in kb of the logFile. - * - * @return the sizeInKB value. - */ - Long sizeInKB(); - - /** - * Gets the createdTime property: Creation timestamp of the log file. - * - * @return the createdTime value. - */ - OffsetDateTime createdTime(); - - /** - * Gets the typePropertiesType property: Type of the log file. - * - * @return the typePropertiesType value. - */ - String typePropertiesType(); - - /** - * Gets the lastModifiedTime property: Last modified timestamp of the log file. - * - * @return the lastModifiedTime value. - */ - OffsetDateTime lastModifiedTime(); - - /** - * Gets the url property: The url to download the log file from. - * - * @return the url value. - */ - String url(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner object. - * - * @return the inner object. - */ - LogFileInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.java deleted file mode 100644 index d068e01b0f1b1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import java.io.IOException; -import java.util.List; - -/** - * A List of logFiles. - */ -@Fluent -public final class LogFileListResult implements JsonSerializable { - /* - * The list of logFiles in a server - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of LogFileListResult class. - */ - public LogFileListResult() { - } - - /** - * Get the value property: The list of logFiles in a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of logFiles in a server. - * - * @param value the value value to set. - * @return the LogFileListResult object itself. - */ - public LogFileListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the LogFileListResult object itself. - */ - public LogFileListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogFileListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogFileListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the LogFileListResult. - */ - public static LogFileListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogFileListResult deserializedLogFileListResult = new LogFileListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> LogFileInner.fromJson(reader1)); - deserializedLogFileListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedLogFileListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLogFileListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java deleted file mode 100644 index 229713f99fbb2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java +++ /dev/null @@ -1,38 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of LogFiles. - */ -public interface LogFiles { - /** - * 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 com.azure.core.management.exception.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}. - */ - PagedIterable listByServer(String resourceGroupName, String 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 com.azure.core.management.exception.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}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java deleted file mode 100644 index a0f6a670ca44f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java +++ /dev/null @@ -1,18 +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.mysqlflexibleserver.models; - -/** - * Resource collection API of LongRunningBackups. - */ -public interface LongRunningBackups { - /** - * Begins definition for a new ServerBackupV2 resource. - * - * @param name resource name. - * @return the first stage of the new ServerBackupV2 definition. - */ - ServerBackupV2.DefinitionStages.Blank define(String name); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupsOperations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupsOperations.java deleted file mode 100644 index f1e76a4a00eab..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupsOperations.java +++ /dev/null @@ -1,67 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of LongRunningBackupsOperations. - */ -public interface LongRunningBackupsOperations { - /** - * Get backup for a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Get backup for a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server. - */ - ServerBackupV2 get(String resourceGroupName, String serverName, String backupName); - - /** - * List all the backups for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List all the backups for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java deleted file mode 100644 index 17a5aa3296061..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of Maintenance. - */ -public interface Maintenance { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the maintenanceType property: A string defines maintenance type. - * - * @return the maintenanceType value. - */ - MaintenanceType maintenanceType(); - - /** - * Gets the maintenanceState property: A string describes the maintenance status. - * - * @return the maintenanceState value. - */ - MaintenanceState maintenanceState(); - - /** - * Gets the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - OffsetDateTime maintenanceStartTime(); - - /** - * Gets the maintenanceEndTime property: The end time for a maintenance. - * - * @return the maintenanceEndTime value. - */ - OffsetDateTime maintenanceEndTime(); - - /** - * Gets the maintenanceExecutionStartTime property: The start time for a maintenance execution. - * - * @return the maintenanceExecutionStartTime value. - */ - OffsetDateTime maintenanceExecutionStartTime(); - - /** - * Gets the maintenanceExecutionEndTime property: The end time for a maintenance execution. - * - * @return the maintenanceExecutionEndTime value. - */ - OffsetDateTime maintenanceExecutionEndTime(); - - /** - * Gets the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMinTime value. - */ - OffsetDateTime maintenanceAvailableScheduleMinTime(); - - /** - * Gets the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMaxTime value. - */ - OffsetDateTime maintenanceAvailableScheduleMaxTime(); - - /** - * Gets the maintenanceTitle property: The maintenance title. - * - * @return the maintenanceTitle value. - */ - String maintenanceTitle(); - - /** - * Gets the maintenanceDescription property: The maintenance description. - * - * @return the maintenanceDescription value. - */ - String maintenanceDescription(); - - /** - * Gets the provisioningState property: Provisioning state of the Maintenance. - * - * @return the provisioningState value. - */ - MaintenanceProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner object. - * - * @return the inner object. - */ - MaintenanceInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceListResult.java deleted file mode 100644 index 751ee47dc7c26..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceListResult.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of maintenances. - */ -@Fluent -public final class MaintenanceListResult implements JsonSerializable { - /* - * The list of maintenances in a server. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of MaintenanceListResult class. - */ - public MaintenanceListResult() { - } - - /** - * Get the value property: The list of maintenances in a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of maintenances in a server. - * - * @param value the value value to set. - * @return the MaintenanceListResult object itself. - */ - public MaintenanceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the MaintenanceListResult object itself. - */ - public MaintenanceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenanceListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceListResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenanceListResult. - */ - public static MaintenanceListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceListResult deserializedMaintenanceListResult = new MaintenanceListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> MaintenanceInner.fromJson(reader1)); - deserializedMaintenanceListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedMaintenanceListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java deleted file mode 100644 index 9587149cc9f7a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java +++ /dev/null @@ -1,61 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class MaintenanceProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Creating for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState FAILED = fromString("Failed"); - - /** - * Creates a new instance of MaintenanceProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MaintenanceProvisioningState() { - } - - /** - * Creates or finds a MaintenanceProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding MaintenanceProvisioningState. - */ - public static MaintenanceProvisioningState fromString(String name) { - return fromString(name, MaintenanceProvisioningState.class); - } - - /** - * Gets known MaintenanceProvisioningState values. - * - * @return known MaintenanceProvisioningState values. - */ - public static Collection values() { - return values(MaintenanceProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java deleted file mode 100644 index 0b5b29d9ec77a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java +++ /dev/null @@ -1,71 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current status of this maintenance. - */ -public final class MaintenanceState extends ExpandableStringEnum { - /** - * Static value Scheduled for MaintenanceState. - */ - public static final MaintenanceState SCHEDULED = fromString("Scheduled"); - - /** - * Static value ReScheduled for MaintenanceState. - */ - public static final MaintenanceState RE_SCHEDULED = fromString("ReScheduled"); - - /** - * Static value InPreparation for MaintenanceState. - */ - public static final MaintenanceState IN_PREPARATION = fromString("InPreparation"); - - /** - * Static value Processing for MaintenanceState. - */ - public static final MaintenanceState PROCESSING = fromString("Processing"); - - /** - * Static value Completed for MaintenanceState. - */ - public static final MaintenanceState COMPLETED = fromString("Completed"); - - /** - * Static value Canceled for MaintenanceState. - */ - public static final MaintenanceState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of MaintenanceState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MaintenanceState() { - } - - /** - * Creates or finds a MaintenanceState from its string representation. - * - * @param name a name to look for. - * @return the corresponding MaintenanceState. - */ - public static MaintenanceState fromString(String name) { - return fromString(name, MaintenanceState.class); - } - - /** - * Gets known MaintenanceState values. - * - * @return known MaintenanceState values. - */ - public static Collection values() { - return values(MaintenanceState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java deleted file mode 100644 index 9aebe824a79a9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java +++ /dev/null @@ -1,61 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of this maintenance. - */ -public final class MaintenanceType extends ExpandableStringEnum { - /** - * Static value RoutineMaintenance for MaintenanceType. - */ - public static final MaintenanceType ROUTINE_MAINTENANCE = fromString("RoutineMaintenance"); - - /** - * Static value MinorVersionUpgrade for MaintenanceType. - */ - public static final MaintenanceType MINOR_VERSION_UPGRADE = fromString("MinorVersionUpgrade"); - - /** - * Static value SecurityPatches for MaintenanceType. - */ - public static final MaintenanceType SECURITY_PATCHES = fromString("SecurityPatches"); - - /** - * Static value HotFixes for MaintenanceType. - */ - public static final MaintenanceType HOT_FIXES = fromString("HotFixes"); - - /** - * Creates a new instance of MaintenanceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MaintenanceType() { - } - - /** - * Creates or finds a MaintenanceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MaintenanceType. - */ - public static MaintenanceType fromString(String name) { - return fromString(name, MaintenanceType.class); - } - - /** - * Gets known MaintenanceType values. - * - * @return known MaintenanceType values. - */ - public static Collection values() { - return values(MaintenanceType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java deleted file mode 100644 index 034361626b30a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java +++ /dev/null @@ -1,110 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Represents a maintenance update parameter. - */ -@Fluent -public final class MaintenanceUpdate implements JsonSerializable { - /* - * The properties of a maintenance update parameter - */ - private MaintenancePropertiesForUpdate innerProperties; - - /** - * Creates an instance of MaintenanceUpdate class. - */ - public MaintenanceUpdate() { - } - - /** - * Get the innerProperties property: The properties of a maintenance update parameter. - * - * @return the innerProperties value. - */ - private MaintenancePropertiesForUpdate innerProperties() { - return this.innerProperties; - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenanceUpdate object itself. - */ - public MaintenanceUpdate withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new MaintenancePropertiesForUpdate(); - } - this.innerProperties().withMaintenanceStartTime(maintenanceStartTime); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenanceUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceUpdate if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenanceUpdate. - */ - public static MaintenanceUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceUpdate deserializedMaintenanceUpdate = new MaintenanceUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedMaintenanceUpdate.innerProperties = MaintenancePropertiesForUpdate.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceUpdate; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java deleted file mode 100644 index 06b751edf5721..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java +++ /dev/null @@ -1,96 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Maintenances. - */ -public interface Maintenances { - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @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 maintenance along with {@link Response}. - */ - Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, - Context context); - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 maintenance. - */ - Maintenance read(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 maintenance. - */ - Maintenance update(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a 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 represents a maintenance. - */ - Maintenance update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context); - - /** - * List maintenances. - * - * @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 a list of maintenances as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List maintenances. - * - * @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 a list of maintenances as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java index 9024c3c927325..7927e7b8aa176 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java @@ -4,43 +4,48 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - /** * Type of managed service identity. */ -public final class ManagedServiceIdentityType extends ExpandableStringEnum { +public enum ManagedServiceIdentityType { /** - * Static value UserAssigned for ManagedServiceIdentityType. + * Enum value UserAssigned. */ - public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + USER_ASSIGNED("UserAssigned"); /** - * Creates a new instance of ManagedServiceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. + * The actual serialized value for a ManagedServiceIdentityType instance. */ - @Deprecated - public ManagedServiceIdentityType() { + private final String value; + + ManagedServiceIdentityType(String value) { + this.value = value; } /** - * Creates or finds a ManagedServiceIdentityType from its string representation. + * Parses a serialized value to a ManagedServiceIdentityType instance. * - * @param name a name to look for. - * @return the corresponding ManagedServiceIdentityType. + * @param value the serialized value to parse. + * @return the parsed ManagedServiceIdentityType object, or null if unable to parse. */ - public static ManagedServiceIdentityType fromString(String name) { - return fromString(name, ManagedServiceIdentityType.class); + public static ManagedServiceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ManagedServiceIdentityType[] items = ManagedServiceIdentityType.values(); + for (ManagedServiceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } /** - * Gets known ManagedServiceIdentityType values. - * - * @return known ManagedServiceIdentityType values. + * {@inheritDoc} */ - public static Collection values() { - return values(ManagedServiceIdentityType.class); + @Override + public String toString() { + return this.value; } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java index 620d53b165b43..e6e09b09f5d64 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java @@ -48,18 +48,6 @@ public EnableStatusEnum publicNetworkAccess() { return this.publicNetworkAccess; } - /** - * Set the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * 'Disabled' when server has VNet integration. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the Network object itself. - */ - public Network withPublicNetworkAccess(EnableStatusEnum publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - /** * Get the delegatedSubnetResourceId property: Delegated subnet resource id used to setup vnet for a server. * @@ -114,8 +102,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("publicNetworkAccess", - this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); jsonWriter.writeStringField("delegatedSubnetResourceId", this.delegatedSubnetResourceId); jsonWriter.writeStringField("privateDnsZoneResourceId", this.privateDnsZoneResourceId); return jsonWriter.writeEndObject(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java deleted file mode 100644 index 6666ac84b7ee1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Identifies the type of source operation. - */ -public final class ObjectType extends ExpandableStringEnum { - /** - * Static value BackupAndExportResponse for ObjectType. - */ - public static final ObjectType BACKUP_AND_EXPORT_RESPONSE = fromString("BackupAndExportResponse"); - - /** - * Static value ImportFromStorageResponse for ObjectType. - */ - public static final ObjectType IMPORT_FROM_STORAGE_RESPONSE = fromString("ImportFromStorageResponse"); - - /** - * Creates a new instance of ObjectType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ObjectType() { - } - - /** - * Creates or finds a ObjectType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ObjectType. - */ - public static ObjectType fromString(String name) { - return fromString(name, ObjectType.class); - } - - /** - * Gets known ObjectType values. - * - * @return known ObjectType values. - */ - public static Collection values() { - return values(ObjectType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java deleted file mode 100644 index c051196d8f84d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java +++ /dev/null @@ -1,38 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of OperationProgress. - */ -public interface OperationProgress { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - Response getWithResponse(String locationName, String operationId, Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - OperationProgressResult get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java deleted file mode 100644 index 8adcd780a718e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java +++ /dev/null @@ -1,110 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Represents the response properties specific to the operation. - */ -@Immutable -public class OperationProgressResponseType implements JsonSerializable { - /* - * Identifies the type of source operation - */ - private ObjectType objectType = ObjectType.fromString("OperationProgressResponseType"); - - /** - * Creates an instance of OperationProgressResponseType class. - */ - public OperationProgressResponseType() { - } - - /** - * Get the objectType property: Identifies the type of source operation. - * - * @return the objectType value. - */ - public ObjectType objectType() { - return this.objectType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationProgressResponseType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationProgressResponseType if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationProgressResponseType. - */ - public static OperationProgressResponseType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("BackupAndExportResponse".equals(discriminatorValue)) { - return BackupAndExportResponseType.fromJson(readerToUse.reset()); - } else if ("ImportFromStorageResponse".equals(discriminatorValue)) { - return ImportFromStorageResponseType.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static OperationProgressResponseType fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationProgressResponseType deserializedOperationProgressResponseType - = new OperationProgressResponseType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationProgressResponseType.objectType = ObjectType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationProgressResponseType; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java deleted file mode 100644 index bf5f81edffa4f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of OperationProgressResult. - */ -public interface OperationProgressResult { - /** - * Gets the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - String id(); - - /** - * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - String resourceId(); - - /** - * Gets the name property: Name of the async operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: Operation status. - * - * @return the status value. - */ - String status(); - - /** - * Gets the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - Float percentComplete(); - - /** - * Gets the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the operations property: The operations list. - * - * @return the operations value. - */ - List operations(); - - /** - * Gets the error property: If present, details of the operation error. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the properties property: The response properties specific to the operation. - * - * @return the properties value. - */ - OperationProgressResponseType properties(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner object. - * - * @return the inner object. - */ - OperationProgressResultInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java deleted file mode 100644 index 752a49c855516..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java +++ /dev/null @@ -1,38 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of OperationResults. - */ -public interface OperationResults { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - Response getWithResponse(String locationName, String operationId, Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - OperationStatusExtendedResult get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java deleted file mode 100644 index b24ed1ca33f0e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java +++ /dev/null @@ -1,76 +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.mysqlflexibleserver.models; - -/** - * The operation status. - */ -public enum OperationStatus { - /** - * Enum value Pending. - */ - PENDING("Pending"), - - /** - * Enum value InProgress. - */ - IN_PROGRESS("InProgress"), - - /** - * Enum value Succeeded. - */ - SUCCEEDED("Succeeded"), - - /** - * Enum value Failed. - */ - FAILED("Failed"), - - /** - * Enum value CancelInProgress. - */ - CANCEL_IN_PROGRESS("CancelInProgress"), - - /** - * Enum value Canceled. - */ - CANCELED("Canceled"); - - /** - * The actual serialized value for a OperationStatus instance. - */ - private final String value; - - OperationStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperationStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed OperationStatus object, or null if unable to parse. - */ - public static OperationStatus fromString(String value) { - if (value == null) { - return null; - } - OperationStatus[] items = OperationStatus.values(); - for (OperationStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java deleted file mode 100644 index 42b2268332376..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java +++ /dev/null @@ -1,95 +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.mysqlflexibleserver.models; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of OperationStatusExtendedResult. - */ -public interface OperationStatusExtendedResult { - /** - * Gets the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - String id(); - - /** - * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - String resourceId(); - - /** - * Gets the name property: Name of the async operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: Operation status. - * - * @return the status value. - */ - String status(); - - /** - * Gets the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - Float percentComplete(); - - /** - * Gets the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the operations property: The operations list. - * - * @return the operations value. - */ - List operations(); - - /** - * Gets the error property: If present, details of the operation error. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the properties property: The extended properties of Operation Results. - * - * @return the properties value. - */ - Map properties(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner - * object. - * - * @return the inner object. - */ - OperationStatusExtendedResultInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java deleted file mode 100644 index c659b48da448a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java +++ /dev/null @@ -1,340 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * The current status of an async operation. - */ -@Fluent -public class OperationStatusResult implements JsonSerializable { - /* - * Fully qualified ID for the async operation. - */ - private String id; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /* - * Name of the async operation. - */ - private String name; - - /* - * Operation status. - */ - private String status; - - /* - * Percent of the operation that is complete. - */ - private Float percentComplete; - - /* - * The start time of the operation. - */ - private OffsetDateTime startTime; - - /* - * The end time of the operation. - */ - private OffsetDateTime endTime; - - /* - * The operations list. - */ - private List operations; - - /* - * If present, details of the operation error. - */ - private ManagementError error; - - /** - * Creates an instance of OperationStatusResult class. - */ - public OperationStatusResult() { - } - - /** - * Get the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Fully qualified ID for the async operation. - * - * @param id the id value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withId(String id) { - this.id = id; - return this; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @param resourceId the resourceId value to set. - * @return the OperationStatusResult object itself. - */ - OperationStatusResult withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the name property: Name of the async operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the async operation. - * - * @param name the name value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withName(String name) { - this.name = name; - return this; - } - - /** - * Get the status property: Operation status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Operation status. - * - * @param status the status value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - public Float percentComplete() { - return this.percentComplete; - } - - /** - * Set the percentComplete property: Percent of the operation that is complete. - * - * @param percentComplete the percentComplete value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withPercentComplete(Float percentComplete) { - this.percentComplete = percentComplete; - return this; - } - - /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time of the operation. - * - * @param startTime the startTime value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time of the operation. - * - * @param endTime the endTime value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the operations property: The operations list. - * - * @return the operations value. - */ - public List operations() { - return this.operations; - } - - /** - * Set the operations property: The operations list. - * - * @param operations the operations value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withOperations(List operations) { - this.operations = operations; - return this; - } - - /** - * Get the error property: If present, details of the operation error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: If present, details of the operation error. - * - * @param error the error value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property status in model OperationStatusResult")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeNumberField("percentComplete", this.percentComplete); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationStatusResult. - */ - public static OperationStatusResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusResult deserializedOperationStatusResult = new OperationStatusResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationStatusResult.status = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedOperationStatusResult.id = reader.getString(); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationStatusResult.resourceId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusResult.name = reader.getString(); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusResult.percentComplete = reader.getNullable(JsonReader::getFloat); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusResult.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusResult.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationStatusResult.operations = operations; - } else if ("error".equals(fieldName)) { - deserializedOperationStatusResult.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java deleted file mode 100644 index 23d367370b5c6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java +++ /dev/null @@ -1,81 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The private endpoint resource. - */ -@Immutable -public final class PrivateEndpoint implements JsonSerializable { - /* - * The ARM identifier for private endpoint. - */ - private String id; - - /** - * Creates an instance of PrivateEndpoint class. - */ - public PrivateEndpoint() { - } - - /** - * Get the id property: The ARM identifier for private endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateEndpoint. - */ - public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpoint.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpoint; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java deleted file mode 100644 index 3715aff0bfca5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,224 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties; -import java.io.IOException; -import java.util.List; - -/** - * The private endpoint connection resource. - */ -@Fluent -public final class PrivateEndpointConnection extends ProxyResource { - /* - * Resource properties. - */ - private PrivateEndpointConnectionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of PrivateEndpointConnection class. - */ - public PrivateEndpointConnection() { - } - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private PrivateEndpointConnectionProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.innerProperties() == null ? null : this.innerProperties().groupIds(); - } - - /** - * Get the privateEndpoint property: The private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateEndpoint(privateEndpoint); - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnection if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the PrivateEndpointConnection. - */ - public static PrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnection deserializedPrivateEndpointConnection = new PrivateEndpointConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnection.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnection.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnection.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnection.innerProperties - = PrivateEndpointConnectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnection.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnection; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 00098615295ff..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,62 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** - * Static value Succeeded for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Creating for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates a new instance of PrivateEndpointConnectionProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointConnectionProvisioningState() { - } - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** - * Gets known PrivateEndpointConnectionProvisioningState values. - * - * @return known PrivateEndpointConnectionProvisioningState values. - */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 80b8dfda09c1f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,57 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The private endpoint connection status. - */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** - * Static value Pending for PrivateEndpointServiceConnectionStatus. - */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** - * Static value Approved for PrivateEndpointServiceConnectionStatus. - */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** - * Static value Rejected for PrivateEndpointServiceConnectionStatus. - */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointServiceConnectionStatus() { - } - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** - * Gets known PrivateEndpointServiceConnectionStatus values. - * - * @return known PrivateEndpointServiceConnectionStatus values. - */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 894ae26d3ddf2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,155 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A collection of information about the state of the connection between service consumer and provider. - */ -@Fluent -public final class PrivateLinkServiceConnectionState implements JsonSerializable { - /* - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - */ - private PrivateEndpointServiceConnectionStatus status; - - /* - * The reason for approval/rejection of the connection. - */ - private String description; - - /* - * A message indicating if changes on the service provider require any updates on the consumer. - */ - private String actionsRequired; - - /** - * Creates an instance of PrivateLinkServiceConnectionState class. - */ - public PrivateLinkServiceConnectionState() { - } - - /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @return the status value. - */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The reason for approval/rejection of the connection. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The reason for approval/rejection of the connection. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @param actionsRequired the actionsRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { - this.actionsRequired = actionsRequired; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("actionsRequired", this.actionsRequired); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. - */ - public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState - = new PrivateLinkServiceConnectionState(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.status - = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.description = reader.getString(); - } else if ("actionsRequired".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkServiceConnectionState; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java deleted file mode 100644 index d31862117e0b0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java +++ /dev/null @@ -1,66 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class ProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for ProvisioningState. - */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Creating for ProvisioningState. - */ - public static final ProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for ProvisioningState. - */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for ProvisioningState. - */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Canceled for ProvisioningState. - */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of ProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProvisioningState() { - } - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java deleted file mode 100644 index f7237d095c0f2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Whether to reset all server parameters to default. - */ -public final class ResetAllToDefault extends ExpandableStringEnum { - /** - * Static value True for ResetAllToDefault. - */ - public static final ResetAllToDefault TRUE = fromString("True"); - - /** - * Static value False for ResetAllToDefault. - */ - public static final ResetAllToDefault FALSE = fromString("False"); - - /** - * Creates a new instance of ResetAllToDefault value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResetAllToDefault() { - } - - /** - * Creates or finds a ResetAllToDefault from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResetAllToDefault. - */ - public static ResetAllToDefault fromString(String name) { - return fromString(name, ResetAllToDefault.class); - } - - /** - * Gets known ResetAllToDefault values. - * - * @return known ResetAllToDefault values. - */ - public static Collection values() { - return values(ResetAllToDefault.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java index 92ccd8f5e9e4b..7b3557f253a05 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java @@ -4,14 +4,11 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; -import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import java.time.OffsetDateTime; -import java.util.List; import java.util.Map; /** @@ -58,17 +55,17 @@ public interface Server { * * @return the identity value. */ - MySqlServerIdentity identity(); + Identity identity(); /** * Gets the sku property: The SKU (pricing tier) of the server. * * @return the sku value. */ - MySqlServerSku sku(); + Sku sku(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -189,13 +186,6 @@ public interface Server { */ Network network(); - /** - * Gets the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. - * - * @return the privateEndpointConnections value. - */ - List privateEndpointConnections(); - /** * Gets the maintenanceWindow property: Maintenance window of a server. * @@ -203,13 +193,6 @@ public interface Server { */ MaintenanceWindow maintenanceWindow(); - /** - * Gets the importSourceProperties property: Source properties for import from storage. - * - * @return the importSourceProperties value. - */ - ImportSourceProperties importSourceProperties(); - /** * Gets the region of the resource. * @@ -298,8 +281,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde DefinitionStages.WithVersion, DefinitionStages.WithAvailabilityZone, DefinitionStages.WithCreateMode, DefinitionStages.WithSourceServerResourceId, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithReplicationRole, DefinitionStages.WithDataEncryption, DefinitionStages.WithStorage, - DefinitionStages.WithBackup, DefinitionStages.WithHighAvailability, DefinitionStages.WithNetwork, - DefinitionStages.WithImportSourceProperties { + DefinitionStages.WithBackup, DefinitionStages.WithHighAvailability, DefinitionStages.WithNetwork { /** * Executes the create request. * @@ -339,7 +321,7 @@ interface WithIdentity { * @param identity The cmk identity for the server. * @return the next definition stage. */ - WithCreate withIdentity(MySqlServerIdentity identity); + WithCreate withIdentity(Identity identity); } /** @@ -352,7 +334,7 @@ interface WithSku { * @param sku The SKU (pricing tier) of the server. * @return the next definition stage. */ - WithCreate withSku(MySqlServerSku sku); + WithCreate withSku(Sku sku); } /** @@ -528,19 +510,6 @@ interface WithNetwork { */ WithCreate withNetwork(Network network); } - - /** - * The stage of the Server definition allowing to specify importSourceProperties. - */ - interface WithImportSourceProperties { - /** - * Specifies the importSourceProperties property: Source properties for import from storage.. - * - * @param importSourceProperties Source properties for import from storage. - * @return the next definition stage. - */ - WithCreate withImportSourceProperties(ImportSourceProperties importSourceProperties); - } } /** @@ -554,9 +523,9 @@ interface WithImportSourceProperties { * The template for Server update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, - UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithVersion, UpdateStages.WithStorage, - UpdateStages.WithBackup, UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, - UpdateStages.WithReplicationRole, UpdateStages.WithDataEncryption, UpdateStages.WithNetwork { + UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithStorage, UpdateStages.WithBackup, + UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, UpdateStages.WithReplicationRole, + UpdateStages.WithDataEncryption { /** * Executes the update request. * @@ -600,7 +569,7 @@ interface WithIdentity { * @param identity The cmk identity for the server. * @return the next definition stage. */ - Update withIdentity(MySqlServerIdentity identity); + Update withIdentity(Identity identity); } /** @@ -613,7 +582,7 @@ interface WithSku { * @param sku The SKU (pricing tier) of the server. * @return the next definition stage. */ - Update withSku(MySqlServerSku sku); + Update withSku(Sku sku); } /** @@ -629,19 +598,6 @@ interface WithAdministratorLoginPassword { Update withAdministratorLoginPassword(String administratorLoginPassword); } - /** - * The stage of the Server update allowing to specify version. - */ - interface WithVersion { - /** - * Specifies the version property: Server version.. - * - * @param version Server version. - * @return the next definition stage. - */ - Update withVersion(ServerVersion version); - } - /** * The stage of the Server update allowing to specify storage. */ @@ -719,19 +675,6 @@ interface WithDataEncryption { */ Update withDataEncryption(DataEncryption dataEncryption); } - - /** - * The stage of the Server update allowing to specify network. - */ - interface WithNetwork { - /** - * Specifies the network property: Network related properties of a server. - * - * @param network Network related properties of a server. - * @return the next definition stage. - */ - Update withNetwork(Network network); - } } /** @@ -767,31 +710,6 @@ interface WithNetwork { */ void failover(Context context); - /** - * Validate a deployment of high availability. - * - * @param parameters The required parameters for validation of high availability deployment. - * @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 high availability validation properties of a server along with {@link Response}. - */ - Response validateEstimateHighAvailabilityWithResponse( - HighAvailabilityValidationEstimationInner parameters, Context context); - - /** - * Validate a deployment of high availability. - * - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - HighAvailabilityValidationEstimation - validateEstimateHighAvailability(HighAvailabilityValidationEstimationInner parameters); - /** * Restarts a server. * @@ -848,25 +766,4 @@ Response validateEstimateHighAvailabilityW * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void stop(Context context); - - /** - * Resets GTID on a server. - * - * @param parameters The required parameters for resetting GTID on a 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. - */ - void resetGtid(ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param parameters The required parameters for resetting GTID on a 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. - */ - void resetGtid(ServerGtidSetParameter parameters, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java index 3dfbac3fbf41f..ebf551c81cc7a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java @@ -34,7 +34,7 @@ public interface ServerBackup { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java deleted file mode 100644 index d509184270d2c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of ServerBackupV2. - */ -public interface ServerBackupV2 { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the backupNameV2 property: Backup name. - * - * @return the backupNameV2 value. - */ - String backupNameV2(); - - /** - * Gets the backupType property: The backupType property. - * - * @return the backupType value. - */ - BackupType backupType(); - - /** - * Gets the completedTime property: Backup completed time (ISO8601 format). - * - * @return the completedTime value. - */ - OffsetDateTime completedTime(); - - /** - * Gets the source property: Backup source. - * - * @return the source value. - */ - String source(); - - /** - * Gets the provisioningState property: The provisioning state of backup resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner object. - * - * @return the inner object. - */ - ServerBackupV2Inner innerModel(); - - /** - * The entirety of the ServerBackupV2 definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ServerBackupV2 definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ServerBackupV2 definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); - } - - /** - * The stage of the ServerBackupV2 definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithBackupNameV2, DefinitionStages.WithBackupType, - DefinitionStages.WithCompletedTime, DefinitionStages.WithSource { - /** - * Executes the create request. - * - * @return the created resource. - */ - ServerBackupV2 create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ServerBackupV2 create(Context context); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify backupNameV2. - */ - interface WithBackupNameV2 { - /** - * Specifies the backupNameV2 property: Backup name. - * - * @param backupNameV2 Backup name. - * @return the next definition stage. - */ - WithCreate withBackupNameV2(String backupNameV2); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify backupType. - */ - interface WithBackupType { - /** - * Specifies the backupType property: The backupType property.. - * - * @param backupType The backupType property. - * @return the next definition stage. - */ - WithCreate withBackupType(BackupType backupType); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify completedTime. - */ - interface WithCompletedTime { - /** - * Specifies the completedTime property: Backup completed time (ISO8601 format).. - * - * @param completedTime Backup completed time (ISO8601 format). - * @return the next definition stage. - */ - WithCreate withCompletedTime(OffsetDateTime completedTime); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Backup source. - * - * @param source Backup source. - * @return the next definition stage. - */ - WithCreate withSource(String source); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2ListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2ListResult.java deleted file mode 100644 index c621d664bd245..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2ListResult.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import java.io.IOException; -import java.util.List; - -/** - * A list of server backups. - */ -@Fluent -public final class ServerBackupV2ListResult implements JsonSerializable { - /* - * The list of backups of a server. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of ServerBackupV2ListResult class. - */ - public ServerBackupV2ListResult() { - } - - /** - * Get the value property: The list of backups of a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of backups of a server. - * - * @param value the value value to set. - * @return the ServerBackupV2ListResult object itself. - */ - public ServerBackupV2ListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the ServerBackupV2ListResult object itself. - */ - public ServerBackupV2ListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerBackupV2ListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerBackupV2ListResult if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerBackupV2ListResult. - */ - public static ServerBackupV2ListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerBackupV2ListResult deserializedServerBackupV2ListResult = new ServerBackupV2ListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ServerBackupV2Inner.fromJson(reader1)); - deserializedServerBackupV2ListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedServerBackupV2ListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerBackupV2ListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java deleted file mode 100644 index 0287f392df4ee..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java +++ /dev/null @@ -1,156 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Server edition capabilities. - */ -@Immutable -public final class ServerEditionCapabilityV2 implements JsonSerializable { - /* - * Server edition name - */ - private String name; - - /* - * Default Sku name - */ - private String defaultSku; - - /* - * Default storage size - */ - private Integer defaultStorageSize; - - /* - * A list of supported storage editions - */ - private List supportedStorageEditions; - - /* - * A list of supported Skus - */ - private List supportedSkus; - - /** - * Creates an instance of ServerEditionCapabilityV2 class. - */ - public ServerEditionCapabilityV2() { - } - - /** - * Get the name property: Server edition name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the defaultSku property: Default Sku name. - * - * @return the defaultSku value. - */ - public String defaultSku() { - return this.defaultSku; - } - - /** - * Get the defaultStorageSize property: Default storage size. - * - * @return the defaultStorageSize value. - */ - public Integer defaultStorageSize() { - return this.defaultStorageSize; - } - - /** - * Get the supportedStorageEditions property: A list of supported storage editions. - * - * @return the supportedStorageEditions value. - */ - public List supportedStorageEditions() { - return this.supportedStorageEditions; - } - - /** - * Get the supportedSkus property: A list of supported Skus. - * - * @return the supportedSkus value. - */ - public List supportedSkus() { - return this.supportedSkus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedStorageEditions() != null) { - supportedStorageEditions().forEach(e -> e.validate()); - } - if (supportedSkus() != null) { - supportedSkus().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerEditionCapabilityV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerEditionCapabilityV2 if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerEditionCapabilityV2. - */ - public static ServerEditionCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerEditionCapabilityV2 deserializedServerEditionCapabilityV2 = new ServerEditionCapabilityV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedServerEditionCapabilityV2.name = reader.getString(); - } else if ("defaultSku".equals(fieldName)) { - deserializedServerEditionCapabilityV2.defaultSku = reader.getString(); - } else if ("defaultStorageSize".equals(fieldName)) { - deserializedServerEditionCapabilityV2.defaultStorageSize = reader.getNullable(JsonReader::getInt); - } else if ("supportedStorageEditions".equals(fieldName)) { - List supportedStorageEditions - = reader.readArray(reader1 -> StorageEditionCapability.fromJson(reader1)); - deserializedServerEditionCapabilityV2.supportedStorageEditions = supportedStorageEditions; - } else if ("supportedSkus".equals(fieldName)) { - List supportedSkus - = reader.readArray(reader1 -> SkuCapabilityV2.fromJson(reader1)); - deserializedServerEditionCapabilityV2.supportedSkus = supportedSkus; - } else { - reader.skipChildren(); - } - } - - return deserializedServerEditionCapabilityV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java index aca6576d3da23..5dbf0c2d69530 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java @@ -21,12 +21,12 @@ public final class ServerForUpdate implements JsonSerializable /* * The cmk identity for the server. */ - private MySqlServerIdentity identity; + private Identity identity; /* * The SKU (pricing tier) of the server. */ - private MySqlServerSku sku; + private Sku sku; /* * The properties that can be updated for a server. @@ -49,7 +49,7 @@ public ServerForUpdate() { * * @return the identity value. */ - public MySqlServerIdentity identity() { + public Identity identity() { return this.identity; } @@ -59,7 +59,7 @@ public MySqlServerIdentity identity() { * @param identity the identity value to set. * @return the ServerForUpdate object itself. */ - public ServerForUpdate withIdentity(MySqlServerIdentity identity) { + public ServerForUpdate withIdentity(Identity identity) { this.identity = identity; return this; } @@ -69,7 +69,7 @@ public ServerForUpdate withIdentity(MySqlServerIdentity identity) { * * @return the sku value. */ - public MySqlServerSku sku() { + public Sku sku() { return this.sku; } @@ -79,7 +79,7 @@ public MySqlServerSku sku() { * @param sku the sku value to set. * @return the ServerForUpdate object itself. */ - public ServerForUpdate withSku(MySqlServerSku sku) { + public ServerForUpdate withSku(Sku sku) { this.sku = sku; return this; } @@ -136,29 +136,6 @@ public ServerForUpdate withAdministratorLoginPassword(String administratorLoginP return this; } - /** - * Get the version property: Server version. - * - * @return the version value. - */ - public ServerVersion version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Set the version property: Server version. - * - * @param version the version value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withVersion(ServerVersion version) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withVersion(version); - return this; - } - /** * Get the storage property: Storage related properties of a server. * @@ -297,29 +274,6 @@ public ServerForUpdate withDataEncryption(DataEncryption dataEncryption) { return this; } - /** - * Get the network property: Network related properties of a server. - * - * @return the network value. - */ - public Network network() { - return this.innerProperties() == null ? null : this.innerProperties().network(); - } - - /** - * Set the network property: Network related properties of a server. - * - * @param network the network value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withNetwork(Network network) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withNetwork(network); - return this; - } - /** * Validates the instance. * @@ -366,9 +320,9 @@ public static ServerForUpdate fromJson(JsonReader jsonReader) throws IOException reader.nextToken(); if ("identity".equals(fieldName)) { - deserializedServerForUpdate.identity = MySqlServerIdentity.fromJson(reader); + deserializedServerForUpdate.identity = Identity.fromJson(reader); } else if ("sku".equals(fieldName)) { - deserializedServerForUpdate.sku = MySqlServerSku.fromJson(reader); + deserializedServerForUpdate.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedServerForUpdate.innerProperties = ServerPropertiesForUpdate.fromJson(reader); } else if ("tags".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java deleted file mode 100644 index 10512bcb2624f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Server Gtid set parameters. - */ -@Fluent -public final class ServerGtidSetParameter implements JsonSerializable { - /* - * The Gtid set of server. - */ - private String gtidSet; - - /** - * Creates an instance of ServerGtidSetParameter class. - */ - public ServerGtidSetParameter() { - } - - /** - * Get the gtidSet property: The Gtid set of server. - * - * @return the gtidSet value. - */ - public String gtidSet() { - return this.gtidSet; - } - - /** - * Set the gtidSet property: The Gtid set of server. - * - * @param gtidSet the gtidSet value to set. - * @return the ServerGtidSetParameter object itself. - */ - public ServerGtidSetParameter withGtidSet(String gtidSet) { - this.gtidSet = gtidSet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("gtidSet", this.gtidSet); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerGtidSetParameter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerGtidSetParameter if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerGtidSetParameter. - */ - public static ServerGtidSetParameter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerGtidSetParameter deserializedServerGtidSetParameter = new ServerGtidSetParameter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("gtidSet".equals(fieldName)) { - deserializedServerGtidSetParameter.gtidSet = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerGtidSetParameter; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java deleted file mode 100644 index fc9345c5772f9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java +++ /dev/null @@ -1,56 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The tier of the particular SKU, e.g. GeneralPurpose. - */ -public final class ServerSkuTier extends ExpandableStringEnum { - /** - * Static value Burstable for ServerSkuTier. - */ - public static final ServerSkuTier BURSTABLE = fromString("Burstable"); - - /** - * Static value GeneralPurpose for ServerSkuTier. - */ - public static final ServerSkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); - - /** - * Static value MemoryOptimized for ServerSkuTier. - */ - public static final ServerSkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); - - /** - * Creates a new instance of ServerSkuTier value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ServerSkuTier() { - } - - /** - * Creates or finds a ServerSkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServerSkuTier. - */ - public static ServerSkuTier fromString(String name) { - return fromString(name, ServerSkuTier.class); - } - - /** - * Gets known ServerSkuTier values. - * - * @return known ServerSkuTier values. - */ - public static Collection values() { - return values(ServerSkuTier.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java deleted file mode 100644 index 6e48a496ea46a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java +++ /dev/null @@ -1,81 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Server version capabilities. - */ -@Immutable -public final class ServerVersionCapabilityV2 implements JsonSerializable { - /* - * server version - */ - private String name; - - /** - * Creates an instance of ServerVersionCapabilityV2 class. - */ - public ServerVersionCapabilityV2() { - } - - /** - * Get the name property: server version. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerVersionCapabilityV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVersionCapabilityV2 if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerVersionCapabilityV2. - */ - public static ServerVersionCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVersionCapabilityV2 deserializedServerVersionCapabilityV2 = new ServerVersionCapabilityV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedServerVersionCapabilityV2.name = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVersionCapabilityV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java index 6d9e3a1ed37d4..5aac88dffc04f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; /** * Resource collection API of Servers. @@ -127,36 +126,6 @@ public interface Servers { */ void failover(String resourceGroupName, String serverName, Context context); - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @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 high availability validation properties of a server along with {@link Response}. - */ - Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context); - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - HighAvailabilityValidationEstimation validateEstimateHighAvailability(String resourceGroupName, String serverName, - HighAvailabilityValidationEstimationInner parameters); - /** * Restarts a server. * @@ -228,31 +197,6 @@ HighAvailabilityValidationEstimation validateEstimateHighAvailability(String res */ void stop(String resourceGroupName, String serverName, Context context); - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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. - */ - void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a 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. - */ - void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); - /** * Gets information about a server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java deleted file mode 100644 index 0065f5d5b0698..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of ServersMigrations. - */ -public interface ServersMigrations { - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server. - */ - Server cutoverMigration(String resourceGroupName, String serverName); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to 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 represents a server. - */ - Server cutoverMigration(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java similarity index 67% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java index 318f558a47e74..5efbc5715f435 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java @@ -16,7 +16,7 @@ * Billing information related properties of a server. */ @Fluent -public final class MySqlServerSku implements JsonSerializable { +public final class Sku implements JsonSerializable { /* * The name of the sku, e.g. Standard_D32s_v3. */ @@ -25,12 +25,12 @@ public final class MySqlServerSku implements JsonSerializable { /* * The tier of the particular SKU, e.g. GeneralPurpose. */ - private ServerSkuTier tier; + private SkuTier tier; /** - * Creates an instance of MySqlServerSku class. + * Creates an instance of Sku class. */ - public MySqlServerSku() { + public Sku() { } /** @@ -46,9 +46,9 @@ public String name() { * Set the name property: The name of the sku, e.g. Standard_D32s_v3. * * @param name the name value to set. - * @return the MySqlServerSku object itself. + * @return the Sku object itself. */ - public MySqlServerSku withName(String name) { + public Sku withName(String name) { this.name = name; return this; } @@ -58,7 +58,7 @@ public MySqlServerSku withName(String name) { * * @return the tier value. */ - public ServerSkuTier tier() { + public SkuTier tier() { return this.tier; } @@ -66,9 +66,9 @@ public ServerSkuTier tier() { * Set the tier property: The tier of the particular SKU, e.g. GeneralPurpose. * * @param tier the tier value to set. - * @return the MySqlServerSku object itself. + * @return the Sku object itself. */ - public MySqlServerSku withTier(ServerSkuTier tier) { + public Sku withTier(SkuTier tier) { this.tier = tier; return this; } @@ -80,16 +80,14 @@ public MySqlServerSku withTier(ServerSkuTier tier) { */ public void validate() { if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model MySqlServerSku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); } if (tier() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property tier in model MySqlServerSku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property tier in model Sku")); } } - private static final ClientLogger LOGGER = new ClientLogger(MySqlServerSku.class); + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); /** * {@inheritDoc} @@ -103,31 +101,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MySqlServerSku from the JsonReader. + * Reads an instance of Sku from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MySqlServerSku if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the MySqlServerSku. + * @throws IOException If an error occurs while reading the Sku. */ - public static MySqlServerSku fromJson(JsonReader jsonReader) throws IOException { + public static Sku fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - MySqlServerSku deserializedMySqlServerSku = new MySqlServerSku(); + Sku deserializedSku = new Sku(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("name".equals(fieldName)) { - deserializedMySqlServerSku.name = reader.getString(); + deserializedSku.name = reader.getString(); } else if ("tier".equals(fieldName)) { - deserializedMySqlServerSku.tier = ServerSkuTier.fromString(reader.getString()); + deserializedSku.tier = SkuTier.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedMySqlServerSku; + return deserializedSku; }); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java deleted file mode 100644 index f1efedfabda89..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java +++ /dev/null @@ -1,164 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Sku capability. - */ -@Immutable -public final class SkuCapabilityV2 implements JsonSerializable { - /* - * vCore name - */ - private String name; - - /* - * supported vCores - */ - private Long vCores; - - /* - * supported IOPS - */ - private Long supportedIops; - - /* - * supported memory per vCore in MB - */ - private Long supportedMemoryPerVCoreMB; - - /* - * Supported zones - */ - private List supportedZones; - - /* - * Supported high availability mode - */ - private List supportedHAMode; - - /** - * Creates an instance of SkuCapabilityV2 class. - */ - public SkuCapabilityV2() { - } - - /** - * Get the name property: vCore name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the vCores property: supported vCores. - * - * @return the vCores value. - */ - public Long vCores() { - return this.vCores; - } - - /** - * Get the supportedIops property: supported IOPS. - * - * @return the supportedIops value. - */ - public Long supportedIops() { - return this.supportedIops; - } - - /** - * Get the supportedMemoryPerVCoreMB property: supported memory per vCore in MB. - * - * @return the supportedMemoryPerVCoreMB value. - */ - public Long supportedMemoryPerVCoreMB() { - return this.supportedMemoryPerVCoreMB; - } - - /** - * Get the supportedZones property: Supported zones. - * - * @return the supportedZones value. - */ - public List supportedZones() { - return this.supportedZones; - } - - /** - * Get the supportedHAMode property: Supported high availability mode. - * - * @return the supportedHAMode value. - */ - public List supportedHAMode() { - return this.supportedHAMode; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SkuCapabilityV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuCapabilityV2 if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SkuCapabilityV2. - */ - public static SkuCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuCapabilityV2 deserializedSkuCapabilityV2 = new SkuCapabilityV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedSkuCapabilityV2.name = reader.getString(); - } else if ("vCores".equals(fieldName)) { - deserializedSkuCapabilityV2.vCores = reader.getNullable(JsonReader::getLong); - } else if ("supportedIops".equals(fieldName)) { - deserializedSkuCapabilityV2.supportedIops = reader.getNullable(JsonReader::getLong); - } else if ("supportedMemoryPerVCoreMB".equals(fieldName)) { - deserializedSkuCapabilityV2.supportedMemoryPerVCoreMB = reader.getNullable(JsonReader::getLong); - } else if ("supportedZones".equals(fieldName)) { - List supportedZones = reader.readArray(reader1 -> reader1.getString()); - deserializedSkuCapabilityV2.supportedZones = supportedZones; - } else if ("supportedHAMode".equals(fieldName)) { - List supportedHAMode = reader.readArray(reader1 -> reader1.getString()); - deserializedSkuCapabilityV2.supportedHAMode = supportedHAMode; - } else { - reader.skipChildren(); - } - } - - return deserializedSkuCapabilityV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java new file mode 100644 index 0000000000000..fbd0df4ca90dc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The tier of the particular SKU, e.g. GeneralPurpose. + */ +public final class SkuTier extends ExpandableStringEnum { + /** + * Static value Burstable for SkuTier. + */ + public static final SkuTier BURSTABLE = fromString("Burstable"); + + /** + * Static value GeneralPurpose for SkuTier. + */ + public static final SkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** + * Static value MemoryOptimized for SkuTier. + */ + public static final SkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Creates a new instance of SkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuTier() { + } + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * Gets known SkuTier values. + * + * @return known SkuTier values. + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java index d930e17505556..7f18171dd8628 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java @@ -31,21 +31,11 @@ public final class Storage implements JsonSerializable { */ private EnableStatusEnum autoGrow; - /* - * Enable Log On Disk or not. - */ - private EnableStatusEnum logOnDisk; - /* * The sku name of the server storage. */ private String storageSku; - /* - * Enable IO Auto Scaling or not. - */ - private EnableStatusEnum autoIoScaling; - /** * Creates an instance of Storage class. */ @@ -112,26 +102,6 @@ public Storage withAutoGrow(EnableStatusEnum autoGrow) { return this; } - /** - * Get the logOnDisk property: Enable Log On Disk or not. - * - * @return the logOnDisk value. - */ - public EnableStatusEnum logOnDisk() { - return this.logOnDisk; - } - - /** - * Set the logOnDisk property: Enable Log On Disk or not. - * - * @param logOnDisk the logOnDisk value to set. - * @return the Storage object itself. - */ - public Storage withLogOnDisk(EnableStatusEnum logOnDisk) { - this.logOnDisk = logOnDisk; - return this; - } - /** * Get the storageSku property: The sku name of the server storage. * @@ -141,26 +111,6 @@ public String storageSku() { return this.storageSku; } - /** - * Get the autoIoScaling property: Enable IO Auto Scaling or not. - * - * @return the autoIoScaling value. - */ - public EnableStatusEnum autoIoScaling() { - return this.autoIoScaling; - } - - /** - * Set the autoIoScaling property: Enable IO Auto Scaling or not. - * - * @param autoIoScaling the autoIoScaling value to set. - * @return the Storage object itself. - */ - public Storage withAutoIoScaling(EnableStatusEnum autoIoScaling) { - this.autoIoScaling = autoIoScaling; - return this; - } - /** * Validates the instance. * @@ -178,8 +128,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("storageSizeGB", this.storageSizeGB); jsonWriter.writeNumberField("iops", this.iops); jsonWriter.writeStringField("autoGrow", this.autoGrow == null ? null : this.autoGrow.toString()); - jsonWriter.writeStringField("logOnDisk", this.logOnDisk == null ? null : this.logOnDisk.toString()); - jsonWriter.writeStringField("autoIoScaling", this.autoIoScaling == null ? null : this.autoIoScaling.toString()); return jsonWriter.writeEndObject(); } @@ -204,12 +152,8 @@ public static Storage fromJson(JsonReader jsonReader) throws IOException { deserializedStorage.iops = reader.getNullable(JsonReader::getInt); } else if ("autoGrow".equals(fieldName)) { deserializedStorage.autoGrow = EnableStatusEnum.fromString(reader.getString()); - } else if ("logOnDisk".equals(fieldName)) { - deserializedStorage.logOnDisk = EnableStatusEnum.fromString(reader.getString()); } else if ("storageSku".equals(fieldName)) { deserializedStorage.storageSku = reader.getString(); - } else if ("autoIoScaling".equals(fieldName)) { - deserializedStorage.autoIoScaling = EnableStatusEnum.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java index 27b3970351046..df4a8a04e6796 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java @@ -41,16 +41,6 @@ public final class StorageEditionCapability implements JsonSerializable Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() - .getWithResponse("t", "ld", AdvancedThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java deleted file mode 100644 index b4db885ac9821..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionSettingsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"creationTime\":\"2021-03-27T20:00:22Z\",\"state\":\"Enabled\",\"provisioningState\":\"Failed\"},\"id\":\"fmzzsdymbrny\",\"name\":\"u\",\"type\":\"m\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.advancedThreatProtectionSettings() - .list("hihfrbbcevqagtlt", "hlfkqojpy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.iterator().next().state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java deleted file mode 100644 index 58ba3abc790f1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionSettingsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"creationTime\":\"2021-06-11T04:36:53Z\",\"state\":\"Enabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"dz\",\"name\":\"ezwwv\",\"type\":\"iqyuvvfo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() - .update("jlmxhomdynhd", "digumbnr", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java deleted file mode 100644 index 5766d7d914527..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionSettingsUpdatePutMockTests { - @Test - public void testUpdatePut() throws Exception { - String responseStr - = "{\"properties\":{\"creationTime\":\"2020-12-25T01:29:23Z\",\"state\":\"Disabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"mtk\",\"name\":\"bo\",\"type\":\"ppnvdxz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() - .updatePut("kphhq", "ikvylauya", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, response.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java deleted file mode 100644 index e084764290dc5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java +++ /dev/null @@ -1,27 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import org.junit.jupiter.api.Assertions; - -public final class AdvancedThreatProtectionUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdvancedThreatProtectionUpdateProperties model - = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(AdvancedThreatProtectionUpdateProperties.class); - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdvancedThreatProtectionUpdateProperties model - = new AdvancedThreatProtectionUpdateProperties().withState(AdvancedThreatProtectionState.ENABLED); - model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionUpdateProperties.class); - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java deleted file mode 100644 index a1398f0517633..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import org.junit.jupiter.api.Assertions; - -public final class AzureADAdministratorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureADAdministratorInner model = BinaryData.fromString( - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"uv\",\"sid\":\"xpyb\",\"tenantId\":\"m\",\"identityResourceId\":\"mtz\"},\"id\":\"bsphrupidgsybbe\",\"name\":\"hphoycm\",\"type\":\"xaobhdxbmtqioqjz\"}") - .toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("uv", model.login()); - Assertions.assertEquals("xpyb", model.sid()); - Assertions.assertEquals("m", model.tenantId()); - Assertions.assertEquals("mtz", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureADAdministratorInner model - = new AzureADAdministratorInner().withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("uv") - .withSid("xpyb") - .withTenantId("m") - .withIdentityResourceId("mtz"); - model = BinaryData.fromObject(model).toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("uv", model.login()); - Assertions.assertEquals("xpyb", model.sid()); - Assertions.assertEquals("m", model.tenantId()); - Assertions.assertEquals("mtz", model.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java deleted file mode 100644 index 4a036bf20a6d2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"qhhahhxvrhmzkwpj\",\"sid\":\"wspughftqsxhqx\",\"tenantId\":\"xukndxdigr\",\"identityResourceId\":\"uufzdmsyqtfihw\"},\"id\":\"otzi\",\"name\":\"gamv\",\"type\":\"phoszqz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = manager.azureADAdministrators() - .define(AdministratorName.ACTIVE_DIRECTORY) - .withExistingFlexibleServer("irgzp", "rlazszrnw") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("pwp") - .withSid("lwbtlhf") - .withTenantId("jcdh") - .withIdentityResourceId("fjvfbgofeljagr") - .create(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("qhhahhxvrhmzkwpj", response.login()); - Assertions.assertEquals("wspughftqsxhqx", response.sid()); - Assertions.assertEquals("xukndxdigr", response.tenantId()); - Assertions.assertEquals("uufzdmsyqtfihw", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java deleted file mode 100644 index cefb63240e106..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java +++ /dev/null @@ -1,36 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.azureADAdministrators() - .delete("tawfsdjpvkvp", "jxbkzbzkdvn", AdministratorName.ACTIVE_DIRECTORY, - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java deleted file mode 100644 index 53289cbb668ef..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"fhmouwq\",\"sid\":\"zrfze\",\"tenantId\":\"ebizikayuh\",\"identityResourceId\":\"bjbsybb\"},\"id\":\"r\",\"name\":\"t\",\"type\":\"dgmfpgvmpipasl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = manager.azureADAdministrators() - .getWithResponse("abudurgk", "kmokz", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("fhmouwq", response.login()); - Assertions.assertEquals("zrfze", response.sid()); - Assertions.assertEquals("ebizikayuh", response.tenantId()); - Assertions.assertEquals("bjbsybb", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java deleted file mode 100644 index c876e59637db5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"twbdsrezpdrhn\",\"sid\":\"yowqkdwytisibir\",\"tenantId\":\"pikpz\",\"identityResourceId\":\"ejzanlfz\"},\"id\":\"av\",\"name\":\"mbzonokix\",\"type\":\"jq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.azureADAdministrators().listByServer("haq", "x", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.iterator().next().administratorType()); - Assertions.assertEquals("twbdsrezpdrhn", response.iterator().next().login()); - Assertions.assertEquals("yowqkdwytisibir", response.iterator().next().sid()); - Assertions.assertEquals("pikpz", response.iterator().next().tenantId()); - Assertions.assertEquals("ejzanlfz", response.iterator().next().identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java deleted file mode 100644 index c324ccfed6eb2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportRequest model = BinaryData.fromString( - "{\"targetDetails\":{\"objectType\":\"BackupStoreDetails\"},\"backupSettings\":{\"backupName\":\"ixjsprozvcputeg\",\"backupFormat\":\"Raw\"}}") - .toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportRequest model = new BackupAndExportRequest() - .withBackupSettings( - new BackupSettings().withBackupName("ixjsprozvcputeg").withBackupFormat(BackupFormat.RAW)) - .withTargetDetails(new BackupStoreDetails()); - model = BinaryData.fromObject(model).toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java deleted file mode 100644 index 81dfd8a67f54f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseProperties model = BinaryData.fromString( - "{\"datasourceSizeInBytes\":1188445860245908260,\"dataTransferredInBytes\":5160558923391750551,\"backupMetadata\":\"fdosyg\"}") - .toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(1188445860245908260L, model.datasourceSizeInBytes()); - Assertions.assertEquals(5160558923391750551L, model.dataTransferredInBytes()); - Assertions.assertEquals("fdosyg", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseProperties model - = new BackupAndExportResponseProperties().withDatasourceSizeInBytes(1188445860245908260L) - .withDataTransferredInBytes(5160558923391750551L) - .withBackupMetadata("fdosyg"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(1188445860245908260L, model.datasourceSizeInBytes()); - Assertions.assertEquals(5160558923391750551L, model.dataTransferredInBytes()); - Assertions.assertEquals("fdosyg", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java deleted file mode 100644 index e018f219e1ec7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponseType; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponseTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseType model = BinaryData.fromString( - "{\"objectType\":\"BackupAndExportResponse\",\"datasourceSizeInBytes\":6258392064517057846,\"dataTransferredInBytes\":2176235645270803384,\"backupMetadata\":\"jivfxzsjabib\"}") - .toObject(BackupAndExportResponseType.class); - Assertions.assertEquals(6258392064517057846L, model.datasourceSizeInBytes()); - Assertions.assertEquals(2176235645270803384L, model.dataTransferredInBytes()); - Assertions.assertEquals("jivfxzsjabib", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseType model - = new BackupAndExportResponseType().withDatasourceSizeInBytes(6258392064517057846L) - .withDataTransferredInBytes(2176235645270803384L) - .withBackupMetadata("jivfxzsjabib"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseType.class); - Assertions.assertEquals(6258392064517057846L, model.datasourceSizeInBytes()); - Assertions.assertEquals(2176235645270803384L, model.dataTransferredInBytes()); - Assertions.assertEquals("jivfxzsjabib", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java deleted file mode 100644 index ac8c1cef8647c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java +++ /dev/null @@ -1,38 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupAndExportsValidateBackupWithResponseMockTests { - @Test - public void testValidateBackupWithResponse() throws Exception { - String responseStr = "{\"properties\":{\"numberOfContainers\":488471027}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateBackupResponse response = manager.backupAndExports() - .validateBackupWithResponse("wz", "bnhlmc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(488471027, response.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java deleted file mode 100644 index 9d4402068254f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupRequestBase; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupRequestBase model - = BinaryData.fromString("{\"backupSettings\":{\"backupName\":\"mfdatscmdvpj\",\"backupFormat\":\"Raw\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model = new BackupRequestBase() - .withBackupSettings(new BackupSettings().withBackupName("mfdatscmdvpj").withBackupFormat(BackupFormat.RAW)); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java deleted file mode 100644 index dc90d09ba0a94..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupSettings model = BinaryData.fromString("{\"backupName\":\"suuv\",\"backupFormat\":\"Raw\"}") - .toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = new BackupSettings().withBackupName("suuv").withBackupFormat(BackupFormat.RAW); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java deleted file mode 100644 index 730d5eb543acd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java +++ /dev/null @@ -1,22 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; - -public final class BackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupStoreDetails model - = BinaryData.fromString("{\"objectType\":\"BackupStoreDetails\"}").toObject(BackupStoreDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupStoreDetails model = new BackupStoreDetails(); - model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java index 7bcb2b458b9fd..580e8f2baf6fa 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java @@ -13,21 +13,18 @@ public final class BackupTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Backup model = BinaryData.fromString( - "{\"backupRetentionDays\":1913635803,\"backupIntervalHours\":1733107709,\"geoRedundantBackup\":\"Enabled\",\"earliestRestoreDate\":\"2021-11-26T04:57:33Z\"}") + "{\"backupRetentionDays\":1950851050,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-01-21T08:28Z\"}") .toObject(Backup.class); - Assertions.assertEquals(1913635803, model.backupRetentionDays()); - Assertions.assertEquals(1733107709, model.backupIntervalHours()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.geoRedundantBackup()); + Assertions.assertEquals(1950851050, model.backupRetentionDays()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Backup model = new Backup().withBackupRetentionDays(1913635803) - .withBackupIntervalHours(1733107709) - .withGeoRedundantBackup(EnableStatusEnum.ENABLED); + Backup model + = new Backup().withBackupRetentionDays(1950851050).withGeoRedundantBackup(EnableStatusEnum.DISABLED); model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(1913635803, model.backupRetentionDays()); - Assertions.assertEquals(1733107709, model.backupIntervalHours()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.geoRedundantBackup()); + Assertions.assertEquals(1950851050, model.backupRetentionDays()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java index faa224e72a328..796a3b346271e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class BackupsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"backupType\":\"vezrypqlmfeo\",\"completedTime\":\"2021-08-09T08:39:34Z\",\"source\":\"wkyhkobopgxe\"},\"id\":\"owepbqpcrfkb\",\"name\":\"ccsnjvcdwxlpq\",\"type\":\"kftnkhtjsyin\"}"; + = "{\"properties\":{\"backupType\":\"xdbabphlwr\",\"completedTime\":\"2021-04-06T00:21:45Z\",\"source\":\"tsthsucocm\"},\"id\":\"yazttbtwwrqpue\",\"name\":\"ckzywbiexzfeyue\",\"type\":\"xibxujwbhqwalm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); ServerBackup response = manager.backups() - .getWithResponse("wzrmuh", "pfcqdp", "qxqvpsvuoymgc", com.azure.core.util.Context.NONE) + .getWithResponse("tnrsyn", "qidybyx", "zfcl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vezrypqlmfeo", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T08:39:34Z"), response.completedTime()); - Assertions.assertEquals("wkyhkobopgxe", response.source()); + Assertions.assertEquals("xdbabphlwr", response.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T00:21:45Z"), response.completedTime()); + Assertions.assertEquals("tsthsucocm", response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java index b79494451f0ba..4d049487e9846 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java @@ -22,7 +22,7 @@ public final class BackupsListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"backupType\":\"kbir\",\"completedTime\":\"2021-03-20T05:32:50Z\",\"source\":\"hlhkjoqrvqqaatj\"},\"id\":\"rv\",\"name\":\"oupmfii\",\"type\":\"fggjioolvr\"}]}"; + = "{\"value\":[{\"properties\":{\"backupType\":\"wbavxbniwdj\",\"completedTime\":\"2021-04-13T19:54:16Z\",\"source\":\"s\"},\"id\":\"pgn\",\"name\":\"ytxhp\",\"type\":\"xbzpfzab\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testListByServer() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.backups().listByServer("wfqatmtd", "tmdvypgikdgs", com.azure.core.util.Context.NONE); + = manager.backups().listByServer("zyoxaepdkzjan", "ux", com.azure.core.util.Context.NONE); - Assertions.assertEquals("kbir", response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T05:32:50Z"), + Assertions.assertEquals("wbavxbniwdj", response.iterator().next().backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T19:54:16Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("hlhkjoqrvqqaatj", response.iterator().next().source()); + Assertions.assertEquals("s", response.iterator().next().source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java deleted file mode 100644 index ed58fb84427f6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"backupType\":\"vyqia\",\"completedTime\":\"2021-01-15T03:57:36Z\",\"source\":\"pcnp\"},\"id\":\"cjaesgvvs\",\"name\":\"cyajguqf\",\"type\":\"wygzlvdnkfxusem\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = manager.backups() - .putWithResponse("dphqamv", "kfwynw", "vtbvkayh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vyqia", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T03:57:36Z"), response.completedTime()); - Assertions.assertEquals("pcnp", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java index 0669ab7d54b96..105432f72b679 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java @@ -11,7 +11,7 @@ public final class CapabilitiesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilitiesListResult model = BinaryData.fromString( - "{\"value\":[{\"zone\":\"zycispn\",\"supportedHAMode\":[\"hmgkbrpyy\",\"hibnuqqkpika\"],\"supportedGeoBackupRegions\":[\"vtq\",\"gnbuy\",\"hijggme\"],\"supportedFlexibleServerEditions\":[{\"name\":\"arbu\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{}]},{\"name\":\"azzmhjrunmpxt\",\"supportedStorageEditions\":[{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"nlankxmyskpb\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]}]}],\"nextLink\":\"cxy\"}") + "{\"value\":[{\"zone\":\"kexxppof\",\"supportedHAMode\":[\"x\",\"fjpgddtocjjxhvp\",\"o\",\"exhd\"],\"supportedGeoBackupRegions\":[\"bqe\"],\"supportedFlexibleServerEditions\":[{\"name\":\"qbzvddntwnd\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"npzaoq\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"f\",\"supportedStorageEditions\":[{}],\"supportedServerVersions\":[{},{},{}]}]},{\"zone\":\"lmjthjq\",\"supportedHAMode\":[\"yeicxmqciwqvhk\",\"ixuigdtopbobj\"],\"supportedGeoBackupRegions\":[\"m\"],\"supportedFlexibleServerEditions\":[{\"name\":\"m\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{}]}]}],\"nextLink\":\"yvvtpgvdfgio\"}") .toObject(CapabilitiesListResult.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java deleted file mode 100644 index 8f6d6e53eba77..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; - -public final class CapabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityInner model = BinaryData.fromString( - "{\"properties\":{\"supportedGeoBackupRegions\":[\"dxwitx\"],\"supportedFlexibleServerEditions\":[{\"name\":\"wgqwgxhn\",\"defaultSku\":\"kxfbkpycgklwndn\",\"defaultStorageSize\":1205583230,\"supportedStorageEditions\":[{\"name\":\"hvylwzbt\",\"minStorageSize\":3335905424967181903,\"maxStorageSize\":5441871026164197951,\"minBackupRetentionDays\":9120098526772116433,\"maxBackupRetentionDays\":133246775143239397,\"minBackupIntervalHours\":8891221399810858011,\"maxBackupIntervalHours\":4938464628745807464},{\"name\":\"eualupjmkhf\",\"minStorageSize\":3301190446287542210,\"maxStorageSize\":1475779972366024488,\"minBackupRetentionDays\":4801244624659706170,\"maxBackupRetentionDays\":4282365131498375699,\"minBackupIntervalHours\":6365988456807659162,\"maxBackupIntervalHours\":7508041016656443291},{\"name\":\"wtgh\",\"minStorageSize\":4480218373622074054,\"maxStorageSize\":1248291372184779781,\"minBackupRetentionDays\":5418002986537845043,\"maxBackupRetentionDays\":692631569824073211,\"minBackupIntervalHours\":9032907208555956547,\"maxBackupIntervalHours\":4855611501955594368},{\"name\":\"btn\",\"minStorageSize\":8168827985153452849,\"maxStorageSize\":5406292049482807684,\"minBackupRetentionDays\":9167362709610232735,\"maxBackupRetentionDays\":6525239708045322977,\"minBackupIntervalHours\":7151462329487158065,\"maxBackupIntervalHours\":6136339981043942378}],\"supportedSkus\":[{\"name\":\"gwyzm\",\"vCores\":8423964713618805979,\"supportedIops\":8960971107785160729,\"supportedMemoryPerVCoreMB\":3572252614282926056,\"supportedZones\":[\"cbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\",\"bexrmcq\"],\"supportedHAMode\":[\"cnojvknmefqsg\",\"vah\",\"pjyzhpv\",\"qzcjrvxdj\"]},{\"name\":\"mwlxk\",\"vCores\":8451132931226635993,\"supportedIops\":8948733559998471922,\"supportedMemoryPerVCoreMB\":6856642650959955968,\"supportedZones\":[\"zunlu\",\"hnnpr\",\"xipeilpjzuaejx\",\"ultskzbbtdz\"],\"supportedHAMode\":[\"e\",\"kgpwoz\",\"hkfpbs\",\"yofd\"]},{\"name\":\"uusdttouwa\",\"vCores\":8365704524222172400,\"supportedIops\":108645290116886503,\"supportedMemoryPerVCoreMB\":2699583635820054770,\"supportedZones\":[\"vbxwyjsflhh\"],\"supportedHAMode\":[\"lnjixisxya\"]}]},{\"name\":\"oyaqcslyjpkiid\",\"defaultSku\":\"exznelixhnr\",\"defaultStorageSize\":644635434,\"supportedStorageEditions\":[{\"name\":\"bnxknalaulppg\",\"minStorageSize\":8537474704908454871,\"maxStorageSize\":5149418490652934677,\"minBackupRetentionDays\":6445741537137473269,\"maxBackupRetentionDays\":7517503656775424408,\"minBackupIntervalHours\":5108796098292798355,\"maxBackupIntervalHours\":5284833703695885613},{\"name\":\"gylgqgitxmedjvcs\",\"minStorageSize\":315217649899212778,\"maxStorageSize\":6527904541779250049,\"minBackupRetentionDays\":3372205995909078044,\"maxBackupRetentionDays\":2313446192917643442,\"minBackupIntervalHours\":4093757027555713253,\"maxBackupIntervalHours\":6364378757262685424}],\"supportedSkus\":[{\"name\":\"apkteoellwptfdyg\",\"vCores\":4189677250965468268,\"supportedIops\":1621994351674627524,\"supportedMemoryPerVCoreMB\":2230780242905097780,\"supportedZones\":[\"qrhhu\",\"opppcqeq\",\"ol\"],\"supportedHAMode\":[\"hzxct\",\"bgbkdmoizpost\",\"grcfb\"]},{\"name\":\"rmfqjhhkxbpvj\",\"vCores\":7630037301947416018,\"supportedIops\":1509248183766128687,\"supportedMemoryPerVCoreMB\":839547414401646019,\"supportedZones\":[\"ivkrtsw\",\"xqzvszjfa\"],\"supportedHAMode\":[\"fdxxivetvtcqaqtd\"]},{\"name\":\"mcbxvwvxysl\",\"vCores\":2902711033817845170,\"supportedIops\":1129786436342039782,\"supportedMemoryPerVCoreMB\":2977681561409094554,\"supportedZones\":[\"blmpewww\"],\"supportedHAMode\":[\"rvrnsvshqjohxc\",\"sbfov\"]}]}],\"supportedServerVersions\":[{\"name\":\"uvwbhsqfs\"},{\"name\":\"cgjbirxbp\"},{\"name\":\"srfbjfdtwss\"}]},\"id\":\"ftpvjzbexil\",\"name\":\"znfqqnvwpmqtar\",\"type\":\"oujmkcjhwqytj\"}") - .toObject(CapabilityInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityInner model = new CapabilityInner(); - model = BinaryData.fromObject(model).toObject(CapabilityInner.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java index 8c9c4acd3e491..23fabe73fe6c6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java @@ -11,7 +11,7 @@ public final class CapabilityPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilityPropertiesInner model = BinaryData.fromString( - "{\"zone\":\"y\",\"supportedHAMode\":[\"synlqidybyxczfc\"],\"supportedGeoBackupRegions\":[\"axdbabph\",\"wrqlfktsthsuco\",\"mnyyazt\",\"bt\"],\"supportedFlexibleServerEditions\":[{\"name\":\"puedckzywbiexzf\",\"supportedStorageEditions\":[{\"name\":\"axibxujw\",\"minStorageSize\":6825122128576329936,\"maxStorageSize\":5077177029124630587,\"minBackupRetentionDays\":4821082223595321199,\"maxBackupRetentionDays\":6581700194330598875,\"minBackupIntervalHours\":3002964049994364759,\"maxBackupIntervalHours\":8317150744706816550}],\"supportedServerVersions\":[{\"name\":\"ux\",\"supportedSkus\":[{}]},{\"name\":\"bavxbniwdjswzt\",\"supportedSkus\":[{}]},{\"name\":\"gnxytxhpzxbz\",\"supportedSkus\":[{},{},{}]}]}]}") + "{\"zone\":\"ftutqxlngxlefgu\",\"supportedHAMode\":[\"krxd\",\"mi\"],\"supportedGeoBackupRegions\":[\"hzrvqd\"],\"supportedFlexibleServerEditions\":[{\"name\":\"jybige\",\"supportedStorageEditions\":[{\"name\":\"bowsk\",\"minStorageSize\":4187351799054769848,\"maxStorageSize\":8321881464692032483,\"minBackupRetentionDays\":450756782993701005,\"maxBackupRetentionDays\":5423629655028728584},{\"name\":\"ywgndrv\",\"minStorageSize\":9186245080720246611,\"maxStorageSize\":1284533525863803675,\"minBackupRetentionDays\":4712637840273391271,\"maxBackupRetentionDays\":7340674686507262093}],\"supportedServerVersions\":[{\"name\":\"pec\",\"supportedSkus\":[{}]},{\"name\":\"coofsxlzev\",\"supportedSkus\":[{}]},{\"name\":\"jqabcypmivkwlzuv\",\"supportedSkus\":[{},{}]}]}]}") .toObject(CapabilityPropertiesInner.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java deleted file mode 100644 index ae0e0f949d9f3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesV2; - -public final class CapabilityPropertiesV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityPropertiesV2 model = BinaryData.fromString( - "{\"supportedGeoBackupRegions\":[\"n\"],\"supportedFlexibleServerEditions\":[{\"name\":\"gdrjervnaenqpe\",\"defaultSku\":\"ndoygmifthnzdnd\",\"defaultStorageSize\":962281735,\"supportedStorageEditions\":[{\"name\":\"qig\",\"minStorageSize\":1427620858530935166,\"maxStorageSize\":8642059696861181136,\"minBackupRetentionDays\":5173080348817508321,\"maxBackupRetentionDays\":5682368071850928759,\"minBackupIntervalHours\":4798554753544552849,\"maxBackupIntervalHours\":8390013026245928421},{\"name\":\"gycdu\",\"minStorageSize\":766659448073134411,\"maxStorageSize\":5983692847651607240,\"minBackupRetentionDays\":7165810433952097400,\"maxBackupRetentionDays\":218788129440257069,\"minBackupIntervalHours\":2513887765446717369,\"maxBackupIntervalHours\":1053709421770726696},{\"name\":\"mmdnbbglzps\",\"minStorageSize\":5564635396435851396,\"maxStorageSize\":1234182854379113397,\"minBackupRetentionDays\":2986988161676305406,\"maxBackupRetentionDays\":3868778507667885775,\"minBackupIntervalHours\":5645412032437353957,\"maxBackupIntervalHours\":5470431238820396350}],\"supportedSkus\":[{\"name\":\"fznudaodvxzb\",\"vCores\":1564863042825261686,\"supportedIops\":6314298447266577178,\"supportedMemoryPerVCoreMB\":4154359310176459322,\"supportedZones\":[\"hxsrzdzucersc\"],\"supportedHAMode\":[\"nevf\"]},{\"name\":\"jmygtdsslswtmwer\",\"vCores\":2319180534572952806,\"supportedIops\":7993353797121101484,\"supportedMemoryPerVCoreMB\":8502248453767637112,\"supportedZones\":[\"bnetshh\",\"zhedplvwiw\"],\"supportedHAMode\":[\"wmbesldnkw\",\"tppjflcx\"]},{\"name\":\"aokonzmnsik\",\"vCores\":4352288907832795001,\"supportedIops\":2625319933705965301,\"supportedMemoryPerVCoreMB\":4891735483783264620,\"supportedZones\":[\"fzxmhhvhgureodkw\"],\"supportedHAMode\":[\"agxti\",\"qdxbxwa\",\"bogqxndlkzgxhu\"]},{\"name\":\"plbpodxun\",\"vCores\":1740102742322747396,\"supportedIops\":7282370910524293112,\"supportedMemoryPerVCoreMB\":5789185793221344217,\"supportedZones\":[\"wlrbqtkoievseo\",\"gqrlltmuwla\"],\"supportedHAMode\":[\"izxbmpgcjef\",\"zmuvpbttdumorppx\",\"bmnzbtbhjpgl\"]}]},{\"name\":\"gohdneuelfphsd\",\"defaultSku\":\"t\",\"defaultStorageSize\":223656030,\"supportedStorageEditions\":[{\"name\":\"owwquuvxz\",\"minStorageSize\":6214959618688242083,\"maxStorageSize\":5272627491576584483,\"minBackupRetentionDays\":6465268745370114488,\"maxBackupRetentionDays\":2144640656240762223,\"minBackupIntervalHours\":2524808261528080597,\"maxBackupIntervalHours\":3202643871738398151}],\"supportedSkus\":[{\"name\":\"wdsjnkalju\",\"vCores\":4944685452793755609,\"supportedIops\":8223750660917060648,\"supportedMemoryPerVCoreMB\":8486438671495128315,\"supportedZones\":[\"zzewkfvhqcrai\"],\"supportedHAMode\":[\"n\",\"pfuflrw\"]},{\"name\":\"hdlxyjrxsagafcn\",\"vCores\":3356824061163345093,\"supportedIops\":3473341415341754337,\"supportedMemoryPerVCoreMB\":2722432459544366405,\"supportedZones\":[\"bcvkcvqvpkeq\"],\"supportedHAMode\":[\"drhvoodsotbo\",\"zdopcjwvnhd\"]},{\"name\":\"wmgxcxrsl\",\"vCores\":4609069884543966713,\"supportedIops\":7040134278923407185,\"supportedMemoryPerVCoreMB\":4150565343365520377,\"supportedZones\":[\"hjwniyqsluic\",\"dggkzzlvmbmpa\"],\"supportedHAMode\":[\"dfvue\",\"yw\",\"bpfvm\"]},{\"name\":\"hrfou\",\"vCores\":4811650617060953950,\"supportedIops\":5921863254735243053,\"supportedMemoryPerVCoreMB\":7140764207385351369,\"supportedZones\":[\"vqtmnub\",\"xkp\",\"ksmond\"],\"supportedHAMode\":[\"uxvypomgkopkwh\",\"jvp\",\"jqg\"]}]},{\"name\":\"smocmbq\",\"defaultSku\":\"vmkcx\",\"defaultStorageSize\":1061947770,\"supportedStorageEditions\":[{\"name\":\"elxprglyatddck\",\"minStorageSize\":1605920653761823709,\"maxStorageSize\":7850386713816708447,\"minBackupRetentionDays\":3070743576677662051,\"maxBackupRetentionDays\":2629967509256369573,\"minBackupIntervalHours\":3405568102133288247,\"maxBackupIntervalHours\":3019773513658765057},{\"name\":\"sdqrhzoymibmrq\",\"minStorageSize\":5977240495404401854,\"maxStorageSize\":8539790193753290872,\"minBackupRetentionDays\":3859662575119335920,\"maxBackupRetentionDays\":7176903777537856658,\"minBackupIntervalHours\":5665928384383195367,\"maxBackupIntervalHours\":7740523087334543020},{\"name\":\"yyv\",\"minStorageSize\":5748246004762300961,\"maxStorageSize\":3645438525729002905,\"minBackupRetentionDays\":3596857482537932759,\"maxBackupRetentionDays\":1477566052149971065,\"minBackupIntervalHours\":2878415356343371962,\"maxBackupIntervalHours\":6217672492639104016},{\"name\":\"ashrt\",\"minStorageSize\":1151592632214539496,\"maxStorageSize\":3530483379804377024,\"minBackupRetentionDays\":8989578588874797078,\"maxBackupRetentionDays\":3970058282735667200,\"minBackupIntervalHours\":2291924082393091786,\"maxBackupIntervalHours\":4256703090352932350}],\"supportedSkus\":[{\"name\":\"ipqiiobyuqerpq\",\"vCores\":9153525245739477269,\"supportedIops\":8381194936769139880,\"supportedMemoryPerVCoreMB\":8353822306247184184,\"supportedZones\":[\"butauvfb\",\"kuwhh\",\"hykojoxafnndlpic\",\"koymkcd\"],\"supportedHAMode\":[\"pkkpw\",\"reqnovvqfov\",\"jxywsuws\"]},{\"name\":\"s\",\"vCores\":4579993960866529408,\"supportedIops\":164789879294916168,\"supportedMemoryPerVCoreMB\":8488213744236915877,\"supportedZones\":[\"ea\",\"neqn\",\"arrwlquu\",\"jfqka\"],\"supportedHAMode\":[\"iipfpubj\",\"bwwift\"]}]}],\"supportedServerVersions\":[{\"name\":\"vpuvks\"},{\"name\":\"lsa\"},{\"name\":\"ynfs\"},{\"name\":\"ljphuopxodl\"}]}") - .toObject(CapabilityPropertiesV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesV2 model = new CapabilityPropertiesV2(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java deleted file mode 100644 index 691f328769e21..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitySetsList; - -public final class CapabilitySetsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitySetsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"supportedGeoBackupRegions\":[\"b\",\"e\"],\"supportedFlexibleServerEditions\":[{\"name\":\"k\",\"defaultSku\":\"ali\",\"defaultStorageSize\":12612409,\"supportedStorageEditions\":[{},{},{}],\"supportedSkus\":[{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"ashsfwxos\"},{\"name\":\"z\"},{\"name\":\"ugicjooxdjebw\"}]},\"id\":\"cwwfvovbvme\",\"name\":\"ecivyh\",\"type\":\"ce\"}],\"nextLink\":\"jgjrwjueiotwm\"}") - .toObject(CapabilitySetsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitySetsList model = new CapabilitySetsList(); - model = BinaryData.fromObject(model).toObject(CapabilitySetsList.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java index a1ee5bb40ff9e..89d5527c1a454 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"message\":\"vftjuhd\",\"nameAvailable\":true,\"reason\":\"mtggu\"}"; + String responseStr = "{\"message\":\"mocmbqfqvmk\",\"nameAvailable\":false,\"reason\":\"apvhelxprgly\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,12 +31,12 @@ public void testExecuteWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); NameAvailability response = manager.checkNameAvailabilities() - .executeWithResponse("mbcxfhbcp", new NameAvailabilityRequest().withName("rxvxcjzh").withType("zxfpxtgqsc"), + .executeWithResponse("mond", new NameAvailabilityRequest().withName("mquxvypo").withType("kopkwhojvpajqgx"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vftjuhd", response.message()); - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("mtggu", response.reason()); + Assertions.assertEquals("mocmbqfqvmk", response.message()); + Assertions.assertEquals(false, response.nameAvailable()); + Assertions.assertEquals("apvhelxprgly", response.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java index c4cecf658b29a..8a90eb62c7a45 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"message\":\"vyi\",\"nameAvailable\":false,\"reason\":\"dfvpg\"}"; + String responseStr = "{\"message\":\"sdqrhzoymibmrq\",\"nameAvailable\":false,\"reason\":\"hwflu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,12 +31,12 @@ public void testExecuteWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); NameAvailability response = manager.checkNameAvailabilityWithoutLocations() - .executeWithResponse(new NameAvailabilityRequest().withName("pijrajcivmmghf").withType("iwrxgkn"), + .executeWithResponse(new NameAvailabilityRequest().withName("tddckcb").withType("ejrjxgciqibrho"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vyi", response.message()); + Assertions.assertEquals("sdqrhzoymibmrq", response.message()); Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("dfvpg", response.reason()); + Assertions.assertEquals("hwflu", response.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java index ca2fa3dadf555..38a04e28c3a59 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { String responseStr - = "{\"location\":\"hlf\",\"subscriptionId\":\"wpchwahf\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"nfepgf\",\"usage\":1851396648069747872},{\"subnetName\":\"l\",\"usage\":1627173261577825656},{\"subnetName\":\"xykxhdj\",\"usage\":6091189064792747688}]}"; + = "{\"location\":\"gk\",\"subscriptionId\":\"lvmbmpaxmodfvuef\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"pfvmwyhrfou\",\"usage\":4811650617060953950},{\"subnetName\":\"kcpwiy\",\"usage\":3618670144532110213},{\"subnetName\":\"nubexk\",\"usage\":6799001413428276597}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,8 +31,8 @@ public void testExecuteWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); VirtualNetworkSubnetUsageResult response = manager.checkVirtualNetworkSubnetUsages() - .executeWithResponse("eazulcs", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("hwwn"), + .executeWithResponse("khjwn", + new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("qsluicp"), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java index d75fac0d10425..f20e37171ed82 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java @@ -12,18 +12,18 @@ public final class ConfigurationForBatchUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationForBatchUpdateProperties model - = BinaryData.fromString("{\"value\":\"erkujys\",\"source\":\"eju\"}") + = BinaryData.fromString("{\"value\":\"u\",\"source\":\"krlkhbzhfepg\"}") .toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("erkujys", model.value()); - Assertions.assertEquals("eju", model.source()); + Assertions.assertEquals("u", model.value()); + Assertions.assertEquals("krlkhbzhfepg", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConfigurationForBatchUpdateProperties model - = new ConfigurationForBatchUpdateProperties().withValue("erkujys").withSource("eju"); + = new ConfigurationForBatchUpdateProperties().withValue("u").withSource("krlkhbzhfepg"); model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("erkujys", model.value()); - Assertions.assertEquals("eju", model.source()); + Assertions.assertEquals("u", model.value()); + Assertions.assertEquals("krlkhbzhfepg", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java index 33ab147775113..dd5a85dbf85f6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java @@ -11,22 +11,23 @@ public final class ConfigurationForBatchUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ConfigurationForBatchUpdate model = BinaryData.fromString( - "{\"name\":\"bmbexppbhtqqro\",\"properties\":{\"value\":\"fpsalgbqu\",\"source\":\"gjyjgzjaoyfhrtxi\"}}") + ConfigurationForBatchUpdate model = BinaryData + .fromString( + "{\"name\":\"hurzafblj\",\"properties\":{\"value\":\"btoqcjmkljavbqid\",\"source\":\"ajzyul\"}}") .toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("bmbexppbhtqqro", model.name()); - Assertions.assertEquals("fpsalgbqu", model.value()); - Assertions.assertEquals("gjyjgzjaoyfhrtxi", model.source()); + Assertions.assertEquals("hurzafblj", model.name()); + Assertions.assertEquals("btoqcjmkljavbqid", model.value()); + Assertions.assertEquals("ajzyul", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationForBatchUpdate model = new ConfigurationForBatchUpdate().withName("bmbexppbhtqqro") - .withValue("fpsalgbqu") - .withSource("gjyjgzjaoyfhrtxi"); + ConfigurationForBatchUpdate model = new ConfigurationForBatchUpdate().withName("hurzafblj") + .withValue("btoqcjmkljavbqid") + .withSource("ajzyul"); model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("bmbexppbhtqqro", model.name()); - Assertions.assertEquals("fpsalgbqu", model.value()); - Assertions.assertEquals("gjyjgzjaoyfhrtxi", model.source()); + Assertions.assertEquals("hurzafblj", model.name()); + Assertions.assertEquals("btoqcjmkljavbqid", model.value()); + Assertions.assertEquals("ajzyul", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java index 5d97b6dcf483b..07fd51c8d22e5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java @@ -13,21 +13,18 @@ public final class ConfigurationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationInner model = BinaryData.fromString( - "{\"properties\":{\"value\":\"xxwr\",\"currentValue\":\"douskcqvkocrcjdk\",\"description\":\"nh\",\"documentationLink\":\"njbiksqrglssain\",\"defaultValue\":\"jwnzlljfmp\",\"dataType\":\"ebvmgxsabkyqd\",\"allowedValues\":\"jitcjczdzevn\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"dsbdkvwrwjf\",\"name\":\"usnhutje\",\"type\":\"tmrldhugjzzdatq\"}") + "{\"properties\":{\"value\":\"ujysvle\",\"description\":\"vfqawrlyxwjkcpr\",\"defaultValue\":\"wbxgjvt\",\"dataType\":\"p\",\"allowedValues\":\"szdnr\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"qfprwzwbn\",\"name\":\"uitnwuiz\",\"type\":\"a\"}") .toObject(ConfigurationInner.class); - Assertions.assertEquals("xxwr", model.value()); - Assertions.assertEquals("douskcqvkocrcjdk", model.currentValue()); + Assertions.assertEquals("ujysvle", model.value()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationInner model = new ConfigurationInner().withValue("xxwr") - .withCurrentValue("douskcqvkocrcjdk") - .withSource(ConfigurationSource.SYSTEM_DEFAULT); + ConfigurationInner model + = new ConfigurationInner().withValue("ujysvle").withSource(ConfigurationSource.SYSTEM_DEFAULT); model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("xxwr", model.value()); - Assertions.assertEquals("douskcqvkocrcjdk", model.currentValue()); + Assertions.assertEquals("ujysvle", model.value()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java index c1a10ee01c6c7..b9b419db46234 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java @@ -7,7 +7,6 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -15,26 +14,23 @@ public final class ConfigurationListForBatchUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationListForBatchUpdate model = BinaryData.fromString( - "{\"value\":[{\"name\":\"ejk\",\"properties\":{\"value\":\"nqgoulzndli\",\"source\":\"yqkgfg\"}},{\"name\":\"madgakeqsrxyb\",\"properties\":{\"value\":\"e\",\"source\":\"ytb\"}},{\"name\":\"qfou\",\"properties\":{\"value\":\"mnkzsmod\",\"source\":\"lougpbkw\"}},{\"name\":\"utduqktapspwgcu\",\"properties\":{\"value\":\"umkdosvqwhbmd\",\"source\":\"bjf\"}}],\"resetAllToDefault\":\"False\"}") + "{\"value\":[{\"name\":\"dnsezcxtbzs\",\"properties\":{\"value\":\"c\",\"source\":\"newmdwzjeiachbo\"}},{\"name\":\"flnrosfqpteehzz\",\"properties\":{\"value\":\"yqrimzin\",\"source\":\"swjdkirso\"}},{\"name\":\"qxhcrmn\",\"properties\":{\"value\":\"t\",\"source\":\"whdsoifiyip\"}},{\"name\":\"sqwpgrjb\",\"properties\":{\"value\":\"rcjxvsnbyxqabn\",\"source\":\"cpc\"}}]}") .toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("ejk", model.value().get(0).name()); - Assertions.assertEquals("nqgoulzndli", model.value().get(0).value()); - Assertions.assertEquals("yqkgfg", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.FALSE, model.resetAllToDefault()); + Assertions.assertEquals("dnsezcxtbzs", model.value().get(0).name()); + Assertions.assertEquals("c", model.value().get(0).value()); + Assertions.assertEquals("newmdwzjeiachbo", model.value().get(0).source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConfigurationListForBatchUpdate model = new ConfigurationListForBatchUpdate().withValue(Arrays.asList( - new ConfigurationForBatchUpdate().withName("ejk").withValue("nqgoulzndli").withSource("yqkgfg"), - new ConfigurationForBatchUpdate().withName("madgakeqsrxyb").withValue("e").withSource("ytb"), - new ConfigurationForBatchUpdate().withName("qfou").withValue("mnkzsmod").withSource("lougpbkw"), - new ConfigurationForBatchUpdate().withName("utduqktapspwgcu").withValue("umkdosvqwhbmd").withSource("bjf"))) - .withResetAllToDefault(ResetAllToDefault.FALSE); + new ConfigurationForBatchUpdate().withName("dnsezcxtbzs").withValue("c").withSource("newmdwzjeiachbo"), + new ConfigurationForBatchUpdate().withName("flnrosfqpteehzz").withValue("yqrimzin").withSource("swjdkirso"), + new ConfigurationForBatchUpdate().withName("qxhcrmn").withValue("t").withSource("whdsoifiyip"), + new ConfigurationForBatchUpdate().withName("sqwpgrjb").withValue("rcjxvsnbyxqabn").withSource("cpc"))); model = BinaryData.fromObject(model).toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("ejk", model.value().get(0).name()); - Assertions.assertEquals("nqgoulzndli", model.value().get(0).value()); - Assertions.assertEquals("yqkgfg", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.FALSE, model.resetAllToDefault()); + Assertions.assertEquals("dnsezcxtbzs", model.value().get(0).name()); + Assertions.assertEquals("c", model.value().get(0).value()); + Assertions.assertEquals("newmdwzjeiachbo", model.value().get(0).source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java index 8dad3b6a28265..24ae23ac97f95 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java @@ -15,31 +15,22 @@ public final class ConfigurationListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"value\":\"rlyxwjkcprbnw\",\"currentValue\":\"gjvtbv\",\"description\":\"sszdnru\",\"documentationLink\":\"guhmuouqfpr\",\"defaultValue\":\"wbnguitnwui\",\"dataType\":\"a\",\"allowedValues\":\"ufizuckyf\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"dzuhtymwi\",\"name\":\"dkfthwxmnt\",\"type\":\"i\"},{\"properties\":{\"value\":\"pvkmijcmmxdcuf\",\"currentValue\":\"srp\",\"description\":\"zidnsezcxtbzsgfy\",\"documentationLink\":\"sne\",\"defaultValue\":\"dwzjeiach\",\"dataType\":\"osfln\",\"allowedValues\":\"sfqpteehz\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"inpvswjdkirsoodq\",\"name\":\"hc\",\"type\":\"mnoh\"},{\"properties\":{\"value\":\"kwh\",\"currentValue\":\"oifiyipjxsqwpgr\",\"description\":\"znorcj\",\"documentationLink\":\"snb\",\"defaultValue\":\"qabnmoc\",\"dataType\":\"ysh\",\"allowedValues\":\"zafb\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"jmkljavbqidtqajz\",\"name\":\"ulpkudjkrl\",\"type\":\"hbzhfepg\"}],\"nextLink\":\"qex\"}") + "{\"value\":[{\"properties\":{\"value\":\"zloc\",\"description\":\"c\",\"defaultValue\":\"ierhhbcsglummaj\",\"dataType\":\"aodxo\",\"allowedValues\":\"bdxkqpxokaj\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"txgcpodgmaajr\",\"name\":\"vdjwzrlovm\",\"type\":\"lwhijcoejctbzaq\"}],\"nextLink\":\"sycbkbfk\"}") .toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).value()); - Assertions.assertEquals("gjvtbv", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("qex", model.nextLink()); + Assertions.assertEquals("zloc", model.value().get(0).value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); + Assertions.assertEquals("sycbkbfk", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationListResultInner model = new ConfigurationListResultInner().withValue(Arrays.asList( - new ConfigurationInner().withValue("rlyxwjkcprbnw") - .withCurrentValue("gjvtbv") - .withSource(ConfigurationSource.USER_OVERRIDE), - new ConfigurationInner().withValue("pvkmijcmmxdcuf") - .withCurrentValue("srp") - .withSource(ConfigurationSource.USER_OVERRIDE), - new ConfigurationInner().withValue("kwh") - .withCurrentValue("oifiyipjxsqwpgr") - .withSource(ConfigurationSource.SYSTEM_DEFAULT))) - .withNextLink("qex"); + ConfigurationListResultInner model = new ConfigurationListResultInner() + .withValue(Arrays + .asList(new ConfigurationInner().withValue("zloc").withSource(ConfigurationSource.SYSTEM_DEFAULT))) + .withNextLink("sycbkbfk"); model = BinaryData.fromObject(model).toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).value()); - Assertions.assertEquals("gjvtbv", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("qex", model.nextLink()); + Assertions.assertEquals("zloc", model.value().get(0).value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); + Assertions.assertEquals("sycbkbfk", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java index 13fec3e19a6dd..7b32f30543ec5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java @@ -13,21 +13,18 @@ public final class ConfigurationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationProperties model = BinaryData.fromString( - "{\"value\":\"oc\",\"currentValue\":\"eablg\",\"description\":\"uticndvkaozwyif\",\"documentationLink\":\"hxh\",\"defaultValue\":\"okftyxolniwpwcuk\",\"dataType\":\"kgiawxklryplwck\",\"allowedValues\":\"syyp\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"}") + "{\"value\":\"ufizuckyf\",\"description\":\"rfidfvzwdz\",\"defaultValue\":\"tymw\",\"dataType\":\"dkfthwxmnt\",\"allowedValues\":\"waopvkmijcmmxd\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}") .toObject(ConfigurationProperties.class); - Assertions.assertEquals("oc", model.value()); - Assertions.assertEquals("eablg", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); + Assertions.assertEquals("ufizuckyf", model.value()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationProperties model = new ConfigurationProperties().withValue("oc") - .withCurrentValue("eablg") - .withSource(ConfigurationSource.SYSTEM_DEFAULT); + ConfigurationProperties model + = new ConfigurationProperties().withValue("ufizuckyf").withSource(ConfigurationSource.USER_OVERRIDE); model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("oc", model.value()); - Assertions.assertEquals("eablg", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); + Assertions.assertEquals("ufizuckyf", model.value()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java index a98906de7eda5..01de786460d74 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java @@ -14,7 +14,6 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -26,7 +25,7 @@ public final class ConfigurationsBatchUpdateMockTests { @Test public void testBatchUpdate() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"jbdhqxvc\",\"currentValue\":\"frpdsofbshrns\",\"description\":\"uswdv\",\"documentationLink\":\"ybycnunvj\",\"defaultValue\":\"tkfa\",\"dataType\":\"opqgikyzirtxdyux\",\"allowedValues\":\"jntpsewgioilqu\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"ox\",\"name\":\"rgguf\",\"type\":\"yaomtb\"}],\"nextLink\":\"havgrvk\"}"; + = "{\"value\":[{\"properties\":{\"value\":\"xyawj\",\"description\":\"aq\",\"defaultValue\":\"lyjpk\",\"dataType\":\"dzyexznelixh\",\"allowedValues\":\"ztfolhbnxk\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"dtpnapnyiropuhp\",\"name\":\"gvpgy\",\"type\":\"gqgitxmedjvcsl\"},{\"properties\":{\"value\":\"wwncwzzhxgk\",\"description\":\"mgucna\",\"defaultValue\":\"t\",\"dataType\":\"ellwptfdy\",\"allowedValues\":\"fqbuaceopzf\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"cq\",\"name\":\"qxolzdahzx\",\"type\":\"t\"},{\"properties\":{\"value\":\"bkdmo\",\"description\":\"postmgrcfbunrm\",\"defaultValue\":\"jhhkxbp\",\"dataType\":\"ymjhxxjyngudivkr\",\"allowedValues\":\"wbxqzvszjfau\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"vtcqaqtdo\",\"name\":\"mcbxvwvxysl\",\"type\":\"bhsfxob\"},{\"properties\":{\"value\":\"k\",\"description\":\"mpew\",\"defaultValue\":\"fbkrvrnsvs\",\"dataType\":\"johxcrsb\",\"allowedValues\":\"vasrruvwb\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"birx\",\"name\":\"pybsrfbjfdtw\",\"type\":\"sotftpvj\"}],\"nextLink\":\"exilzznfqqnvwpmq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,18 +35,15 @@ public void testBatchUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); ConfigurationListResult response = manager.configurations() - .batchUpdate("fdlwg", "ytsbwtovv", new ConfigurationListForBatchUpdate() - .withValue(Arrays.asList( - new ConfigurationForBatchUpdate().withName("inqfiufxqknpirgn") - .withValue("twqmsniffcdmqnr") - .withSource("lpijnkrxfrd"), - new ConfigurationForBatchUpdate().withName("c").withValue("izzronasxiftozqy").withSource("f"), - new ConfigurationForBatchUpdate().withName("esgogc").withValue("nnxk").withSource("gnyhmossxkkg"))) - .withResetAllToDefault(ResetAllToDefault.FALSE), com.azure.core.util.Context.NONE); + .batchUpdate("wozuhkf", "bsjyofdx", + new ConfigurationListForBatchUpdate() + .withValue(Arrays.asList(new ConfigurationForBatchUpdate().withName("dttouwaboekqvkel") + .withValue("vbxwyjsflhh") + .withSource("aln"))), + com.azure.core.util.Context.NONE); - Assertions.assertEquals("jbdhqxvc", response.value().get(0).value()); - Assertions.assertEquals("frpdsofbshrns", response.value().get(0).currentValue()); + Assertions.assertEquals("xyawj", response.value().get(0).value()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.value().get(0).source()); - Assertions.assertEquals("havgrvk", response.nextLink()); + Assertions.assertEquals("exilzznfqqnvwpmq", response.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java index bd9617363214f..7853ffad70a1e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class ConfigurationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"stotxh\",\"currentValue\":\"ujbypelmcuvhixb\",\"description\":\"yfwnylr\",\"documentationLink\":\"o\",\"defaultValue\":\"ttpkiwkkbnujrywv\",\"dataType\":\"lbfpncurd\",\"allowedValues\":\"wiithtywub\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"dntwjchrdgo\",\"name\":\"hxumwctondzj\",\"type\":\"uu\"}"; + = "{\"properties\":{\"value\":\"gzva\",\"description\":\"pjyzhpv\",\"defaultValue\":\"zcjrvxdjzlmwlx\",\"dataType\":\"ug\",\"allowedValues\":\"zovawjvz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"nxipeil\",\"name\":\"jzuaejxdultskzbb\",\"type\":\"dzumveekg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Configuration response = manager.configurations() - .getWithResponse("wau", "qncygupkvi", "mdscwxqupev", com.azure.core.util.Context.NONE) + .getWithResponse("bexrmcq", "bycnojvkn", "e", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("stotxh", response.value()); - Assertions.assertEquals("ujbypelmcuvhixb", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); + Assertions.assertEquals("gzva", response.value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java index 706b047b4c80e..832008e191215 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java @@ -23,7 +23,7 @@ public final class ConfigurationsListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"cy\",\"currentValue\":\"zdgiruj\",\"description\":\"bomvzzbtdcqv\",\"documentationLink\":\"iyujviylwdshfs\",\"defaultValue\":\"rbgyefry\",\"dataType\":\"gaojf\",\"allowedValues\":\"nc\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"ymoxoftpipiwyczu\",\"name\":\"xacpqjli\",\"type\":\"hyus\"}]}"; + = "{\"value\":[{\"properties\":{\"value\":\"wj\",\"description\":\"gdrjervnaenqpe\",\"defaultValue\":\"ndoygmifthnzdnd\",\"dataType\":\"gnayqigynduh\",\"allowedValues\":\"hqlkthumaqo\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"tgccymvaolpss\",\"name\":\"qlfmmdnbb\",\"type\":\"lzpswiydm\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,12 +32,10 @@ public void testListByServer() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.configurations() - .listByServer("fo", "jzhpjbibgjmfx", "mv", "cluyovwxnbkf", 1806347124, 1794198042, - com.azure.core.util.Context.NONE); + PagedIterable response + = manager.configurations().listByServer("aruoujmkcjhwqyt", "r", com.azure.core.util.Context.NONE); - Assertions.assertEquals("cy", response.iterator().next().value()); - Assertions.assertEquals("zdgiruj", response.iterator().next().currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.iterator().next().source()); + Assertions.assertEquals("wj", response.iterator().next().value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.iterator().next().source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java similarity index 58% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java index e5246e456e303..933a5358c446b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java @@ -10,6 +10,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; import java.nio.charset.StandardCharsets; @@ -18,11 +19,11 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ConfigurationsCreateOrUpdateMockTests { +public final class ConfigurationsUpdateMockTests { @Test - public void testCreateOrUpdate() throws Exception { + public void testUpdate() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"ojgcyzt\",\"currentValue\":\"mznbaeqphch\",\"description\":\"rn\",\"documentationLink\":\"x\",\"defaultValue\":\"uwrykqgaifmvikl\",\"dataType\":\"dvk\",\"allowedValues\":\"ejd\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"jivolvtnov\",\"name\":\"fzg\",\"type\":\"mjdftu\"}"; + = "{\"properties\":{\"value\":\"jkbegibtnmxiebww\",\"description\":\"oayqc\",\"defaultValue\":\"rtzju\",\"dataType\":\"wyzmhtxon\",\"allowedValues\":\"ts\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"srknftguv\",\"name\":\"iuhprwmdyvxqta\",\"type\":\"riwwroy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,15 +33,11 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Configuration response = manager.configurations() - .define("euzvx") - .withExistingFlexibleServer("skasdvlmfwdgzxu", "ucvpamrs") - .withValue("sjnhn") - .withCurrentValue("xifqjzgxm") - .withSource(ConfigurationSource.USER_OVERRIDE) - .create(); + .update("euecivyhzceuoj", "jrwjueiotwm", "dytdxwitx", + new ConfigurationInner().withValue("awgqwgxhni").withSource(ConfigurationSource.USER_OVERRIDE), + com.azure.core.util.Context.NONE); - Assertions.assertEquals("ojgcyzt", response.value()); - Assertions.assertEquals("mznbaeqphch", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); + Assertions.assertEquals("jkbegibtnmxiebww", response.value()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java index 4f64b465bf883..c136870ba9788 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java @@ -12,17 +12,17 @@ public final class DatabaseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DatabaseInner model = BinaryData.fromString( - "{\"properties\":{\"charset\":\"c\",\"collation\":\"c\"},\"id\":\"ierhhbcsglummaj\",\"name\":\"j\",\"type\":\"odxobnbdxkqpxok\"}") + "{\"properties\":{\"charset\":\"zqqedq\",\"collation\":\"bciqfouflm\"},\"id\":\"kzsmodm\",\"name\":\"lougpbkw\",\"type\":\"mutduqktaps\"}") .toObject(DatabaseInner.class); - Assertions.assertEquals("c", model.charset()); - Assertions.assertEquals("c", model.collation()); + Assertions.assertEquals("zqqedq", model.charset()); + Assertions.assertEquals("bciqfouflm", model.collation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("c").withCollation("c"); + DatabaseInner model = new DatabaseInner().withCharset("zqqedq").withCollation("bciqfouflm"); model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("c", model.charset()); - Assertions.assertEquals("c", model.collation()); + Assertions.assertEquals("zqqedq", model.charset()); + Assertions.assertEquals("bciqfouflm", model.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java index afd3efbb3a36e..9534a12cf1d5b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java @@ -14,22 +14,21 @@ public final class DatabaseListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DatabaseListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"charset\":\"ajrmvdjwzrlovmc\",\"collation\":\"hijco\"},\"id\":\"ctbzaq\",\"name\":\"qsycbkbfkgu\",\"type\":\"dkexxppofm\"},{\"properties\":{\"charset\":\"c\",\"collation\":\"pg\"},\"id\":\"toc\",\"name\":\"j\",\"type\":\"hvpmoue\"}],\"nextLink\":\"dzxibqeojnxqbzvd\"}") + "{\"value\":[{\"properties\":{\"charset\":\"ddgmb\",\"collation\":\"ex\"},\"id\":\"bhtqqrolfpfpsa\",\"name\":\"gbquxigj\",\"type\":\"jgzjaoyfhrtx\"}],\"nextLink\":\"n\"}") .toObject(DatabaseListResult.class); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.value().get(0).charset()); - Assertions.assertEquals("hijco", model.value().get(0).collation()); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.nextLink()); + Assertions.assertEquals("ddgmb", model.value().get(0).charset()); + Assertions.assertEquals("ex", model.value().get(0).collation()); + Assertions.assertEquals("n", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DatabaseListResult model = new DatabaseListResult() - .withValue(Arrays.asList(new DatabaseInner().withCharset("ajrmvdjwzrlovmc").withCollation("hijco"), - new DatabaseInner().withCharset("c").withCollation("pg"))) - .withNextLink("dzxibqeojnxqbzvd"); + .withValue(Arrays.asList(new DatabaseInner().withCharset("ddgmb").withCollation("ex"))) + .withNextLink("n"); model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.value().get(0).charset()); - Assertions.assertEquals("hijco", model.value().get(0).collation()); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.nextLink()); + Assertions.assertEquals("ddgmb", model.value().get(0).charset()); + Assertions.assertEquals("ex", model.value().get(0).collation()); + Assertions.assertEquals("n", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java index e7322e6dd0867..5d4e07dfa5a00 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java @@ -11,17 +11,17 @@ public final class DatabasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DatabaseProperties model = BinaryData.fromString("{\"charset\":\"ionpimexg\",\"collation\":\"xgcp\"}") + DatabaseProperties model = BinaryData.fromString("{\"charset\":\"gcue\",\"collation\":\"umkdosvqwhbmd\"}") .toObject(DatabaseProperties.class); - Assertions.assertEquals("ionpimexg", model.charset()); - Assertions.assertEquals("xgcp", model.collation()); + Assertions.assertEquals("gcue", model.charset()); + Assertions.assertEquals("umkdosvqwhbmd", model.collation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("ionpimexg").withCollation("xgcp"); + DatabaseProperties model = new DatabaseProperties().withCharset("gcue").withCollation("umkdosvqwhbmd"); model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("ionpimexg", model.charset()); - Assertions.assertEquals("xgcp", model.collation()); + Assertions.assertEquals("gcue", model.charset()); + Assertions.assertEquals("umkdosvqwhbmd", model.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java index 47aec5aac9619..1559c79cbc776 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java @@ -21,7 +21,7 @@ public final class DatabasesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"charset\":\"kkqfqjbvle\",\"collation\":\"fmluiqtqzfavyvn\"},\"id\":\"ybar\",\"name\":\"euayjkqabqgzsles\",\"type\":\"cbhernntiewdj\"}"; + = "{\"properties\":{\"charset\":\"qhakauhashsf\",\"collation\":\"osow\"},\"id\":\"cugicjoox\",\"name\":\"j\",\"type\":\"bwpucwwfvovbv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +31,13 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Database response = manager.databases() - .define("zedqbcvhzlhplo") - .withExistingFlexibleServer("ostgkts", "vdxec") - .withCharset("dlwwqfbumlkxt") - .withCollation("jfsmlmbtxhwgfwsr") + .define("vfadmws") + .withExistingFlexibleServer("hcdhmdual", "exq") + .withCharset("gvxp") + .withCollation("omzlfmi") .create(); - Assertions.assertEquals("kkqfqjbvle", response.charset()); - Assertions.assertEquals("fmluiqtqzfavyvn", response.collation()); + Assertions.assertEquals("qhakauhashsf", response.charset()); + Assertions.assertEquals("osow", response.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java index 4f681f815fc80..73d9cf1c8bd62 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.databases().delete("jltduceam", "mczuo", "ejwcwwqiok", com.azure.core.util.Context.NONE); + manager.databases().delete("fjz", "fqkquj", "dsuyonobgla", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java index 3ba2ebbf4dbaf..ff3abec478ab9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class DatabasesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"charset\":\"cfzq\",\"collation\":\"yxgtczh\"},\"id\":\"dbsdshm\",\"name\":\"xmaehvbbxu\",\"type\":\"iplt\"}"; + = "{\"properties\":{\"charset\":\"xy\",\"collation\":\"moyrxvwfudwpz\"},\"id\":\"xhdzhlrqjbhckf\",\"name\":\"lhrxsbkyvpyc\",\"type\":\"n\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,9 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Database response - = manager.databases().getWithResponse("ssxmojms", "p", "jpr", com.azure.core.util.Context.NONE).getValue(); + = manager.databases().getWithResponse("cq", "tcc", "g", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("cfzq", response.charset()); - Assertions.assertEquals("yxgtczh", response.collation()); + Assertions.assertEquals("xy", response.charset()); + Assertions.assertEquals("moyrxvwfudwpz", response.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java index c4ea56e2d5584..0778ef785294f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java @@ -22,7 +22,7 @@ public final class DatabasesListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"charset\":\"wrck\",\"collation\":\"kl\"},\"id\":\"pluodpv\",\"name\":\"uudl\",\"type\":\"zibt\"}]}"; + = "{\"value\":[{\"properties\":{\"charset\":\"fkuwbcrnwbmehhse\",\"collation\":\"jusrtslhspk\"},\"id\":\"emaofmxagkvt\",\"name\":\"elmqk\",\"type\":\"hahvljuahaq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,9 @@ public void testListByServer() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response - = manager.databases().listByServer("n", "tbaxk", com.azure.core.util.Context.NONE); + PagedIterable response = manager.databases().listByServer("z", "p", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wrck", response.iterator().next().charset()); - Assertions.assertEquals("kl", response.iterator().next().collation()); + Assertions.assertEquals("fkuwbcrnwbmehhse", response.iterator().next().charset()); + Assertions.assertEquals("jusrtslhspk", response.iterator().next().collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java index d2d5fececbe7e..0935f5fafd9d6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java @@ -11,7 +11,7 @@ public final class DelegatedSubnetUsageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DelegatedSubnetUsage model - = BinaryData.fromString("{\"subnetName\":\"vgpiohgwxrt\",\"usage\":9067557687831354923}") + = BinaryData.fromString("{\"subnetName\":\"ezrkgqhcjrefo\",\"usage\":149589040651836260}") .toObject(DelegatedSubnetUsage.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java index 67f97a1a42ebe..8e9b401f9cb62 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java @@ -12,18 +12,18 @@ public final class FirewallRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FirewallRuleInner model = BinaryData.fromString( - "{\"properties\":{\"startIpAddress\":\"ntwndeicbtwnpzao\",\"endIpAddress\":\"vuhrhcffcyddgl\"},\"id\":\"t\",\"name\":\"jqkwpyeicx\",\"type\":\"qciwqvhkhixuigdt\"}") + "{\"properties\":{\"startIpAddress\":\"kufubljo\",\"endIpAddress\":\"xqeofjaeqjhqjba\"},\"id\":\"msmjqulngsntn\",\"name\":\"ybkzgcwr\",\"type\":\"clxxwrljdo\"}") .toObject(FirewallRuleInner.class); - Assertions.assertEquals("ntwndeicbtwnpzao", model.startIpAddress()); - Assertions.assertEquals("vuhrhcffcyddgl", model.endIpAddress()); + Assertions.assertEquals("kufubljo", model.startIpAddress()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.endIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FirewallRuleInner model - = new FirewallRuleInner().withStartIpAddress("ntwndeicbtwnpzao").withEndIpAddress("vuhrhcffcyddgl"); + = new FirewallRuleInner().withStartIpAddress("kufubljo").withEndIpAddress("xqeofjaeqjhqjba"); model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("ntwndeicbtwnpzao", model.startIpAddress()); - Assertions.assertEquals("vuhrhcffcyddgl", model.endIpAddress()); + Assertions.assertEquals("kufubljo", model.startIpAddress()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java index 0ee05ef5d5e49..581cc87c32e49 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java @@ -14,21 +14,24 @@ public final class FirewallRuleListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FirewallRuleListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"a\",\"endIpAddress\":\"a\"},\"id\":\"rzayv\",\"name\":\"t\",\"type\":\"gvdfgiotkftutq\"}],\"nextLink\":\"ngxlefgugnxkrxdq\"}") + "{\"value\":[{\"properties\":{\"startIpAddress\":\"sainqpjwnzl\",\"endIpAddress\":\"jfm\"},\"id\":\"eebvmgxsab\",\"name\":\"yqduujit\",\"type\":\"jczdzevndh\"},{\"properties\":{\"startIpAddress\":\"rwpdappdsbdkvwrw\",\"endIpAddress\":\"feusnhut\"},\"id\":\"ltmrldh\",\"name\":\"gjzzdatqxhocdg\",\"type\":\"ablgphuticndvk\"},{\"properties\":{\"startIpAddress\":\"ozwyiftyhxhuro\",\"endIpAddress\":\"ftyxolniw\"},\"id\":\"cukjf\",\"name\":\"giawx\",\"type\":\"lryplwckbasyy\"},{\"properties\":{\"startIpAddress\":\"nddhsgcbacph\",\"endIpAddress\":\"jkot\"},\"id\":\"qgoulznd\",\"name\":\"i\",\"type\":\"wyqkgfgibm\"}],\"nextLink\":\"gakeqsr\"}") .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("a", model.value().get(0).startIpAddress()); - Assertions.assertEquals("a", model.value().get(0).endIpAddress()); - Assertions.assertEquals("ngxlefgugnxkrxdq", model.nextLink()); + Assertions.assertEquals("sainqpjwnzl", model.value().get(0).startIpAddress()); + Assertions.assertEquals("jfm", model.value().get(0).endIpAddress()); + Assertions.assertEquals("gakeqsr", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FirewallRuleListResult model = new FirewallRuleListResult() - .withValue(Arrays.asList(new FirewallRuleInner().withStartIpAddress("a").withEndIpAddress("a"))) - .withNextLink("ngxlefgugnxkrxdq"); + .withValue(Arrays.asList(new FirewallRuleInner().withStartIpAddress("sainqpjwnzl").withEndIpAddress("jfm"), + new FirewallRuleInner().withStartIpAddress("rwpdappdsbdkvwrw").withEndIpAddress("feusnhut"), + new FirewallRuleInner().withStartIpAddress("ozwyiftyhxhuro").withEndIpAddress("ftyxolniw"), + new FirewallRuleInner().withStartIpAddress("nddhsgcbacph").withEndIpAddress("jkot"))) + .withNextLink("gakeqsr"); model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("a", model.value().get(0).startIpAddress()); - Assertions.assertEquals("a", model.value().get(0).endIpAddress()); - Assertions.assertEquals("ngxlefgugnxkrxdq", model.nextLink()); + Assertions.assertEquals("sainqpjwnzl", model.value().get(0).startIpAddress()); + Assertions.assertEquals("jfm", model.value().get(0).endIpAddress()); + Assertions.assertEquals("gakeqsr", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java index 2135166d7fd29..f1efbd76ba035 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java @@ -11,17 +11,19 @@ public final class FirewallRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FirewallRuleProperties model = BinaryData.fromString("{\"startIpAddress\":\"pbobjo\",\"endIpAddress\":\"hm\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("pbobjo", model.startIpAddress()); - Assertions.assertEquals("hm", model.endIpAddress()); + FirewallRuleProperties model + = BinaryData.fromString("{\"startIpAddress\":\"skcqvkocrcjd\",\"endIpAddress\":\"wtnhxbnjbiksqr\"}") + .toObject(FirewallRuleProperties.class); + Assertions.assertEquals("skcqvkocrcjd", model.startIpAddress()); + Assertions.assertEquals("wtnhxbnjbiksqr", model.endIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FirewallRuleProperties model = new FirewallRuleProperties().withStartIpAddress("pbobjo").withEndIpAddress("hm"); + FirewallRuleProperties model + = new FirewallRuleProperties().withStartIpAddress("skcqvkocrcjd").withEndIpAddress("wtnhxbnjbiksqr"); model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("pbobjo", model.startIpAddress()); - Assertions.assertEquals("hm", model.endIpAddress()); + Assertions.assertEquals("skcqvkocrcjd", model.startIpAddress()); + Assertions.assertEquals("wtnhxbnjbiksqr", model.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java index e1631f5c62922..9b3ee450ed379 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java @@ -21,7 +21,7 @@ public final class FirewallRulesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"startIpAddress\":\"alywjhhgdn\",\"endIpAddress\":\"xmsivfomiloxggdu\"},\"id\":\"q\",\"name\":\"dieuzaofj\",\"type\":\"hvcyyysfg\"}"; + = "{\"properties\":{\"startIpAddress\":\"nermcl\",\"endIpAddress\":\"plpho\"},\"id\":\"scrpabgyepsbjt\",\"name\":\"zq\",\"type\":\"gxywpmue\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +31,13 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); FirewallRule response = manager.firewallRules() - .define("kokwbqplhlvnu") - .withExistingFlexibleServer("rxgibbd", "xconfozauors") - .withStartIpAddress("epzl") - .withEndIpAddress("phwzsoldweyuqdu") + .define("o") + .withExistingFlexibleServer("cwsvlxotog", "wrupqsxvnmicykvc") + .withStartIpAddress("eil") + .withEndIpAddress("vnotyfjfcnj") .create(); - Assertions.assertEquals("alywjhhgdn", response.startIpAddress()); - Assertions.assertEquals("xmsivfomiloxggdu", response.endIpAddress()); + Assertions.assertEquals("nermcl", response.startIpAddress()); + Assertions.assertEquals("plpho", response.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java index 08d34ef73d1d8..31dbe402d1e40 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.firewallRules().delete("vbquwr", "ehwagoh", "uffkmrqemvvh", com.azure.core.util.Context.NONE); + manager.firewallRules().delete("lcuhxwtctyqiklb", "ovplw", "bhvgy", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java index 3542aef8cada9..d0af043e676df 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class FirewallRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"startIpAddress\":\"guaadraufactkahz\",\"endIpAddress\":\"v\"},\"id\":\"j\",\"name\":\"iuxxpshneekulfg\",\"type\":\"lqubkwdlen\"}"; + = "{\"properties\":{\"startIpAddress\":\"mg\",\"endIpAddress\":\"xnkjzkdesl\"},\"id\":\"lopwiyig\",\"name\":\"xpkd\",\"type\":\"zb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); FirewallRule response = manager.firewallRules() - .getWithResponse("xtdr", "futacoebjvewzc", "znmwcp", com.azure.core.util.Context.NONE) + .getWithResponse("gu", "svmkfssxquk", "fpl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("guaadraufactkahz", response.startIpAddress()); - Assertions.assertEquals("v", response.endIpAddress()); + Assertions.assertEquals("mg", response.startIpAddress()); + Assertions.assertEquals("xnkjzkdesl", response.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java index 42b40f818eec6..68aa34daa2b02 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java @@ -22,7 +22,7 @@ public final class FirewallRulesListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"startIpAddress\":\"pjuohminyfl\",\"endIpAddress\":\"orwmduvwpklv\"},\"id\":\"mygdxpgpqch\",\"name\":\"sze\",\"type\":\"nnbj\"}]}"; + = "{\"value\":[{\"properties\":{\"startIpAddress\":\"txp\",\"endIpAddress\":\"ie\"},\"id\":\"fhvpesaps\",\"name\":\"rdqmhjjdhtldwkyz\",\"type\":\"uutkncw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,9 +32,9 @@ public void testListByServer() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.firewallRules().listByServer("d", "utujba", com.azure.core.util.Context.NONE); + = manager.firewallRules().listByServer("iuebbaumny", "upedeojnabckhs", com.azure.core.util.Context.NONE); - Assertions.assertEquals("pjuohminyfl", response.iterator().next().startIpAddress()); - Assertions.assertEquals("orwmduvwpklv", response.iterator().next().endIpAddress()); + Assertions.assertEquals("txp", response.iterator().next().startIpAddress()); + Assertions.assertEquals("ie", response.iterator().next().endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java deleted file mode 100644 index c3130241e093f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FullBackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FullBackupStoreDetails model = BinaryData.fromString( - "{\"objectType\":\"FullBackupStoreDetails\",\"sasUriList\":[\"cizsjqlhkrribdei\",\"qipqkghvxndz\",\"mkrefajpjorwkq\"]}") - .toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("cizsjqlhkrribdei", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FullBackupStoreDetails model = new FullBackupStoreDetails() - .withSasUriList(Arrays.asList("cizsjqlhkrribdei", "qipqkghvxndz", "mkrefajpjorwkq")); - model = BinaryData.fromObject(model).toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("cizsjqlhkrribdei", model.sasUriList().get(0)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java index 696e27516696f..d07d80224ed32 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java @@ -11,16 +11,17 @@ public final class GetPrivateDnsZoneSuffixResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = BinaryData.fromString("{\"privateDnsZoneSuffix\":\"glsbjjc\"}") - .toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("glsbjjc", model.privateDnsZoneSuffix()); + GetPrivateDnsZoneSuffixResponseInner model + = BinaryData.fromString("{\"privateDnsZoneSuffix\":\"sounqecanoaeu\"}") + .toObject(GetPrivateDnsZoneSuffixResponseInner.class); + Assertions.assertEquals("sounqecanoaeu", model.privateDnsZoneSuffix()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GetPrivateDnsZoneSuffixResponseInner model - = new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("glsbjjc"); + = new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("sounqecanoaeu"); model = BinaryData.fromObject(model).toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("glsbjjc", model.privateDnsZoneSuffix()); + Assertions.assertEquals("sounqecanoaeu", model.privateDnsZoneSuffix()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java index 6e089060382f4..7803691ca982c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"privateDnsZoneSuffix\":\"cxfailcfxwmdboxd\"}"; + String responseStr = "{\"privateDnsZoneSuffix\":\"dtmhrkwofyyvoqa\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,6 +32,6 @@ public void testExecuteWithResponse() throws Exception { GetPrivateDnsZoneSuffixResponse response = manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("cxfailcfxwmdboxd", response.privateDnsZoneSuffix()); + Assertions.assertEquals("dtmhrkwofyyvoqa", response.privateDnsZoneSuffix()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java index da7bc9689d99d..d46c6fb05e39a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java @@ -13,19 +13,18 @@ public final class HighAvailabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HighAvailability model = BinaryData - .fromString( - "{\"mode\":\"Disabled\",\"state\":\"RemovingStandby\",\"standbyAvailabilityZone\":\"adehxnltyfsopp\"}") + .fromString("{\"mode\":\"ZoneRedundant\",\"state\":\"NotEnabled\",\"standbyAvailabilityZone\":\"cryuan\"}") .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("adehxnltyfsopp", model.standbyAvailabilityZone()); + Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); + Assertions.assertEquals("cryuan", model.standbyAvailabilityZone()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HighAvailability model = new HighAvailability().withMode(HighAvailabilityMode.DISABLED) - .withStandbyAvailabilityZone("adehxnltyfsopp"); + HighAvailability model = new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT) + .withStandbyAvailabilityZone("cryuan"); model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("adehxnltyfsopp", model.standbyAvailabilityZone()); + Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); + Assertions.assertEquals("cryuan", model.standbyAvailabilityZone()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java deleted file mode 100644 index 58746647a6da5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java +++ /dev/null @@ -1,27 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityValidationEstimationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailabilityValidationEstimationInner model = BinaryData.fromString( - "{\"estimatedDowntime\":2118838793,\"scheduledStandbyAvailabilityZone\":\"mvxi\",\"expectedStandbyAvailabilityZone\":\"uugidyjrrfby\"}") - .toObject(HighAvailabilityValidationEstimationInner.class); - Assertions.assertEquals("uugidyjrrfby", model.expectedStandbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailabilityValidationEstimationInner model - = new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("uugidyjrrfby"); - model = BinaryData.fromObject(model).toObject(HighAvailabilityValidationEstimationInner.class); - Assertions.assertEquals("uugidyjrrfby", model.expectedStandbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerIdentityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java similarity index 58% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerIdentityTests.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java index 4e9ce504de52a..e088da35fa145 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerIdentityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java @@ -5,27 +5,26 @@ package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; -public final class MySqlServerIdentityTests { +public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MySqlServerIdentity model = BinaryData.fromString( - "{\"principalId\":\"fionl\",\"tenantId\":\"x\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"rjfeallnwsubisnj\":\"datazxdpnqbqqw\",\"hcbonqvpkvlr\":\"datampmngnzscxaqwoo\",\"y\":\"datanjeaseipheofloke\"}}") - .toObject(MySqlServerIdentity.class); + Identity model = BinaryData.fromString( + "{\"principalId\":\"qjnqglhqgnufoooj\",\"tenantId\":\"ifsqesaagdfmg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zntocipaouajps\":\"dataxrifkwmrvkts\"}}") + .toObject(Identity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MySqlServerIdentity model = new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("rjfeallnwsubisnj", "datazxdpnqbqqw", "hcbonqvpkvlr", - "datampmngnzscxaqwoo", "y", "datanjeaseipheofloke")); - model = BinaryData.fromObject(model).toObject(MySqlServerIdentity.class); + Identity model = new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("zntocipaouajps", "dataxrifkwmrvkts")); + model = BinaryData.fromObject(model).toObject(Identity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java deleted file mode 100644 index bd6deb6b4249b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java +++ /dev/null @@ -1,29 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportFromStorageResponseType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ImportFromStorageResponseTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportFromStorageResponseType model = BinaryData - .fromString( - "{\"objectType\":\"ImportFromStorageResponse\",\"estimatedCompletionTime\":\"2021-09-21T09:33:48Z\"}") - .toObject(ImportFromStorageResponseType.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T09:33:48Z"), model.estimatedCompletionTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportFromStorageResponseType model = new ImportFromStorageResponseType() - .withEstimatedCompletionTime(OffsetDateTime.parse("2021-09-21T09:33:48Z")); - model = BinaryData.fromObject(model).toObject(ImportFromStorageResponseType.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T09:33:48Z"), model.estimatedCompletionTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java index 967546caca370..16dd179e5c165 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java @@ -21,7 +21,7 @@ public final class LocationBasedCapabilitiesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"zone\":\"w\",\"supportedHAMode\":[\"wplefaxvxil\",\"btgn\",\"nzeyqxtjj\"],\"supportedGeoBackupRegions\":[\"lqhy\",\"avodg\",\"xdbeesmieknl\"],\"supportedFlexibleServerEditions\":[{\"name\":\"aawiuagydwqfb\",\"supportedStorageEditions\":[{\"name\":\"fgiagtcojocqwo\",\"minStorageSize\":3056699249247760671,\"maxStorageSize\":7238052431733623835,\"minBackupRetentionDays\":8876355294638697498,\"maxBackupRetentionDays\":5220960314956788398,\"minBackupIntervalHours\":8402905876452090730,\"maxBackupIntervalHours\":7581661872594982717}],\"supportedServerVersions\":[{\"name\":\"tkad\",\"supportedSkus\":[{}]},{\"name\":\"wn\",\"supportedSkus\":[{},{},{}]},{\"name\":\"bugrj\",\"supportedSkus\":[{}]},{\"name\":\"jc\",\"supportedSkus\":[{},{},{},{}]}]}]}]}"; + = "{\"value\":[{\"zone\":\"adbzmnvdfznud\",\"supportedHAMode\":[\"vxzbncb\",\"ylpstdbhhxsrzdz\",\"cers\",\"dntnevf\"],\"supportedGeoBackupRegions\":[\"mygtdssls\",\"tmweriofzpyq\",\"emwabnet\",\"hhszh\"],\"supportedFlexibleServerEditions\":[{\"name\":\"vwiwubmwmbesld\",\"supportedStorageEditions\":[{\"name\":\"tppjflcx\",\"minStorageSize\":3058762238955275057,\"maxStorageSize\":2510700461860168657,\"minBackupRetentionDays\":93220061334436953,\"maxBackupRetentionDays\":2991398819380628456},{\"name\":\"mkqzeqqkdltfzxmh\",\"minStorageSize\":4664695938466420383,\"maxStorageSize\":290569327537915175,\"minBackupRetentionDays\":820800207830190162,\"maxBackupRetentionDays\":5369174747362686105}],\"supportedServerVersions\":[{\"name\":\"xtibqdxbxwakbog\",\"supportedSkus\":[{},{},{}]},{\"name\":\"lkzgxhuriplbp\",\"supportedSkus\":[{},{},{},{}]}]},{\"name\":\"nkbebxmuby\",\"supportedStorageEditions\":[{\"name\":\"lrb\",\"minStorageSize\":8228747938287613437,\"maxStorageSize\":9145634763199835148,\"minBackupRetentionDays\":4523060122413380781,\"maxBackupRetentionDays\":2880173002615591497},{\"name\":\"l\",\"minStorageSize\":4929519207657456173,\"maxStorageSize\":8105546637199671811,\"minBackupRetentionDays\":8220583929714824601,\"maxBackupRetentionDays\":2432465930399611430}],\"supportedServerVersions\":[{\"name\":\"gcj\",\"supportedSkus\":[{}]},{\"name\":\"muvp\",\"supportedSkus\":[{}]},{\"name\":\"um\",\"supportedSkus\":[{}]},{\"name\":\"xe\",\"supportedSkus\":[{},{}]}]},{\"name\":\"btbhjpglkfgohd\",\"supportedStorageEditions\":[{\"name\":\"lfphsdyhtozfikd\",\"minStorageSize\":2120097512911222232,\"maxStorageSize\":891560083261976989,\"minBackupRetentionDays\":2092756450243660051,\"maxBackupRetentionDays\":6214959618688242083}],\"supportedServerVersions\":[{\"name\":\"hqzonosggbhcoh\",\"supportedSkus\":[{},{}]},{\"name\":\"jnkaljutiiswacff\",\"supportedSkus\":[{}]},{\"name\":\"zewk\",\"supportedSkus\":[{},{},{}]},{\"name\":\"crailvpn\",\"supportedSkus\":[{},{},{}]}]},{\"name\":\"flrwd\",\"supportedStorageEditions\":[{\"name\":\"xyjrxsagafcnih\",\"minStorageSize\":3130876298104392093,\"maxStorageSize\":7972426552267245030,\"minBackupRetentionDays\":8610358802606955668,\"maxBackupRetentionDays\":6066782690220181009},{\"name\":\"cvqvpkeqdcv\",\"minStorageSize\":5404644626428061791,\"maxStorageSize\":4054103831441569061,\"minBackupRetentionDays\":3436329358206451649,\"maxBackupRetentionDays\":6797997194848060096}],\"supportedServerVersions\":[{\"name\":\"pcjwv\",\"supportedSkus\":[{},{}]},{\"name\":\"d\",\"supportedSkus\":[{}]},{\"name\":\"cxrslpmutwuoe\",\"supportedSkus\":[{},{}]}]}]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,7 +31,7 @@ public void testList() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.locationBasedCapabilities().list("vhmgorffukis", com.azure.core.util.Context.NONE); + = manager.locationBasedCapabilities().list("wyhzdx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java deleted file mode 100644 index 4682986b58eae..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitySetsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"supportedGeoBackupRegions\":[\"etoge\",\"joxslhvnhla\",\"rqnkkzjcjbtr\"],\"supportedFlexibleServerEditions\":[{\"name\":\"vvib\",\"defaultSku\":\"jj\",\"defaultStorageSize\":564299595,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{}]},{\"name\":\"pkxztmoobkl\",\"defaultSku\":\"idgfc\",\"defaultStorageSize\":1491349609,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"hemjy\"},{\"name\":\"hujswtwkozzwcul\"}]},\"id\":\"awpfajnjwltlwtjj\",\"name\":\"uktalhsnvkcdmxz\",\"type\":\"poaimlnwiaaomyl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Capability response = manager.locationBasedCapabilitySets() - .getWithResponse("z", "seypxiutcxapz", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java deleted file mode 100644 index 5f865e62181a7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitySetsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"supportedGeoBackupRegions\":[\"efojyqdhcupl\"],\"supportedFlexibleServerEditions\":[{\"name\":\"wkhihihlhzdsqt\",\"defaultSku\":\"s\",\"defaultStorageSize\":1050448632,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{}]},{\"name\":\"fgmvecactxmwo\",\"defaultSku\":\"yowc\",\"defaultStorageSize\":671380077,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{},{}]},{\"name\":\"vgqouwifzmpj\",\"defaultSku\":\"ivqikfxcvhr\",\"defaultStorageSize\":1765107772,\"supportedStorageEditions\":[{},{},{},{}],\"supportedSkus\":[{},{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"ikteusqczkvyk\"},{\"name\":\"ubyjaffmmf\"},{\"name\":\"cqc\"},{\"name\":\"bgq\"}]},\"id\":\"rtalmet\",\"name\":\"t\",\"type\":\"gdslqxihhrmoo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.locationBasedCapabilitySets().list("of", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java deleted file mode 100644 index 287e497a56a05..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileInner model = BinaryData.fromString( - "{\"properties\":{\"sizeInKB\":2270588281817751740,\"createdTime\":\"2021-10-30T06:22:22Z\",\"type\":\"jyoxgvclt\",\"lastModifiedTime\":\"2021-10-11T10:12:30Z\",\"url\":\"c\"},\"id\":\"kjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(2270588281817751740L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T06:22:22Z"), model.createdTime()); - Assertions.assertEquals("jyoxgvclt", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:12:30Z"), model.lastModifiedTime()); - Assertions.assertEquals("c", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = new LogFileInner().withSizeInKB(2270588281817751740L) - .withCreatedTime(OffsetDateTime.parse("2021-10-30T06:22:22Z")) - .withTypePropertiesType("jyoxgvclt") - .withLastModifiedTime(OffsetDateTime.parse("2021-10-11T10:12:30Z")) - .withUrl("c"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(2270588281817751740L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T06:22:22Z"), model.createdTime()); - Assertions.assertEquals("jyoxgvclt", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:12:30Z"), model.lastModifiedTime()); - Assertions.assertEquals("c", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java deleted file mode 100644 index d8367c1cc2c50..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,60 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFileListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogFileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"sizeInKB\":6694189583402716643,\"createdTime\":\"2021-10-04T01:34:07Z\",\"type\":\"fbishcbkha\",\"lastModifiedTime\":\"2021-05-05T10:08:59Z\",\"url\":\"eamdp\"},\"id\":\"g\",\"name\":\"lpbuxwgipwhonowk\",\"type\":\"shwankixzbinje\"},{\"properties\":{\"sizeInKB\":4664442885020763143,\"createdTime\":\"2020-12-26T19:40:41Z\",\"type\":\"nuzo\",\"lastModifiedTime\":\"2021-06-23T23:25:19Z\",\"url\":\"yqzrnkcqvyxlw\"},\"id\":\"lsicohoqqnwv\",\"name\":\"ryavwhheunmmqh\",\"type\":\"yxzk\"},{\"properties\":{\"sizeInKB\":5868571403319109352,\"createdTime\":\"2021-03-20T11:43:44Z\",\"type\":\"lyaxuc\",\"lastModifiedTime\":\"2021-08-29T22:44:57Z\",\"url\":\"szfkbe\"},\"id\":\"ewrmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"},{\"properties\":{\"sizeInKB\":5657063864250371746,\"createdTime\":\"2021-05-04T00:16:05Z\",\"type\":\"etcktvfcivfsnk\",\"lastModifiedTime\":\"2021-12-09T18:50:38Z\",\"url\":\"tqhjfbebrjcx\"},\"id\":\"fuwutttxf\",\"name\":\"jrbirphxepcyv\",\"type\":\"hfnljkyq\"}],\"nextLink\":\"vuujq\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(6694189583402716643L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T01:34:07Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("fbishcbkha", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T10:08:59Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("eamdp", model.value().get(0).url()); - Assertions.assertEquals("vuujq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = new LogFileListResult().withValue(Arrays.asList( - new LogFileInner().withSizeInKB(6694189583402716643L) - .withCreatedTime(OffsetDateTime.parse("2021-10-04T01:34:07Z")) - .withTypePropertiesType("fbishcbkha") - .withLastModifiedTime(OffsetDateTime.parse("2021-05-05T10:08:59Z")) - .withUrl("eamdp"), - new LogFileInner().withSizeInKB(4664442885020763143L) - .withCreatedTime(OffsetDateTime.parse("2020-12-26T19:40:41Z")) - .withTypePropertiesType("nuzo") - .withLastModifiedTime(OffsetDateTime.parse("2021-06-23T23:25:19Z")) - .withUrl("yqzrnkcqvyxlw"), - new LogFileInner().withSizeInKB(5868571403319109352L) - .withCreatedTime(OffsetDateTime.parse("2021-03-20T11:43:44Z")) - .withTypePropertiesType("lyaxuc") - .withLastModifiedTime(OffsetDateTime.parse("2021-08-29T22:44:57Z")) - .withUrl("szfkbe"), - new LogFileInner().withSizeInKB(5657063864250371746L) - .withCreatedTime(OffsetDateTime.parse("2021-05-04T00:16:05Z")) - .withTypePropertiesType("etcktvfcivfsnk") - .withLastModifiedTime(OffsetDateTime.parse("2021-12-09T18:50:38Z")) - .withUrl("tqhjfbebrjcx"))) - .withNextLink("vuujq"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(6694189583402716643L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T01:34:07Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("fbishcbkha", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T10:08:59Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("eamdp", model.value().get(0).url()); - Assertions.assertEquals("vuujq", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java deleted file mode 100644 index 6f43749d9203a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileProperties model = BinaryData.fromString( - "{\"sizeInKB\":4653478630911450001,\"createdTime\":\"2021-06-15T22:18:20Z\",\"type\":\"ebfqkkrbm\",\"lastModifiedTime\":\"2021-12-04T19:14:26Z\",\"url\":\"riwflzlfb\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(4653478630911450001L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T22:18:20Z"), model.createdTime()); - Assertions.assertEquals("ebfqkkrbm", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T19:14:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("riwflzlfb", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = new LogFileProperties().withSizeInKB(4653478630911450001L) - .withCreatedTime(OffsetDateTime.parse("2021-06-15T22:18:20Z")) - .withType("ebfqkkrbm") - .withLastModifiedTime(OffsetDateTime.parse("2021-12-04T19:14:26Z")) - .withUrl("riwflzlfb"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(4653478630911450001L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T22:18:20Z"), model.createdTime()); - Assertions.assertEquals("ebfqkkrbm", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T19:14:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("riwflzlfb", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java deleted file mode 100644 index 8447e62cbbdda..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LogFilesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"sizeInKB\":6282247410712068570,\"createdTime\":\"2021-05-31T00:15:25Z\",\"type\":\"vkbunzozudh\",\"lastModifiedTime\":\"2021-08-22T14:57:30Z\",\"url\":\"oyxcdyuib\"},\"id\":\"fdn\",\"name\":\"zydvfvf\",\"type\":\"jnaeois\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.logFiles().listByServer("rafwgckhocxvdf", "fwafqrouda", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(6282247410712068570L, response.iterator().next().sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T00:15:25Z"), response.iterator().next().createdTime()); - Assertions.assertEquals("vkbunzozudh", response.iterator().next().typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-22T14:57:30Z"), - response.iterator().next().lastModifiedTime()); - Assertions.assertEquals("oyxcdyuib", response.iterator().next().url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsCreateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsCreateMockTests.java deleted file mode 100644 index ed43a91f65154..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsCreateMockTests.java +++ /dev/null @@ -1,48 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LongRunningBackupsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"backupNameV2\":\"ipn\",\"backupType\":\"FULL\",\"completedTime\":\"2021-11-02T02:58:50Z\",\"source\":\"a\",\"provisioningState\":\"Succeeded\"},\"id\":\"jreafxtsgum\",\"name\":\"jglikkxwslolb\",\"type\":\"pvuzlmv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackupV2 response = manager.longRunningBackups() - .define("ixexcc") - .withExistingFlexibleServer("ngitvgbmhrixkwm", "ijejvegrhbpn") - .withBackupNameV2("eaxhcexdrrvqahqk") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-06-14T23:16:21Z")) - .withSource("jnhyjsvf") - .create(); - - Assertions.assertEquals("ipn", response.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T02:58:50Z"), response.completedTime()); - Assertions.assertEquals("a", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsGetWithResponseMockTests.java deleted file mode 100644 index ba7a19f595a63..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LongRunningBackupsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"backupNameV2\":\"agfhsxtta\",\"backupType\":\"FULL\",\"completedTime\":\"2021-03-18T19:41:59Z\",\"source\":\"aa\",\"provisioningState\":\"Succeeded\"},\"id\":\"tnkdmkqj\",\"name\":\"lwuenvrkp\",\"type\":\"ou\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackupV2 response = manager.longRunningBackupsOperations() - .getWithResponse("elfk", "gplcrpwjxeznoigb", "njwmwkpnbsazejj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("agfhsxtta", response.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T19:41:59Z"), response.completedTime()); - Assertions.assertEquals("aa", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsListMockTests.java deleted file mode 100644 index 2f2c758012cc4..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsListMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LongRunningBackupsOperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"backupNameV2\":\"xqtnq\",\"backupType\":\"FULL\",\"completedTime\":\"2021-05-14T16:05:17Z\",\"source\":\"fffiak\",\"provisioningState\":\"Canceled\"},\"id\":\"qmt\",\"name\":\"d\",\"type\":\"tmmjihyeozph\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.longRunningBackupsOperations().list("ibreb", "aays", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xqtnq", response.iterator().next().backupNameV2()); - Assertions.assertEquals(BackupType.FULL, response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:05:17Z"), - response.iterator().next().completedTime()); - Assertions.assertEquals("fffiak", response.iterator().next().source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java deleted file mode 100644 index 7b4821361d149..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceInner model = BinaryData.fromString( - "{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-10-22T08:31:17Z\",\"maintenanceEndTime\":\"2021-04-26T06:25:06Z\",\"maintenanceExecutionStartTime\":\"2021-06-27T09:44:07Z\",\"maintenanceExecutionEndTime\":\"2020-12-26T11:46:04Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-12-03T14:40:57Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-01-12T02:54:37Z\",\"maintenanceTitle\":\"sd\",\"maintenanceDescription\":\"kgtdlmkkze\",\"provisioningState\":\"Succeeded\"},\"id\":\"ewpusdsttwvogvb\",\"name\":\"ejdcngqqmoakuf\",\"type\":\"m\"}") - .toObject(MaintenanceInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T08:31:17Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceInner model - = new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-10-22T08:31:17Z")); - model = BinaryData.fromObject(model).toObject(MaintenanceInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T08:31:17Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java deleted file mode 100644 index 4425fe4f155fd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-01-11T18:29:49Z\",\"maintenanceEndTime\":\"2021-05-05T04:42:21Z\",\"maintenanceExecutionStartTime\":\"2021-11-16T17:43:34Z\",\"maintenanceExecutionEndTime\":\"2021-10-01T14:51:14Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-06-09T02:28:34Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-11-19T19:19:01Z\",\"maintenanceTitle\":\"cslfaoqzpiyylha\",\"maintenanceDescription\":\"swhccsphk\",\"provisioningState\":\"Deleting\"},\"id\":\"itqscywuggwoluhc\",\"name\":\"bwemhairs\",\"type\":\"rgzdwmsweyp\"},{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-03-24T09:21:34Z\",\"maintenanceEndTime\":\"2021-06-20T03:34:36Z\",\"maintenanceExecutionStartTime\":\"2021-10-03T20:31:22Z\",\"maintenanceExecutionEndTime\":\"2021-07-21T16:23:57Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-08-27T14:08:45Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-10-28T16:47:06Z\",\"maintenanceTitle\":\"ktt\",\"maintenanceDescription\":\"tvlz\",\"provisioningState\":\"Deleting\"},\"id\":\"hz\",\"name\":\"ncsdtclusiyp\",\"type\":\"sfgytguslfead\"},{\"properties\":{\"maintenanceType\":\"RoutineMaintenance\",\"maintenanceState\":\"Scheduled\",\"maintenanceStartTime\":\"2021-11-04T08:30:12Z\",\"maintenanceEndTime\":\"2021-01-09T07:06:25Z\",\"maintenanceExecutionStartTime\":\"2021-05-08T07:59:13Z\",\"maintenanceExecutionEndTime\":\"2021-10-20T10:25:57Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-04-26T05:02:54Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-04-29T01:54:20Z\",\"maintenanceTitle\":\"elolppvksrpqvuj\",\"maintenanceDescription\":\"aehtwd\",\"provisioningState\":\"Failed\"},\"id\":\"swibyr\",\"name\":\"dl\",\"type\":\"h\"},{\"properties\":{\"maintenanceType\":\"SecurityPatches\",\"maintenanceState\":\"Completed\",\"maintenanceStartTime\":\"2021-02-07T05:20:31Z\",\"maintenanceEndTime\":\"2021-11-29T07:17:38Z\",\"maintenanceExecutionStartTime\":\"2021-05-02T16:38:33Z\",\"maintenanceExecutionEndTime\":\"2021-05-07T13:40:48Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-01-15T14:57:40Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-10-09T17:15:47Z\",\"maintenanceTitle\":\"xccedcpnmdyodn\",\"maintenanceDescription\":\"xltjcvnhltiu\",\"provisioningState\":\"Creating\"},\"id\":\"avvwxqi\",\"name\":\"y\",\"type\":\"unyowxwl\"}],\"nextLink\":\"jrkvfgbvfvpdbo\"}") - .toObject(MaintenanceListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T18:29:49Z"), - model.value().get(0).maintenanceStartTime()); - Assertions.assertEquals("jrkvfgbvfvpdbo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceListResult model = new MaintenanceListResult() - .withValue(Arrays.asList( - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-01-11T18:29:49Z")), - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-03-24T09:21:34Z")), - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-11-04T08:30:12Z")), - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-02-07T05:20:31Z")))) - .withNextLink("jrkvfgbvfvpdbo"); - model = BinaryData.fromObject(model).toObject(MaintenanceListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T18:29:49Z"), - model.value().get(0).maintenanceStartTime()); - Assertions.assertEquals("jrkvfgbvfvpdbo", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java deleted file mode 100644 index 10493b5aae32b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenancePropertiesForUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenancePropertiesForUpdate model - = BinaryData.fromString("{\"maintenanceStartTime\":\"2021-08-08T19:14:54Z\"}") - .toObject(MaintenancePropertiesForUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T19:14:54Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenancePropertiesForUpdate model = new MaintenancePropertiesForUpdate() - .withMaintenanceStartTime(OffsetDateTime.parse("2021-08-08T19:14:54Z")); - model = BinaryData.fromObject(model).toObject(MaintenancePropertiesForUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T19:14:54Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java deleted file mode 100644 index 885562eee52b8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceProperties model = BinaryData.fromString( - "{\"maintenanceType\":\"RoutineMaintenance\",\"maintenanceState\":\"InPreparation\",\"maintenanceStartTime\":\"2021-12-02T23:57:11Z\",\"maintenanceEndTime\":\"2021-07-10T05:57:49Z\",\"maintenanceExecutionStartTime\":\"2021-03-20T15:57:26Z\",\"maintenanceExecutionEndTime\":\"2021-01-23T08:17:26Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-01-12T08:45:26Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-05-21T20:17:09Z\",\"maintenanceTitle\":\"pbminr\",\"maintenanceDescription\":\"woyuhhziuief\",\"provisioningState\":\"Failed\"}") - .toObject(MaintenanceProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-02T23:57:11Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceProperties model - = new MaintenanceProperties().withMaintenanceStartTime(OffsetDateTime.parse("2021-12-02T23:57:11Z")); - model = BinaryData.fromObject(model).toObject(MaintenanceProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-02T23:57:11Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java deleted file mode 100644 index d9679a4fc56fa..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceUpdate model - = BinaryData.fromString("{\"properties\":{\"maintenanceStartTime\":\"2021-02-07T20:29:27Z\"}}") - .toObject(MaintenanceUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T20:29:27Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceUpdate model - = new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2021-02-07T20:29:27Z")); - model = BinaryData.fromObject(model).toObject(MaintenanceUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T20:29:27Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java index 91d51869fa162..2a5f164e4c5f4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java @@ -12,24 +12,24 @@ public final class MaintenanceWindowTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaintenanceWindow model = BinaryData.fromString( - "{\"customWindow\":\"ae\",\"startHour\":1901274446,\"startMinute\":1111397810,\"dayOfWeek\":2101228547}") + "{\"customWindow\":\"ryrtihfxtijbpzv\",\"startHour\":1041467339,\"startMinute\":706884387,\"dayOfWeek\":2084129316}") .toObject(MaintenanceWindow.class); - Assertions.assertEquals("ae", model.customWindow()); - Assertions.assertEquals(1901274446, model.startHour()); - Assertions.assertEquals(1111397810, model.startMinute()); - Assertions.assertEquals(2101228547, model.dayOfWeek()); + Assertions.assertEquals("ryrtihfxtijbpzv", model.customWindow()); + Assertions.assertEquals(1041467339, model.startHour()); + Assertions.assertEquals(706884387, model.startMinute()); + Assertions.assertEquals(2084129316, model.dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("ae") - .withStartHour(1901274446) - .withStartMinute(1111397810) - .withDayOfWeek(2101228547); + MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("ryrtihfxtijbpzv") + .withStartHour(1041467339) + .withStartMinute(706884387) + .withDayOfWeek(2084129316); model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("ae", model.customWindow()); - Assertions.assertEquals(1901274446, model.startHour()); - Assertions.assertEquals(1111397810, model.startMinute()); - Assertions.assertEquals(2101228547, model.dayOfWeek()); + Assertions.assertEquals("ryrtihfxtijbpzv", model.customWindow()); + Assertions.assertEquals(1041467339, model.startHour()); + Assertions.assertEquals(706884387, model.startMinute()); + Assertions.assertEquals(2084129316, model.dayOfWeek()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java deleted file mode 100644 index 9edc1e5ab6ce1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenancesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-07-29T02:48:32Z\",\"maintenanceEndTime\":\"2021-06-25T00:42:10Z\",\"maintenanceExecutionStartTime\":\"2021-03-11T16:27:53Z\",\"maintenanceExecutionEndTime\":\"2021-08-25T02:28:28Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-11-04T20:43:16Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-05-22T09:32:30Z\",\"maintenanceTitle\":\"slstvasy\",\"maintenanceDescription\":\"xdza\",\"provisioningState\":\"Failed\"},\"id\":\"oohgu\",\"name\":\"fuzboyjathwtzolb\",\"type\":\"emwmdxmebwjs\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.maintenances().list("jpdn", "zhajoylhjlmuo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T02:48:32Z"), - response.iterator().next().maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java deleted file mode 100644 index 983d417bfbab6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenancesReadWithResponseMockTests { - @Test - public void testReadWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-08-06T13:46:48Z\",\"maintenanceEndTime\":\"2021-09-29T04:01:44Z\",\"maintenanceExecutionStartTime\":\"2021-05-03T20:49:03Z\",\"maintenanceExecutionEndTime\":\"2020-12-21T07:15:21Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-05-22T08:13:46Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-03-16T15:28:43Z\",\"maintenanceTitle\":\"qnsdfzpbgtgky\",\"maintenanceDescription\":\"dgh\",\"provisioningState\":\"Deleting\"},\"id\":\"utlwxezwzhok\",\"name\":\"bwnhhtql\",\"type\":\"ehgpp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Maintenance response = manager.maintenances() - .readWithResponse("nwm", "tmvpdvjdhtt", "a", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T13:46:48Z"), response.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java deleted file mode 100644 index 885c59197a066..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenancesUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-09-19T13:00:06Z\",\"maintenanceEndTime\":\"2021-10-26T21:38:36Z\",\"maintenanceExecutionStartTime\":\"2021-09-01T22:04:46Z\",\"maintenanceExecutionEndTime\":\"2021-07-23T12:06:13Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-06-29T04:06:59Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-04-05T10:55:26Z\",\"maintenanceTitle\":\"ucb\",\"maintenanceDescription\":\"tgdqohmcwsldriz\",\"provisioningState\":\"Succeeded\"},\"id\":\"bra\",\"name\":\"llibphbqzmizak\",\"type\":\"kan\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Maintenance response = manager.maintenances() - .update("pifhpfeoajvgcxtx", "csheafidltugsr", "smkss", - new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2021-07-01T11:45:20Z")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T13:00:06Z"), response.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerSkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerSkuTests.java deleted file mode 100644 index 0cb6310db1ea9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerSkuTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier; -import org.junit.jupiter.api.Assertions; - -public final class MySqlServerSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MySqlServerSku model = BinaryData.fromString("{\"name\":\"enjbdlwtgrhp\",\"tier\":\"GeneralPurpose\"}") - .toObject(MySqlServerSku.class); - Assertions.assertEquals("enjbdlwtgrhp", model.name()); - Assertions.assertEquals(ServerSkuTier.GENERAL_PURPOSE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MySqlServerSku model = new MySqlServerSku().withName("enjbdlwtgrhp").withTier(ServerSkuTier.GENERAL_PURPOSE); - model = BinaryData.fromObject(model).toObject(MySqlServerSku.class); - Assertions.assertEquals("enjbdlwtgrhp", model.name()); - Assertions.assertEquals(ServerSkuTier.GENERAL_PURPOSE, model.tier()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java index 5d5d919bed207..a9986676fa5cd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java @@ -12,20 +12,20 @@ public final class NameAvailabilityInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NameAvailabilityInner model - = BinaryData.fromString("{\"message\":\"imfnjhfjx\",\"nameAvailable\":true,\"reason\":\"kkfoqr\"}") + = BinaryData.fromString("{\"message\":\"attpngjcrcczsq\",\"nameAvailable\":true,\"reason\":\"mdajv\"}") .toObject(NameAvailabilityInner.class); - Assertions.assertEquals("imfnjhfjx", model.message()); + Assertions.assertEquals("attpngjcrcczsq", model.message()); Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("kkfoqr", model.reason()); + Assertions.assertEquals("mdajv", model.reason()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NameAvailabilityInner model - = new NameAvailabilityInner().withMessage("imfnjhfjx").withNameAvailable(true).withReason("kkfoqr"); + = new NameAvailabilityInner().withMessage("attpngjcrcczsq").withNameAvailable(true).withReason("mdajv"); model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals("imfnjhfjx", model.message()); + Assertions.assertEquals("attpngjcrcczsq", model.message()); Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("kkfoqr", model.reason()); + Assertions.assertEquals("mdajv", model.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java index 1f11aa80dc9ac..ee624a88a2b07 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java @@ -11,17 +11,17 @@ public final class NameAvailabilityRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"epxgyqagvr\",\"type\":\"npkukghimdblx\"}") - .toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("epxgyqagvr", model.name()); - Assertions.assertEquals("npkukghimdblx", model.type()); + NameAvailabilityRequest model + = BinaryData.fromString("{\"name\":\"qsl\",\"type\":\"yvxyqjp\"}").toObject(NameAvailabilityRequest.class); + Assertions.assertEquals("qsl", model.name()); + Assertions.assertEquals("yvxyqjp", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NameAvailabilityRequest model = new NameAvailabilityRequest().withName("epxgyqagvr").withType("npkukghimdblx"); + NameAvailabilityRequest model = new NameAvailabilityRequest().withName("qsl").withType("yvxyqjp"); model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("epxgyqagvr", model.name()); - Assertions.assertEquals("npkukghimdblx", model.type()); + Assertions.assertEquals("qsl", model.name()); + Assertions.assertEquals("yvxyqjp", model.type()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java index 66759c9b36941..3fbd9a3737201 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import org.junit.jupiter.api.Assertions; @@ -13,21 +12,18 @@ public final class NetworkTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Network model = BinaryData.fromString( - "{\"publicNetworkAccess\":\"Disabled\",\"delegatedSubnetResourceId\":\"snzwd\",\"privateDnsZoneResourceId\":\"bavo\"}") + "{\"publicNetworkAccess\":\"Enabled\",\"delegatedSubnetResourceId\":\"zdxtayrlhmwhf\",\"privateDnsZoneResourceId\":\"rqobmtuk\"}") .toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("snzwd", model.delegatedSubnetResourceId()); - Assertions.assertEquals("bavo", model.privateDnsZoneResourceId()); + Assertions.assertEquals("zdxtayrlhmwhf", model.delegatedSubnetResourceId()); + Assertions.assertEquals("rqobmtuk", model.privateDnsZoneResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Network model = new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED) - .withDelegatedSubnetResourceId("snzwd") - .withPrivateDnsZoneResourceId("bavo"); + Network model + = new Network().withDelegatedSubnetResourceId("zdxtayrlhmwhf").withPrivateDnsZoneResourceId("rqobmtuk"); model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("snzwd", model.delegatedSubnetResourceId()); - Assertions.assertEquals("bavo", model.privateDnsZoneResourceId()); + Assertions.assertEquals("zdxtayrlhmwhf", model.delegatedSubnetResourceId()); + Assertions.assertEquals("rqobmtuk", model.privateDnsZoneResourceId()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java index c779fb0d2dfd7..ea811568e3069 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java @@ -12,24 +12,24 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"wtl\",\"resource\":\"guxawqaldsyuuxi\",\"operation\":\"rqf\",\"description\":\"wyznkbyku\"}") + "{\"provider\":\"wkuofoskghsauu\",\"resource\":\"jmvxie\",\"operation\":\"ugidyjrr\",\"description\":\"y\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("wtl", model.provider()); - Assertions.assertEquals("guxawqaldsyuuxi", model.resource()); - Assertions.assertEquals("rqf", model.operation()); - Assertions.assertEquals("wyznkbyku", model.description()); + Assertions.assertEquals("wkuofoskghsauu", model.provider()); + Assertions.assertEquals("jmvxie", model.resource()); + Assertions.assertEquals("ugidyjrr", model.operation()); + Assertions.assertEquals("y", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("wtl") - .withResource("guxawqaldsyuuxi") - .withOperation("rqf") - .withDescription("wyznkbyku"); + OperationDisplay model = new OperationDisplay().withProvider("wkuofoskghsauu") + .withResource("jmvxie") + .withOperation("ugidyjrr") + .withDescription("y"); model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("wtl", model.provider()); - Assertions.assertEquals("guxawqaldsyuuxi", model.resource()); - Assertions.assertEquals("rqf", model.operation()); - Assertions.assertEquals("wyznkbyku", model.description()); + Assertions.assertEquals("wkuofoskghsauu", model.provider()); + Assertions.assertEquals("jmvxie", model.resource()); + Assertions.assertEquals("ugidyjrr", model.operation()); + Assertions.assertEquals("y", model.description()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java index 21b9429a157ff..e6507813cb7ee 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java @@ -15,33 +15,33 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"puqujmqlgkfbtn\",\"display\":{\"provider\":\"ongbjcnt\",\"resource\":\"i\",\"operation\":\"jed\",\"description\":\"wwa\"},\"origin\":\"kojvd\",\"properties\":{\"rzgszufoxci\":\"datafoqouicybx\",\"haz\":\"dataopidoamciodh\",\"toego\":\"datakhnzbonlw\",\"vbtqgsfraoyzk\":\"datadwbwhkszzcmrvexz\"}}") + "{\"name\":\"ys\",\"display\":{\"provider\":\"iuxhqyudxorr\",\"resource\":\"b\",\"operation\":\"czvyifq\",\"description\":\"kdvjsll\"},\"origin\":\"vvdfwatkpnpul\",\"properties\":{\"ruwiqzbqjvsov\":\"databczw\",\"hzdobpxjmflbvvnc\":\"datayokacspkw\",\"rsa\":\"datarkcciwwzjuqk\"}}") .toObject(OperationInner.class); - Assertions.assertEquals("puqujmqlgkfbtn", model.name()); - Assertions.assertEquals("ongbjcnt", model.display().provider()); - Assertions.assertEquals("i", model.display().resource()); - Assertions.assertEquals("jed", model.display().operation()); - Assertions.assertEquals("wwa", model.display().description()); - Assertions.assertEquals("kojvd", model.origin()); + Assertions.assertEquals("ys", model.name()); + Assertions.assertEquals("iuxhqyudxorr", model.display().provider()); + Assertions.assertEquals("b", model.display().resource()); + Assertions.assertEquals("czvyifq", model.display().operation()); + Assertions.assertEquals("kdvjsll", model.display().description()); + Assertions.assertEquals("vvdfwatkpnpul", model.origin()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("puqujmqlgkfbtn") - .withDisplay(new OperationDisplay().withProvider("ongbjcnt") - .withResource("i") - .withOperation("jed") - .withDescription("wwa")) - .withOrigin("kojvd") - .withProperties(mapOf("rzgszufoxci", "datafoqouicybx", "haz", "dataopidoamciodh", "toego", "datakhnzbonlw", - "vbtqgsfraoyzk", "datadwbwhkszzcmrvexz")); + OperationInner model = new OperationInner().withName("ys") + .withDisplay(new OperationDisplay().withProvider("iuxhqyudxorr") + .withResource("b") + .withOperation("czvyifq") + .withDescription("kdvjsll")) + .withOrigin("vvdfwatkpnpul") + .withProperties( + mapOf("ruwiqzbqjvsov", "databczw", "hzdobpxjmflbvvnc", "datayokacspkw", "rsa", "datarkcciwwzjuqk")); model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("puqujmqlgkfbtn", model.name()); - Assertions.assertEquals("ongbjcnt", model.display().provider()); - Assertions.assertEquals("i", model.display().resource()); - Assertions.assertEquals("jed", model.display().operation()); - Assertions.assertEquals("wwa", model.display().description()); - Assertions.assertEquals("kojvd", model.origin()); + Assertions.assertEquals("ys", model.name()); + Assertions.assertEquals("iuxhqyudxorr", model.display().provider()); + Assertions.assertEquals("b", model.display().resource()); + Assertions.assertEquals("czvyifq", model.display().operation()); + Assertions.assertEquals("kdvjsll", model.display().description()); + Assertions.assertEquals("vvdfwatkpnpul", model.origin()); } // Use "Map.of" if available diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java index 41305c35415c0..9662b875c5fbc 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java @@ -17,35 +17,35 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"bvtvudutncormr\",\"display\":{\"provider\":\"tvcof\",\"resource\":\"f\",\"operation\":\"kgjubgdknnqvsazn\",\"description\":\"tor\"},\"origin\":\"sgsahmkycgr\",\"properties\":{\"vdmovsmzlxwabm\":\"datajuetaebur\"}}],\"nextLink\":\"efkifr\"}") + "{\"value\":[{\"name\":\"hltrpmopjmcmatuo\",\"display\":{\"provider\":\"fu\",\"resource\":\"aodsfcpkv\",\"operation\":\"dpuozmyz\",\"description\":\"agfuaxbezyiu\"},\"origin\":\"ktwh\",\"properties\":{\"wqsmbsur\":\"datawz\"}}],\"nextLink\":\"imoryocfsfksym\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("bvtvudutncormr", model.value().get(0).name()); - Assertions.assertEquals("tvcof", model.value().get(0).display().provider()); - Assertions.assertEquals("f", model.value().get(0).display().resource()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.value().get(0).display().operation()); - Assertions.assertEquals("tor", model.value().get(0).display().description()); - Assertions.assertEquals("sgsahmkycgr", model.value().get(0).origin()); - Assertions.assertEquals("efkifr", model.nextLink()); + Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).name()); + Assertions.assertEquals("fu", model.value().get(0).display().provider()); + Assertions.assertEquals("aodsfcpkv", model.value().get(0).display().resource()); + Assertions.assertEquals("dpuozmyz", model.value().get(0).display().operation()); + Assertions.assertEquals("agfuaxbezyiu", model.value().get(0).display().description()); + Assertions.assertEquals("ktwh", model.value().get(0).origin()); + Assertions.assertEquals("imoryocfsfksym", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { OperationListResult model - = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("bvtvudutncormr") - .withDisplay(new OperationDisplay().withProvider("tvcof") - .withResource("f") - .withOperation("kgjubgdknnqvsazn") - .withDescription("tor")) - .withOrigin("sgsahmkycgr") - .withProperties(mapOf("vdmovsmzlxwabm", "datajuetaebur")))).withNextLink("efkifr"); + = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("hltrpmopjmcmatuo") + .withDisplay(new OperationDisplay().withProvider("fu") + .withResource("aodsfcpkv") + .withOperation("dpuozmyz") + .withDescription("agfuaxbezyiu")) + .withOrigin("ktwh") + .withProperties(mapOf("wqsmbsur", "datawz")))).withNextLink("imoryocfsfksym"); model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("bvtvudutncormr", model.value().get(0).name()); - Assertions.assertEquals("tvcof", model.value().get(0).display().provider()); - Assertions.assertEquals("f", model.value().get(0).display().resource()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.value().get(0).display().operation()); - Assertions.assertEquals("tor", model.value().get(0).display().description()); - Assertions.assertEquals("sgsahmkycgr", model.value().get(0).origin()); - Assertions.assertEquals("efkifr", model.nextLink()); + Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).name()); + Assertions.assertEquals("fu", model.value().get(0).display().provider()); + Assertions.assertEquals("aodsfcpkv", model.value().get(0).display().resource()); + Assertions.assertEquals("dpuozmyz", model.value().get(0).display().operation()); + Assertions.assertEquals("agfuaxbezyiu", model.value().get(0).display().description()); + Assertions.assertEquals("ktwh", model.value().get(0).origin()); + Assertions.assertEquals("imoryocfsfksym", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java deleted file mode 100644 index 0aea736933d9e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; - -public final class OperationProgressResponseTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProgressResponseType model - = BinaryData.fromString("{\"objectType\":\"OperationProgressResponseType\"}") - .toObject(OperationProgressResponseType.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProgressResponseType model = new OperationProgressResponseType(); - model = BinaryData.fromObject(model).toObject(OperationProgressResponseType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java index 224dc299e04df..a267c54bc1f71 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java @@ -22,7 +22,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"sftufqobrjlna\",\"display\":{\"provider\":\"ckknhxkizvy\",\"resource\":\"rzvul\",\"operation\":\"aaeranokqgukk\",\"description\":\"nvbroylaxx\"},\"origin\":\"cdisd\",\"properties\":{\"yvycytdclxgcckn\":\"datajbjsvgjrwh\"}}]}"; + = "{\"value\":[{\"name\":\"iexpbtgiwbwo\",\"display\":{\"provider\":\"ashrt\",\"resource\":\"kcnqxwbpo\",\"operation\":\"lpiujwaa\",\"description\":\"pqiiobyuqe\"},\"origin\":\"qlpqwcciuq\",\"properties\":{\"kuwhh\":\"databutauvfb\",\"koymkcd\":\"datahykojoxafnndlpic\",\"pkkpw\":\"datah\",\"jxywsuws\":\"datareqnovvqfov\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,11 +33,11 @@ public void testList() throws Exception { PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("sftufqobrjlna", response.iterator().next().name()); - Assertions.assertEquals("ckknhxkizvy", response.iterator().next().display().provider()); - Assertions.assertEquals("rzvul", response.iterator().next().display().resource()); - Assertions.assertEquals("aaeranokqgukk", response.iterator().next().display().operation()); - Assertions.assertEquals("nvbroylaxx", response.iterator().next().display().description()); - Assertions.assertEquals("cdisd", response.iterator().next().origin()); + Assertions.assertEquals("iexpbtgiwbwo", response.iterator().next().name()); + Assertions.assertEquals("ashrt", response.iterator().next().display().provider()); + Assertions.assertEquals("kcnqxwbpo", response.iterator().next().display().resource()); + Assertions.assertEquals("lpiujwaa", response.iterator().next().display().operation()); + Assertions.assertEquals("pqiiobyuqe", response.iterator().next().display().description()); + Assertions.assertEquals("qlpqwcciuq", response.iterator().next().origin()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 95d2e8c72f679..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"dectehfiqsc\",\"eypvhezrkg\",\"hcjrefovgmk\",\"sle\"],\"privateEndpoint\":{\"id\":\"xyqj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"t\",\"actionsRequired\":\"ngj\"},\"provisioningState\":\"Creating\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ngj", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("t") - .withActionsRequired("ngj")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ngj", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionTests.java deleted file mode 100644 index 5a674b4315c13..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnection model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"mohctb\"],\"privateEndpoint\":{\"id\":\"dwxdndnv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"jjugwdkcglhslaz\",\"actionsRequired\":\"yggdtjixh\"},\"provisioningState\":\"Creating\"},\"id\":\"fqweykhmene\",\"name\":\"fyexfwhy\",\"type\":\"cibvyvdcsitynn\"}") - .toObject(PrivateEndpointConnection.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jjugwdkcglhslaz", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("yggdtjixh", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnection model = new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("jjugwdkcglhslaz") - .withActionsRequired("yggdtjixh")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnection.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jjugwdkcglhslaz", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("yggdtjixh", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java deleted file mode 100644 index 1975423089920..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"zsqpjhvmdajvny\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 830a14a9c3c53..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model - = BinaryData.fromString("{\"status\":\"Approved\",\"description\":\"q\",\"actionsRequired\":\"a\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("a", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("q") - .withActionsRequired("a"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("a", model.actionsRequired()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java index 1f94502176b25..8a80f52278f9d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java @@ -13,21 +13,21 @@ public final class ServerBackupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerBackupInner model = BinaryData.fromString( - "{\"properties\":{\"backupType\":\"ouajpsqucmpoyf\",\"completedTime\":\"2021-02-06T21:08:58Z\",\"source\":\"gknygjofjddeqs\"},\"id\":\"eupewnwreitjz\",\"name\":\"flusarhmof\",\"type\":\"qhsmyurkdtml\"}") + "{\"properties\":{\"backupType\":\"dpvwryoqpsoaccta\",\"completedTime\":\"2021-06-15T10:03:50Z\",\"source\":\"j\"},\"id\":\"hbcryffdfdosyge\",\"name\":\"paojakhmsbzjh\",\"type\":\"rzevdphlxaol\"}") .toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", model.source()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T10:03:50Z"), model.completedTime()); + Assertions.assertEquals("j", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServerBackupInner model = new ServerBackupInner().withBackupType("ouajpsqucmpoyf") - .withCompletedTime(OffsetDateTime.parse("2021-02-06T21:08:58Z")) - .withSource("gknygjofjddeqs"); + ServerBackupInner model = new ServerBackupInner().withBackupType("dpvwryoqpsoaccta") + .withCompletedTime(OffsetDateTime.parse("2021-06-15T10:03:50Z")) + .withSource("j"); model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", model.source()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T10:03:50Z"), model.completedTime()); + Assertions.assertEquals("j", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java index ace97346ede5d..3a4db45003ee7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java @@ -15,34 +15,28 @@ public final class ServerBackupListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerBackupListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"t\",\"completedTime\":\"2021-02-24T11:34:50Z\",\"source\":\"hmwhfpmrqo\"},\"id\":\"tu\",\"name\":\"knryrtihfxtij\",\"type\":\"pzvgnwzsymglzufc\"},{\"properties\":{\"backupType\":\"ohdbihanufh\",\"completedTime\":\"2021-01-11T10:02:32Z\",\"source\":\"y\"},\"id\":\"git\",\"name\":\"xqhabi\",\"type\":\"pikxwczbyscnpqxu\"},{\"properties\":{\"backupType\":\"y\",\"completedTime\":\"2021-06-17T16:29:35Z\",\"source\":\"b\"},\"id\":\"rkxvdum\",\"name\":\"grtfwvu\",\"type\":\"xgaudccs\"},{\"properties\":{\"backupType\":\"jcny\",\"completedTime\":\"2021-04-04T05:13:51Z\",\"source\":\"ryhtnapczwlokjy\"},\"id\":\"kkvnipjox\",\"name\":\"jnchgej\",\"type\":\"podmailzydehojwy\"}],\"nextLink\":\"uxinpmqnjaq\"}") + "{\"value\":[{\"properties\":{\"backupType\":\"peqfpjkjl\",\"completedTime\":\"2021-11-24T18:52:18Z\",\"source\":\"dvhpfxxypininm\"},\"id\":\"huyb\",\"name\":\"kpode\",\"type\":\"ooginuvamih\"},{\"properties\":{\"backupType\":\"narxzxtheotus\",\"completedTime\":\"2021-05-22T18:50:21Z\",\"source\":\"v\"},\"id\":\"iqihn\",\"name\":\"un\",\"type\":\"bwjzr\"}],\"nextLink\":\"ygxgispemvtz\"}") .toObject(ServerBackupListResult.class); - Assertions.assertEquals("t", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T11:34:50Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hmwhfpmrqo", model.value().get(0).source()); - Assertions.assertEquals("uxinpmqnjaq", model.nextLink()); + Assertions.assertEquals("peqfpjkjl", model.value().get(0).backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T18:52:18Z"), model.value().get(0).completedTime()); + Assertions.assertEquals("dvhpfxxypininm", model.value().get(0).source()); + Assertions.assertEquals("ygxgispemvtz", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServerBackupListResult model = new ServerBackupListResult().withValue(Arrays.asList( - new ServerBackupInner().withBackupType("t") - .withCompletedTime(OffsetDateTime.parse("2021-02-24T11:34:50Z")) - .withSource("hmwhfpmrqo"), - new ServerBackupInner().withBackupType("ohdbihanufh") - .withCompletedTime(OffsetDateTime.parse("2021-01-11T10:02:32Z")) - .withSource("y"), - new ServerBackupInner().withBackupType("y") - .withCompletedTime(OffsetDateTime.parse("2021-06-17T16:29:35Z")) - .withSource("b"), - new ServerBackupInner().withBackupType("jcny") - .withCompletedTime(OffsetDateTime.parse("2021-04-04T05:13:51Z")) - .withSource("ryhtnapczwlokjy"))) - .withNextLink("uxinpmqnjaq"); + new ServerBackupInner().withBackupType("peqfpjkjl") + .withCompletedTime(OffsetDateTime.parse("2021-11-24T18:52:18Z")) + .withSource("dvhpfxxypininm"), + new ServerBackupInner().withBackupType("narxzxtheotus") + .withCompletedTime(OffsetDateTime.parse("2021-05-22T18:50:21Z")) + .withSource("v"))) + .withNextLink("ygxgispemvtz"); model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals("t", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T11:34:50Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hmwhfpmrqo", model.value().get(0).source()); - Assertions.assertEquals("uxinpmqnjaq", model.nextLink()); + Assertions.assertEquals("peqfpjkjl", model.value().get(0).backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T18:52:18Z"), model.value().get(0).completedTime()); + Assertions.assertEquals("dvhpfxxypininm", model.value().get(0).source()); + Assertions.assertEquals("ygxgispemvtz", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java index a38a1940c916f..976582df54bfb 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java @@ -12,23 +12,22 @@ public final class ServerBackupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServerBackupProperties model = BinaryData - .fromString( - "{\"backupType\":\"ekuksjtx\",\"completedTime\":\"2021-01-21T08:28Z\",\"source\":\"mparcryuanzw\"}") + ServerBackupProperties model = BinaryData.fromString( + "{\"backupType\":\"qtrgqjbpfzfsinzg\",\"completedTime\":\"2021-07-30T11:45:35Z\",\"source\":\"rwzoxxjtfelluwf\"}") .toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", model.source()); + Assertions.assertEquals("qtrgqjbpfzfsinzg", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T11:45:35Z"), model.completedTime()); + Assertions.assertEquals("rwzoxxjtfelluwf", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServerBackupProperties model = new ServerBackupProperties().withBackupType("ekuksjtx") - .withCompletedTime(OffsetDateTime.parse("2021-01-21T08:28Z")) - .withSource("mparcryuanzw"); + ServerBackupProperties model = new ServerBackupProperties().withBackupType("qtrgqjbpfzfsinzg") + .withCompletedTime(OffsetDateTime.parse("2021-07-30T11:45:35Z")) + .withSource("rwzoxxjtfelluwf"); model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", model.source()); + Assertions.assertEquals("qtrgqjbpfzfsinzg", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T11:45:35Z"), model.completedTime()); + Assertions.assertEquals("rwzoxxjtfelluwf", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java deleted file mode 100644 index 7835b4248a076..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupPropertiesV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupPropertiesV2 model = BinaryData.fromString( - "{\"backupNameV2\":\"fziton\",\"backupType\":\"FULL\",\"completedTime\":\"2021-10-07T16:40:01Z\",\"source\":\"kjlxofpdvhpf\",\"provisioningState\":\"Canceled\"}") - .toObject(ServerBackupPropertiesV2.class); - Assertions.assertEquals("fziton", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T16:40:01Z"), model.completedTime()); - Assertions.assertEquals("kjlxofpdvhpf", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupPropertiesV2 model = new ServerBackupPropertiesV2().withBackupNameV2("fziton") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-10-07T16:40:01Z")) - .withSource("kjlxofpdvhpf"); - model = BinaryData.fromObject(model).toObject(ServerBackupPropertiesV2.class); - Assertions.assertEquals("fziton", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T16:40:01Z"), model.completedTime()); - Assertions.assertEquals("kjlxofpdvhpf", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java deleted file mode 100644 index d9e60b84b397c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupV2InnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupV2Inner model = BinaryData.fromString( - "{\"properties\":{\"backupNameV2\":\"hmsbzjhcrzevdp\",\"backupType\":\"FULL\",\"completedTime\":\"2021-05-28T12:04:46Z\",\"source\":\"thqt\",\"provisioningState\":\"Failed\"},\"id\":\"bpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") - .toObject(ServerBackupV2Inner.class); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T12:04:46Z"), model.completedTime()); - Assertions.assertEquals("thqt", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupV2Inner model = new ServerBackupV2Inner().withBackupNameV2("hmsbzjhcrzevdp") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-05-28T12:04:46Z")) - .withSource("thqt"); - model = BinaryData.fromObject(model).toObject(ServerBackupV2Inner.class); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T12:04:46Z"), model.completedTime()); - Assertions.assertEquals("thqt", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java deleted file mode 100644 index 8026d3de1a5a3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java +++ /dev/null @@ -1,47 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2ListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupV2ListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupV2ListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"backupNameV2\":\"nmayhuybb\",\"backupType\":\"FULL\",\"completedTime\":\"2021-04-30T05:44:17Z\",\"source\":\"ooginuvamih\",\"provisioningState\":\"Creating\"},\"id\":\"arxzxtheot\",\"name\":\"si\",\"type\":\"yevc\"},{\"properties\":{\"backupNameV2\":\"ihnhun\",\"backupType\":\"FULL\",\"completedTime\":\"2021-09-21T17:58:39Z\",\"source\":\"nfygxgispemvtz\",\"provisioningState\":\"Canceled\"},\"id\":\"ubljofxqe\",\"name\":\"fjaeq\",\"type\":\"hqjbasvmsmj\"}],\"nextLink\":\"lngsntnbybkzgcwr\"}") - .toObject(ServerBackupV2ListResult.class); - Assertions.assertEquals("nmayhuybb", model.value().get(0).backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T05:44:17Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("ooginuvamih", model.value().get(0).source()); - Assertions.assertEquals("lngsntnbybkzgcwr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupV2ListResult model = new ServerBackupV2ListResult().withValue(Arrays.asList( - new ServerBackupV2Inner().withBackupNameV2("nmayhuybb") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-04-30T05:44:17Z")) - .withSource("ooginuvamih"), - new ServerBackupV2Inner().withBackupNameV2("ihnhun") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-09-21T17:58:39Z")) - .withSource("nfygxgispemvtz"))) - .withNextLink("lngsntnbybkzgcwr"); - model = BinaryData.fromObject(model).toObject(ServerBackupV2ListResult.class); - Assertions.assertEquals("nmayhuybb", model.value().get(0).backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T05:44:17Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("ooginuvamih", model.value().get(0).source()); - Assertions.assertEquals("lngsntnbybkzgcwr", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java index 3cfc864f707a4..921678ccd5a39 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java @@ -11,7 +11,7 @@ public final class ServerEditionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerEditionCapability model = BinaryData.fromString( - "{\"name\":\"b\",\"supportedStorageEditions\":[{\"name\":\"hxw\",\"minStorageSize\":3296324353264584274,\"maxStorageSize\":979982585731968609,\"minBackupRetentionDays\":8355520612424913730,\"maxBackupRetentionDays\":8923409732995177095,\"minBackupIntervalHours\":2179964929777678685,\"maxBackupIntervalHours\":3734794049628665607}],\"supportedServerVersions\":[{\"name\":\"gu\",\"supportedSkus\":[{\"name\":\"kfssxqukkf\",\"vCores\":4186813659074842761,\"supportedIops\":7460763687758835204,\"supportedMemoryPerVCoreMB\":2314945362863508149},{\"name\":\"kde\",\"vCores\":7346144282347512658,\"supportedIops\":3908057410560236537,\"supportedMemoryPerVCoreMB\":681890883846800256},{\"name\":\"ghxpkdw\",\"vCores\":5027473446907598737,\"supportedIops\":3085775452141512212,\"supportedMemoryPerVCoreMB\":574738342939177032}]},{\"name\":\"nyqupedeojnabck\",\"supportedSkus\":[{\"name\":\"xpsiebtfhvpes\",\"vCores\":465204548122910973,\"supportedIops\":3931920039433301426,\"supportedMemoryPerVCoreMB\":8579688850362175791},{\"name\":\"dhtldwkyz\",\"vCores\":5735733954229084765,\"supportedIops\":5199326091751618415,\"supportedMemoryPerVCoreMB\":5760355452079192141},{\"name\":\"svlxotogtwrup\",\"vCores\":5490136749692372798,\"supportedIops\":5861004465019005032,\"supportedMemoryPerVCoreMB\":1442555394211709568}]},{\"name\":\"ceoveilovno\",\"supportedSkus\":[{\"name\":\"fcnj\",\"vCores\":2295075824007541561,\"supportedIops\":4077961902359285386,\"supportedMemoryPerVCoreMB\":9006034643564809106}]},{\"name\":\"phywpnvj\",\"supportedSkus\":[{\"name\":\"ermclfplphoxuscr\",\"vCores\":8751195016646991326,\"supportedIops\":1457030135916183053,\"supportedMemoryPerVCoreMB\":6300383751543557162},{\"name\":\"azqugxywpmueefj\",\"vCores\":6619797185475635506,\"supportedIops\":833817548931918464,\"supportedMemoryPerVCoreMB\":2752624738826273376},{\"name\":\"uyonobglaoc\",\"vCores\":3198824190275494463,\"supportedIops\":7428332481829076684,\"supportedMemoryPerVCoreMB\":2435462499036948101},{\"name\":\"ytlmoyrxvwfud\",\"vCores\":7047535531175801519,\"supportedIops\":6478150774243714531,\"supportedMemoryPerVCoreMB\":7345023164643375975}]}]}") + "{\"name\":\"nfnbacfionlebxe\",\"supportedStorageEditions\":[{\"name\":\"zxdpnqbqqw\",\"minStorageSize\":2526678259667108543,\"maxStorageSize\":1458668924048164836,\"minBackupRetentionDays\":383995801038376266,\"maxBackupRetentionDays\":4205827179798225737},{\"name\":\"snjampmng\",\"minStorageSize\":4715477742922953233,\"maxStorageSize\":2627336539557135356,\"minBackupRetentionDays\":4377641915122156936,\"maxBackupRetentionDays\":4315101559151768255}],\"supportedServerVersions\":[{\"name\":\"qvpkvlrxnjeaseip\",\"supportedSkus\":[{\"name\":\"lokeyy\",\"vCores\":1523460255580500378,\"supportedIops\":1246859219124083387,\"supportedMemoryPerVCoreMB\":5538754849059417919},{\"name\":\"hpdjpjumasxa\",\"vCores\":5415411474349090758,\"supportedIops\":791832081608242916,\"supportedMemoryPerVCoreMB\":5443053800820392121}]}]}") .toObject(ServerEditionCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java deleted file mode 100644 index dd0511a813df6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; - -public final class ServerEditionCapabilityV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerEditionCapabilityV2 model = BinaryData.fromString( - "{\"name\":\"ynt\",\"defaultSku\":\"zihleosjswsr\",\"defaultStorageSize\":2109654936,\"supportedStorageEditions\":[{\"name\":\"pzbchck\",\"minStorageSize\":2854774053179599895,\"maxStorageSize\":1485781333279221800,\"minBackupRetentionDays\":5253901469218234433,\"maxBackupRetentionDays\":7391788456233994805,\"minBackupIntervalHours\":9110638911765212224,\"maxBackupIntervalHours\":8875618774585763329},{\"name\":\"atrwyhqmibzyh\",\"minStorageSize\":3835671102059625578,\"maxStorageSize\":5859643880021118717,\"minBackupRetentionDays\":8514747756397866832,\"maxBackupRetentionDays\":4085302065865673737,\"minBackupIntervalHours\":6601309306098358089,\"maxBackupIntervalHours\":4756010311347922527}],\"supportedSkus\":[{\"name\":\"nmabik\",\"vCores\":1884314669361039477,\"supportedIops\":6435795103188177139,\"supportedMemoryPerVCoreMB\":7362187105220240358,\"supportedZones\":[\"lwwrl\",\"dmtnc\"],\"supportedHAMode\":[\"otllxdyhgsyo\"]}]}") - .toObject(ServerEditionCapabilityV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerEditionCapabilityV2 model = new ServerEditionCapabilityV2(); - model = BinaryData.fromObject(model).toObject(ServerEditionCapabilityV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java deleted file mode 100644 index d37e93e19acaf..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import org.junit.jupiter.api.Assertions; - -public final class ServerGtidSetParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerGtidSetParameter model - = BinaryData.fromString("{\"gtidSet\":\"csonpclhoco\"}").toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("csonpclhoco", model.gtidSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerGtidSetParameter model = new ServerGtidSetParameter().withGtidSet("csonpclhoco"); - model = BinaryData.fromObject(model).toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("csonpclhoco", model.gtidSet()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java index 823842c874748..8f137360d1467 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java @@ -13,18 +13,18 @@ public final class ServerRestartParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerRestartParameter model - = BinaryData.fromString("{\"restartWithFailover\":\"Disabled\",\"maxFailoverSeconds\":28529322}") + = BinaryData.fromString("{\"restartWithFailover\":\"Disabled\",\"maxFailoverSeconds\":127605943}") .toObject(ServerRestartParameter.class); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.restartWithFailover()); - Assertions.assertEquals(28529322, model.maxFailoverSeconds()); + Assertions.assertEquals(127605943, model.maxFailoverSeconds()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServerRestartParameter model = new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.DISABLED) - .withMaxFailoverSeconds(28529322); + .withMaxFailoverSeconds(127605943); model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.restartWithFailover()); - Assertions.assertEquals(28529322, model.maxFailoverSeconds()); + Assertions.assertEquals(127605943, model.maxFailoverSeconds()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java index 09f050651a8fc..7c69190f0e17d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java @@ -11,7 +11,7 @@ public final class ServerVersionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerVersionCapability model = BinaryData.fromString( - "{\"name\":\"fkuwbcrnwbmehhse\",\"supportedSkus\":[{\"name\":\"srtslhspkdeem\",\"vCores\":1895836308961796190,\"supportedIops\":1461011233299690621,\"supportedMemoryPerVCoreMB\":1611861407793999607},{\"name\":\"elmqk\",\"vCores\":1137087157004223817,\"supportedIops\":3537949876650802706,\"supportedMemoryPerVCoreMB\":6307575147417814600},{\"name\":\"quhcdhmduala\",\"vCores\":2370990403210221685,\"supportedIops\":6851389169185127110,\"supportedMemoryPerVCoreMB\":4668891538540973425}]}") + "{\"name\":\"dslfhotwmcy\",\"supportedSkus\":[{\"name\":\"bjnpg\",\"vCores\":4922956716051761075,\"supportedIops\":6035975843137126951,\"supportedMemoryPerVCoreMB\":3248442344635598539},{\"name\":\"tyfsoppusuesn\",\"vCores\":7855206837791929967,\"supportedIops\":3766133720110583726,\"supportedMemoryPerVCoreMB\":7285729349641498197},{\"name\":\"zdmohctbqvu\",\"vCores\":2681919302417118526,\"supportedIops\":6410833982728127894,\"supportedMemoryPerVCoreMB\":9105261119317264049},{\"name\":\"ujjugwdkcglh\",\"vCores\":8375339089906225801,\"supportedIops\":5666209214569048838,\"supportedMemoryPerVCoreMB\":8619828940500740984}]}") .toObject(ServerVersionCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java deleted file mode 100644 index 2b5259f2febb3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java +++ /dev/null @@ -1,22 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; - -public final class ServerVersionCapabilityV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVersionCapabilityV2 model - = BinaryData.fromString("{\"name\":\"v\"}").toObject(ServerVersionCapabilityV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapabilityV2 model = new ServerVersionCapabilityV2(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapabilityV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java index bdf6b4195e589..4a7bdb9f85b1b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().delete("otcubi", "p", com.azure.core.util.Context.NONE); + manager.servers().delete("osvexcsonpclhoc", "hslkevleggzf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java index ebafe83479be0..5a4e52dc82b37 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java @@ -27,7 +27,7 @@ public void testFailover() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().failover("kgkxn", "edabgyvudtjue", com.azure.core.util.Context.NONE); + manager.servers().failover("ypewrmjmwvvjekt", "xsenhwlr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java deleted file mode 100644 index e21499cdce306..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java +++ /dev/null @@ -1,36 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersResetGtidMockTests { - @Test - public void testResetGtid() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers() - .resetGtid("vsjcswsmystuluqy", "fcvlerch", new ServerGtidSetParameter().withGtidSet("bm"), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java index 32caa1d25d3c8..be3a17211608d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java @@ -30,8 +30,10 @@ public void testRestart() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); manager.servers() - .restart("n", "ntfpmvmemfnc", new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(97692731), com.azure.core.util.Context.NONE); + .restart("ffrzpwvlqdqgbiqy", "ihkaetcktvfc", + new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.DISABLED) + .withMaxFailoverSeconds(1960016252), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java index 49ea40ebaf077..6b012c3414e8a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java @@ -27,7 +27,7 @@ public void testStart() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().start("b", "lxlllchpo", com.azure.core.util.Context.NONE); + manager.servers().start("kymuctqhjfbebr", "cxerf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java index 095850bede03c..fd74fd39d1f9c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java @@ -27,7 +27,7 @@ public void testStop() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().stop("bzevwrd", "hfuk", com.azure.core.util.Context.NONE); + manager.servers().stop("wutttxfvjrbi", "phxepcyvahf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java deleted file mode 100644 index 757039b7ad1f2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersValidateEstimateHighAvailabilityWithResponseMockTests { - @Test - public void testValidateEstimateHighAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"estimatedDowntime\":895396019,\"scheduledStandbyAvailabilityZone\":\"rkdbdgiogsjkmnwq\",\"expectedStandbyAvailabilityZone\":\"obaiyhddviaceg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HighAvailabilityValidationEstimation response - = manager.servers() - .validateEstimateHighAvailabilityWithResponse("bcihxuuwhc", "yxccyb", - new HighAvailabilityValidationEstimationInner() - .withExpectedStandbyAvailabilityZone("xgwjplmagstcyoh"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("obaiyhddviaceg", response.expectedStandbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java index 6ea53e6d9f5b9..12dcb21991f11 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java @@ -11,7 +11,7 @@ public final class SkuCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapability model = BinaryData.fromString( - "{\"name\":\"rcrgvx\",\"vCores\":3807328350452563665,\"supportedIops\":7205793596406177755,\"supportedMemoryPerVCoreMB\":8511094552590420060}") + "{\"name\":\"jixhbk\",\"vCores\":2989333129531555970,\"supportedIops\":833770082997190597,\"supportedMemoryPerVCoreMB\":8440294910944943050}") .toObject(SkuCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java deleted file mode 100644 index afd8ae4bda40b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapabilityV2; - -public final class SkuCapabilityV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapabilityV2 model = BinaryData.fromString( - "{\"name\":\"gjltdtbnnhado\",\"vCores\":3020486930690600862,\"supportedIops\":6607949081134989897,\"supportedMemoryPerVCoreMB\":1994212450158328847,\"supportedZones\":[\"amqgxqquezikyw\"],\"supportedHAMode\":[\"kallatmel\",\"uipiccjzk\"]}") - .toObject(SkuCapabilityV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapabilityV2 model = new SkuCapabilityV2(); - model = BinaryData.fromObject(model).toObject(SkuCapabilityV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java new file mode 100644 index 0000000000000..e37325a0488da --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; +import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; +import org.junit.jupiter.api.Assertions; + +public final class SkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Sku model = BinaryData.fromString("{\"name\":\"ucmpoyfd\",\"tier\":\"GeneralPurpose\"}").toObject(Sku.class); + Assertions.assertEquals("ucmpoyfd", model.name()); + Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Sku model = new Sku().withName("ucmpoyfd").withTier(SkuTier.GENERAL_PURPOSE); + model = BinaryData.fromObject(model).toObject(Sku.class); + Assertions.assertEquals("ucmpoyfd", model.name()); + Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java index a9f47f844ae9a..15861ebb64565 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java @@ -11,7 +11,7 @@ public final class StorageEditionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StorageEditionCapability model = BinaryData.fromString( - "{\"name\":\"rqjbhckfrl\",\"minStorageSize\":1577557266863245679,\"maxStorageSize\":3255446735265573328,\"minBackupRetentionDays\":2043714136567231871,\"maxBackupRetentionDays\":5237668963644708788,\"minBackupIntervalHours\":458941391738986155,\"maxBackupIntervalHours\":3134416927851785351}") + "{\"name\":\"b\",\"minStorageSize\":4998269354671391171,\"maxStorageSize\":7180856606235016018,\"minBackupRetentionDays\":246259275856309822,\"maxBackupRetentionDays\":1303050182193014003}") .toObject(StorageEditionCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java index 72c1d88d604d0..9d8b72a57eb0c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java @@ -12,28 +12,22 @@ public final class StorageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Storage model = BinaryData.fromString( - "{\"storageSizeGB\":873426494,\"iops\":303390013,\"autoGrow\":\"Disabled\",\"logOnDisk\":\"Enabled\",\"storageSku\":\"fhotw\",\"autoIoScaling\":\"Enabled\"}") + Storage model = BinaryData + .fromString( + "{\"storageSizeGB\":337855308,\"iops\":419341930,\"autoGrow\":\"Disabled\",\"storageSku\":\"k\"}") .toObject(Storage.class); - Assertions.assertEquals(873426494, model.storageSizeGB()); - Assertions.assertEquals(303390013, model.iops()); + Assertions.assertEquals(337855308, model.storageSizeGB()); + Assertions.assertEquals(419341930, model.iops()); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Storage model = new Storage().withStorageSizeGB(873426494) - .withIops(303390013) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withLogOnDisk(EnableStatusEnum.ENABLED) - .withAutoIoScaling(EnableStatusEnum.ENABLED); + Storage model + = new Storage().withStorageSizeGB(337855308).withIops(419341930).withAutoGrow(EnableStatusEnum.DISABLED); model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(873426494, model.storageSizeGB()); - Assertions.assertEquals(303390013, model.iops()); + Assertions.assertEquals(337855308, model.storageSizeGB()); + Assertions.assertEquals(419341930, model.iops()); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java deleted file mode 100644 index c86e84903de51..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ValidateBackupResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateBackupResponseInner model - = BinaryData.fromString("{\"properties\":{\"numberOfContainers\":1743197151}}") - .toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(1743197151, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseInner model = new ValidateBackupResponseInner().withNumberOfContainers(1743197151); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(1743197151, model.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java deleted file mode 100644 index 7855853743bc3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class ValidateBackupResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateBackupResponseProperties model = BinaryData.fromString("{\"numberOfContainers\":375105800}") - .toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(375105800, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseProperties model - = new ValidateBackupResponseProperties().withNumberOfContainers(375105800); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(375105800, model.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java index ff637eef77fb0..9121a347ffce7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java @@ -11,16 +11,16 @@ public final class VirtualNetworkSubnetUsageParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = BinaryData.fromString("{\"virtualNetworkResourceId\":\"vc\"}") + VirtualNetworkSubnetUsageParameter model = BinaryData.fromString("{\"virtualNetworkResourceId\":\"n\"}") .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("vc", model.virtualNetworkResourceId()); + Assertions.assertEquals("n", model.virtualNetworkResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { VirtualNetworkSubnetUsageParameter model - = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("vc"); + = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("n"); model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("vc", model.virtualNetworkResourceId()); + Assertions.assertEquals("n", model.virtualNetworkResourceId()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java index dea610b5af239..590c9ece63f37 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java @@ -11,7 +11,7 @@ public final class VirtualNetworkSubnetUsageResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkSubnetUsageResultInner model = BinaryData.fromString( - "{\"location\":\"y\",\"subscriptionId\":\"yrnxxmueedn\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"stkwqqtch\",\"usage\":416295343158305691},{\"subnetName\":\"mtdaa\",\"usage\":8743531212516395266}]}") + "{\"location\":\"fyexfwhy\",\"subscriptionId\":\"i\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"dcsi\",\"usage\":8188348657353643150},{\"subnetName\":\"amdecte\",\"usage\":485478669807006997},{\"subnetName\":\"cj\",\"usage\":5437486908155623563}]}") .toObject(VirtualNetworkSubnetUsageResultInner.class); }