diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md index 4247a5525753..97d604f2f600 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.1 (2023-08-01) + +- 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-06-30-privatelink. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md index abb17754c844..2991f65d0cec 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-2022-09-30-preview. 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-2023-06-30-privatelink. 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.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +server = mysqlManager.servers() + .define(serverName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withAdministratorLogin(adminName) + .withAdministratorLoginPassword(adminPwd) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md) @@ -103,3 +112,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fmysqlflexibleserver%2Fazure-resourcemanager-mysqlflexibleserver%2FREADME.png) diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md index 94e5f8ab17bf..55f9fed5e411 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md @@ -1,1255 +1,153 @@ # Code snippets and samples -## AzureADAdministrators +## PrivateEndpointConnections -- [CreateOrUpdate](#azureadadministrators_createorupdate) -- [Delete](#azureadadministrators_delete) -- [Get](#azureadadministrators_get) -- [ListByServer](#azureadadministrators_listbyserver) +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByServer](#privateendpointconnections_listbyserver) -## BackupAndExport +## PrivateLinkResources -- [Create](#backupandexport_create) -- [ValidateBackup](#backupandexport_validatebackup) - -## Backups - -- [Get](#backups_get) -- [ListByServer](#backups_listbyserver) -- [Put](#backups_put) - -## CheckNameAvailability - -- [Execute](#checknameavailability_execute) - -## CheckNameAvailabilityWithoutLocation - -- [Execute](#checknameavailabilitywithoutlocation_execute) - -## CheckVirtualNetworkSubnetUsage - -- [Execute](#checkvirtualnetworksubnetusage_execute) - -## Configurations - -- [BatchUpdate](#configurations_batchupdate) -- [CreateOrUpdate](#configurations_createorupdate) -- [Get](#configurations_get) -- [ListByServer](#configurations_listbyserver) -- [Update](#configurations_update) - -## Databases - -- [CreateOrUpdate](#databases_createorupdate) -- [Delete](#databases_delete) -- [Get](#databases_get) -- [ListByServer](#databases_listbyserver) - -## FirewallRules - -- [CreateOrUpdate](#firewallrules_createorupdate) -- [Delete](#firewallrules_delete) -- [Get](#firewallrules_get) -- [ListByServer](#firewallrules_listbyserver) - -## GetPrivateDnsZoneSuffix - -- [Execute](#getprivatednszonesuffix_execute) - -## LocationBasedCapabilities - -- [List](#locationbasedcapabilities_list) - -## LogFiles - -- [ListByServer](#logfiles_listbyserver) - -## Operations - -- [List](#operations_list) - -## Replicas - -- [ListByServer](#replicas_listbyserver) - -## Servers - -- [Create](#servers_create) -- [Delete](#servers_delete) -- [Failover](#servers_failover) -- [GetByResourceGroup](#servers_getbyresourcegroup) -- [List](#servers_list) -- [ListByResourceGroup](#servers_listbyresourcegroup) -- [ResetGtid](#servers_resetgtid) -- [Restart](#servers_restart) -- [Start](#servers_start) -- [Stop](#servers_stop) -- [Update](#servers_update) -### AzureADAdministrators_CreateOrUpdate +- [Get](#privatelinkresources_get) +- [ListByServer](#privatelinkresources_listbyserver) +### PrivateEndpointConnections_CreateOrUpdate ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -/** Samples for AzureADAdministrators CreateOrUpdate. */ -public final class AzureADAdministratorsCreateOrUpdateSamples { +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionUpdate.json */ /** - * Sample code: Create an azure ad administrator. + * Sample code: Approve or reject a private endpoint connection with a given name. * * @param manager Entry point to MySqlManager. */ - public static void createAnAzureAdAdministrator( + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( 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") + .privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingFlexibleServer("Default", "test-svr") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")) .create(); } } ``` -### AzureADAdministrators_Delete +### PrivateEndpointConnections_Delete ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** Samples for AzureADAdministrators Delete. */ -public final class AzureADAdministratorsDeleteSamples { +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionDelete.json */ /** - * Sample code: Delete an azure ad administrator. + * Sample code: Deletes a private endpoint connection with a given name. * * @param manager Entry point to MySqlManager. */ - public static void deleteAnAzureAdAdministrator( + public static void deletesAPrivateEndpointConnectionWithAGivenName( com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager - .azureADAdministrators() - .delete("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE); + .privateEndpointConnections() + .delete("Default", "test-svr", "private-endpoint-connection-name", com.azure.core.util.Context.NONE); } } ``` -### AzureADAdministrators_Get +### PrivateEndpointConnections_Get ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** Samples for AzureADAdministrators Get. */ -public final class AzureADAdministratorsGetSamples { +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionGet.json */ /** - * Sample code: Get an azure ad administrator. + * Sample code: Gets private endpoint connection. * * @param manager Entry point to MySqlManager. */ - public static void getAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager - .azureADAdministrators() + .privateEndpointConnections() .getWithResponse( - "testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE); + "Default", "test-svr", "private-endpoint-connection-name", com.azure.core.util.Context.NONE); } } ``` -### AzureADAdministrators_ListByServer +### PrivateEndpointConnections_ListByServer ```java -/** Samples for AzureADAdministrators ListByServer. */ -public final class AzureADAdministratorsListByServerSamples { +/** Samples for PrivateEndpointConnections ListByServer. */ +public final class PrivateEndpointConnectionsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionList.json */ /** - * Sample code: List Azure AD administrators in a server. + * Sample code: Gets list of private endpoint connections on a server. * * @param manager Entry point to MySqlManager. */ - public static void listAzureADAdministratorsInAServer( + public static void getsListOfPrivateEndpointConnectionsOnAServer( 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/2022-09-30-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/2022-09-30-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 -/** Samples for Backups Get. */ -public final class BackupsGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupGet.json - */ - /** - * Sample code: Get a backup for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void getABackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .backups() - .getWithResponse("TestGroup", "mysqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); - } -} -``` - -### Backups_ListByServer - -```java -/** Samples for Backups ListByServer. */ -public final class BackupsListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json - */ - /** - * Sample code: List backups for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void listBackupsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backups().listByServer("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Backups_Put - -```java -/** Samples for Backups Put. */ -public final class BackupsPutSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-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 -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** Samples for CheckNameAvailability Execute. */ -public final class CheckNameAvailabilityExecuteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/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 - .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/preview/2021-12-01-preview/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); + .privateEndpointConnections() + .listByServerWithResponse("Default", "test-svr", com.azure.core.util.Context.NONE); } } ``` -### CheckVirtualNetworkSubnetUsage_Execute +### PrivateLinkResources_Get ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; - -/** Samples for CheckVirtualNetworkSubnetUsage Execute. */ -public final class CheckVirtualNetworkSubnetUsageExecuteSamples { +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateLinkResourcesGet.json */ /** - * Sample code: CheckVirtualNetworkSubnetUsage. + * Sample code: Gets a private link resource for MySQL. * * @param manager Entry point to MySqlManager. */ - public static void checkVirtualNetworkSubnetUsage( + public static void getsAPrivateLinkResourceForMySQL( 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/2021-12-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/2021-12-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/2021-12-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); + manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); } } ``` -### Configurations_ListByServer +### PrivateLinkResources_ListByServer ```java -/** Samples for Configurations ListByServer. */ -public final class ConfigurationsListByServerSamples { +/** Samples for PrivateLinkResources ListByServer. */ +public final class PrivateLinkResourcesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateLinkResourcesList.json */ /** - * Sample code: List all configurations for a server. + * Sample code: Gets private link resources for MySQL. * * @param manager Entry point to MySqlManager. */ - public static void listAllConfigurationsForAServer( + public static void getsPrivateLinkResourcesForMySQL( 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/2021-12-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/2021-12-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/2021-12-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/2021-12-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/2021-12-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/2021-12-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/2021-12-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); - } -} -``` - -### FirewallRules_Get - -```java -/** Samples for FirewallRules Get. */ -public final class FirewallRulesGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json - */ - /** - * Sample code: Get a firewall rule. - * - * @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); - } -} -``` - -### FirewallRules_ListByServer - -```java -/** Samples for FirewallRules ListByServer. */ -public final class FirewallRulesListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json - */ - /** - * Sample code: List all firewall rules in a server. - * - * @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); - } -} -``` - -### GetPrivateDnsZoneSuffix_Execute - -```java -/** Samples for GetPrivateDnsZoneSuffix Execute. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json - */ - /** - * Sample code: GetPrivateDnsZoneSuffix. - * - * @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); - } -} -``` - -### LocationBasedCapabilities_List - -```java -/** Samples for LocationBasedCapabilities List. */ -public final class LocationBasedCapabilitiesListSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json - */ - /** - * Sample code: CapabilitiesList. - * - * @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); - } -} -``` - -### LogFiles_ListByServer - -```java -/** Samples for LogFiles ListByServer. */ -public final class LogFilesListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json - */ - /** - * Sample code: List all server log files for a server. - * - * @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); - } -} -``` - -### Operations_List - -```java -/** Samples for Operations List. */ -public final class OperationsListSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json - */ - /** - * Sample code: OperationList. - * - * @param manager Entry point to MySqlManager. - */ - public static void operationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### Replicas_ListByServer - -```java -/** Samples for Replicas ListByServer. */ -public final class ReplicasListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json - */ - /** - * Sample code: List replicas for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void listReplicasForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.replicas().listByServer("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_Create - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -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.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.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; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Servers Create. */ -public final class ServersCreateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json - */ - /** - * Sample code: Create a replica server. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAReplicaServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .define("replica-server") - .withRegion("SoutheastAsia") - .withExistingResourceGroup("testgr") - .withCreateMode(CreateMode.REPLICA) - .withSourceServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server") - .create(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json - */ - /** - * Sample code: Create a new server. - * - * @param manager Entry point to MySqlManager. - */ - public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .define("mysqltestserver") - .withRegion("southeastasia") - .withExistingResourceGroup("testrg") - .withTags(mapOf("num", "1")) - .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).withGeoRedundantBackup(EnableStatusEnum.DISABLED)) - .withHighAvailability( - new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) - .create(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json - */ - /** - * Sample code: Create a server with byok. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) - throws IOException { - manager - .servers() - .define("mysqltestserver") - .withRegion("southeastasia") - .withExistingResourceGroup("testrg") - .withTags(mapOf("num", "1")) - .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 Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("your_password") - .withVersion(ServerVersion.FIVE_SEVEN) - .withAvailabilityZone("1") - .withCreateMode(CreateMode.DEFAULT) - .withDataEncryption( - new DataEncryption() - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity") - .withPrimaryKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withType(DataEncryptionType.AZURE_KEY_VAULT)) - .withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(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/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json - */ - /** - * Sample code: Create a server as a point in time restore. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAServerAsAPointInTimeRestore( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .define("targetserver") - .withRegion("SoutheastAsia") - .withExistingResourceGroup("TargetResourceGroup") - .withTags(mapOf("num", "1")) - .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") - .withRestorePointInTime(OffsetDateTime.parse("2021-06-24T00:00:37.467Z")) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### Servers_Delete - -```java -/** Samples for Servers Delete. */ -public final class ServersDeleteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json - */ - /** - * Sample code: Delete a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void deleteAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().delete("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_Failover - -```java -/** Samples for Servers Failover. */ -public final class ServersFailoverSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json - */ - /** - * Sample code: Restart a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void restartAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().failover("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_GetByResourceGroup - -```java -/** Samples for Servers GetByResourceGroup. */ -public final class ServersGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json - */ - /** - * Sample code: Get a server with vnet. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAServerWithVnet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGet.json - */ - /** - * Sample code: Get a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_List - -```java -/** Samples for Servers List. */ -public final class ServersListSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json - */ - /** - * Sample code: List servers in a subscription. - * - * @param manager Entry point to MySqlManager. - */ - public static void listServersInASubscription(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().list(com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_ListByResourceGroup - -```java -/** Samples for Servers ListByResourceGroup. */ -public final class ServersListByResourceGroupSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json - */ - /** - * Sample code: List servers in a resource group. - * - * @param manager Entry point to MySqlManager. - */ - public static void listServersInAResourceGroup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().listByResourceGroup("TestGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### 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/preview/2022-09-30-preview/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 -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; - -/** Samples for Servers Restart. */ -public final class ServersRestartSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerRestart.json - */ - /** - * Sample code: Restart a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void restartAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .restart( - "TestGroup", - "testserver", - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(60), - com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_Start - -```java -/** Samples for Servers Start. */ -public final class ServersStartSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStart.json - */ - /** - * Sample code: Start a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void startAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().start("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_Stop - -```java -/** Samples for Servers Stop. */ -public final class ServersStopSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStop.json - */ - /** - * Sample code: Stop a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void stopAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().stop("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} -``` - -### Servers_Update - -```java -import com.azure.core.management.serializer.SerializerFactory; -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.Server; -import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Servers Update. */ -public final class ServersUpdateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json - */ - /** - * Sample code: Update server customer maintenance window. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateServerCustomerMaintenanceWindow( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - Server resource = - manager - .servers() - .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withMaintenanceWindow( - new MaintenanceWindow() - .withCustomWindow("Enabled") - .withStartHour(8) - .withStartMinute(0) - .withDayOfWeek(1)) - .apply(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json - */ - /** - * Sample code: Update server with byok. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) - throws IOException { - Server resource = - manager - .servers() - .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .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)))) - .withDataEncryption( - new DataEncryption() - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity") - .withPrimaryKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withType(DataEncryptionType.AZURE_KEY_VAULT)) - .apply(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json - */ - /** - * Sample code: Update a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - Server resource = - manager - .servers() - .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)) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + .privateLinkResources() + .listByServerWithResponse("Default", "test-svr", 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 6ada4de150aa..3506fa251f5b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -18,7 +18,7 @@ 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-2022-09-30-preview. + 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-06-30-privatelink. https://github.com/Azure/azure-sdk-for-java 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 11ce7bccb109..20616b081d1e 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,37 +24,11 @@ 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.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; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckVirtualNetworkSubnetUsagesImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.ConfigurationsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.DatabasesImpl; -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.LogFilesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder; -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.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; -import com.azure.resourcemanager.mysqlflexibleserver.models.CheckVirtualNetworkSubnetUsages; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configurations; -import com.azure.resourcemanager.mysqlflexibleserver.models.Databases; -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.LogFiles; -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.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnections; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResources; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -68,35 +42,9 @@ * configurations with new business model. */ public final class MySqlManager { - private AzureADAdministrators azureADAdministrators; + private PrivateEndpointConnections privateEndpointConnections; - private Backups backups; - - private BackupAndExports backupAndExports; - - private Configurations configurations; - - private Databases databases; - - private FirewallRules firewallRules; - - private Servers servers; - - private Replicas replicas; - - private LogFiles logFiles; - - private LocationBasedCapabilities locationBasedCapabilities; - - private CheckVirtualNetworkSubnetUsages checkVirtualNetworkSubnetUsages; - - private CheckNameAvailabilities checkNameAvailabilities; - - private CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocations; - - private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; - - private Operations operations; + private PrivateLinkResources privateLinkResources; private final MySqlManagementClient clientObject; @@ -263,7 +211,7 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.mysqlflexibleserver") .append("/") - .append("1.0.0-beta.4"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -321,189 +269,28 @@ 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 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. - * - * @return Resource collection API of Servers. - */ - public Servers servers() { - if (this.servers == null) { - this.servers = new ServersImpl(clientObject.getServers(), this); - } - return servers; - } - - /** - * Gets the resource collection API of Replicas. - * - * @return Resource collection API of Replicas. - */ - public Replicas replicas() { - if (this.replicas == null) { - this.replicas = new ReplicasImpl(clientObject.getReplicas(), this); - } - return replicas; - } - - /** - * Gets the resource collection API of LogFiles. - * - * @return Resource collection API of LogFiles. - */ - public LogFiles logFiles() { - if (this.logFiles == null) { - this.logFiles = new LogFilesImpl(clientObject.getLogFiles(), this); - } - return logFiles; - } - - /** - * Gets the resource collection API of LocationBasedCapabilities. - * - * @return Resource collection API of LocationBasedCapabilities. - */ - public LocationBasedCapabilities locationBasedCapabilities() { - if (this.locationBasedCapabilities == null) { - this.locationBasedCapabilities = - new LocationBasedCapabilitiesImpl(clientObject.getLocationBasedCapabilities(), this); - } - return locationBasedCapabilities; - } - - /** - * Gets the resource collection API of CheckVirtualNetworkSubnetUsages. - * - * @return Resource collection API of CheckVirtualNetworkSubnetUsages. - */ - public CheckVirtualNetworkSubnetUsages checkVirtualNetworkSubnetUsages() { - if (this.checkVirtualNetworkSubnetUsages == null) { - this.checkVirtualNetworkSubnetUsages = - new CheckVirtualNetworkSubnetUsagesImpl(clientObject.getCheckVirtualNetworkSubnetUsages(), this); - } - return checkVirtualNetworkSubnetUsages; - } - - /** - * Gets the resource collection API of CheckNameAvailabilities. - * - * @return Resource collection API of CheckNameAvailabilities. - */ - public CheckNameAvailabilities checkNameAvailabilities() { - if (this.checkNameAvailabilities == null) { - this.checkNameAvailabilities = - new CheckNameAvailabilitiesImpl(clientObject.getCheckNameAvailabilities(), this); - } - return checkNameAvailabilities; - } - - /** - * Gets the resource collection API of CheckNameAvailabilityWithoutLocations. - * - * @return Resource collection API of CheckNameAvailabilityWithoutLocations. - */ - public CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocations() { - if (this.checkNameAvailabilityWithoutLocations == null) { - this.checkNameAvailabilityWithoutLocations = - new CheckNameAvailabilityWithoutLocationsImpl( - clientObject.getCheckNameAvailabilityWithoutLocations(), this); - } - return checkNameAvailabilityWithoutLocations; - } - - /** - * Gets the resource collection API of GetPrivateDnsZoneSuffixes. + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. * - * @return Resource collection API of GetPrivateDnsZoneSuffixes. + * @return Resource collection API of PrivateEndpointConnections. */ - public GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes() { - if (this.getPrivateDnsZoneSuffixes == null) { - this.getPrivateDnsZoneSuffixes = - new GetPrivateDnsZoneSuffixesImpl(clientObject.getGetPrivateDnsZoneSuffixes(), this); + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } - return getPrivateDnsZoneSuffixes; + return privateEndpointConnections; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of PrivateLinkResources. * - * @return Resource collection API of Operations. + * @return Resource collection API of PrivateLinkResources. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); } - return operations; + return privateLinkResources; } /** 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 cde53fb3a637..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java +++ /dev/null @@ -1,213 +0,0 @@ -// 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 52c7f573e8a9..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.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.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 deleted file mode 100644 index 1ca1b401c4e0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// 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.ServerBackupInner; - -/** 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. - * - * @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 getWithResponse( - String resourceGroupName, String serverName, String backupName, Context 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. - * @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 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 listByServer(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 listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilitiesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilitiesClient.java deleted file mode 100644 index 8446e4caf9d3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilitiesClient.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.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** An instance of this class provides access to all the operations defined in CheckNameAvailabilitiesClient. */ -public interface CheckNameAvailabilitiesClient { - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeWithResponse( - String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context); - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityInner execute(String locationName, NameAvailabilityRequest nameAvailabilityRequest); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilityWithoutLocationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilityWithoutLocationsClient.java deleted file mode 100644 index 27ee99473d60..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilityWithoutLocationsClient.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.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** - * An instance of this class provides access to all the operations defined in - * CheckNameAvailabilityWithoutLocationsClient. - */ -public interface CheckNameAvailabilityWithoutLocationsClient { - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeWithResponse( - NameAvailabilityRequest nameAvailabilityRequest, Context context); - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityInner execute(NameAvailabilityRequest nameAvailabilityRequest); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckVirtualNetworkSubnetUsagesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckVirtualNetworkSubnetUsagesClient.java deleted file mode 100644 index 9a3a81446948..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckVirtualNetworkSubnetUsagesClient.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.VirtualNetworkSubnetUsageResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; - -/** An instance of this class provides access to all the operations defined in CheckVirtualNetworkSubnetUsagesClient. */ -public interface CheckVirtualNetworkSubnetUsagesClient { - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeWithResponse( - String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context); - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkSubnetUsageResultInner execute(String locationName, VirtualNetworkSubnetUsageParameter parameters); -} 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 deleted file mode 100644 index 24ab9610dbff..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java +++ /dev/null @@ -1,297 +0,0 @@ -// 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.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; - -/** 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. - * - * @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> beginUpdate( - 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> beginUpdate( - 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 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner update( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context); - - /** - * Gets information about a configuration of 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String configurationName, Context context); - - /** - * Gets information about a configuration of 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner get(String resourceGroupName, String serverName, String configurationName); - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationListResultInner> beginBatchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters); - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationListResultInner> beginBatchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context); - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationListResultInner batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters); - - /** - * Update a list of 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 parameters The parameters for updating a list of 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationListResultInner batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer( - String resourceGroupName, - String serverName, - String tags, - String keyword, - Integer page, - Integer pageSize, - Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/DatabasesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/DatabasesClient.java deleted file mode 100644 index 808f5992eb1d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/DatabasesClient.java +++ /dev/null @@ -1,197 +0,0 @@ -// 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.DatabaseInner; - -/** An instance of this class provides access to all the operations defined in DatabasesClient. */ -public interface DatabasesClient { - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Database. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatabaseInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters); - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @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 Database. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatabaseInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context); - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseInner createOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters); - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @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 Database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseInner createOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context); - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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, String databaseName); - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @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, String databaseName, Context context); - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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, String databaseName); - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @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, String databaseName, Context context); - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @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 database along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String databaseName, Context context); - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseInner get(String resourceGroupName, String serverName, String databaseName); - - /** - * List all the databases 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 databases as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the databases 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 databases 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/GetPrivateDnsZoneSuffixesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/GetPrivateDnsZoneSuffixesClient.java deleted file mode 100644 index 415d6b62de5d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/GetPrivateDnsZoneSuffixesClient.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.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.GetPrivateDnsZoneSuffixResponseInner; - -/** An instance of this class provides access to all the operations defined in GetPrivateDnsZoneSuffixesClient. */ -public interface GetPrivateDnsZoneSuffixesClient { - /** - * Get private DNS zone suffix in the cloud. - * - * @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 private DNS zone suffix in the cloud along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response executeWithResponse(Context context); - - /** - * Get private DNS zone suffix in the cloud. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetPrivateDnsZoneSuffixResponseInner execute(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java deleted file mode 100644 index b5c75b6801f1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitiesClient.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.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.CapabilityPropertiesInner; - -/** An instance of this class provides access to all the operations defined in LocationBasedCapabilitiesClient. */ -public interface LocationBasedCapabilitiesClient { - /** - * 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); -} 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 043bab27a944..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.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.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/MySqlManagementClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java index 0ce57fc33beb..30b85ab544f6 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 @@ -10,7 +10,7 @@ /** The interface for MySqlManagementClient class. */ public interface MySqlManagementClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -23,6 +23,13 @@ public interface MySqlManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -38,107 +45,16 @@ 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 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. - * - * @return the ServersClient object. - */ - ServersClient getServers(); - - /** - * Gets the ReplicasClient object to access its operations. - * - * @return the ReplicasClient object. - */ - ReplicasClient getReplicas(); - - /** - * Gets the LogFilesClient object to access its operations. - * - * @return the LogFilesClient object. - */ - LogFilesClient getLogFiles(); - - /** - * Gets the LocationBasedCapabilitiesClient object to access its operations. - * - * @return the LocationBasedCapabilitiesClient object. - */ - LocationBasedCapabilitiesClient getLocationBasedCapabilities(); - - /** - * Gets the CheckVirtualNetworkSubnetUsagesClient object to access its operations. - * - * @return the CheckVirtualNetworkSubnetUsagesClient object. - */ - CheckVirtualNetworkSubnetUsagesClient getCheckVirtualNetworkSubnetUsages(); - - /** - * Gets the CheckNameAvailabilitiesClient object to access its operations. - * - * @return the CheckNameAvailabilitiesClient object. - */ - CheckNameAvailabilitiesClient getCheckNameAvailabilities(); - - /** - * Gets the CheckNameAvailabilityWithoutLocationsClient object to access its operations. - * - * @return the CheckNameAvailabilityWithoutLocationsClient object. - */ - CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWithoutLocations(); - - /** - * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the GetPrivateDnsZoneSuffixesClient object. + * @return the PrivateEndpointConnectionsClient object. */ - GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes(); + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** - * Gets the OperationsClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the OperationsClient object. + * @return the PrivateLinkResourcesClient object. */ - OperationsClient getOperations(); + PrivateLinkResourcesClient getPrivateLinkResources(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationsClient.java deleted file mode 100644 index 1dfe689d3e9a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationsClient.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.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.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists all of the available REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/FirewallRulesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java similarity index 63% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/FirewallRulesClient.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java index c944f7f1d5f8..778e8033e5c6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/FirewallRulesClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java @@ -6,201 +6,209 @@ 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.FirewallRuleInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner; -/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ -public interface FirewallRulesClient { +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { /** - * Creates a new firewall rule or updates an existing firewall rule. + * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 firewall rule. + * @return a private endpoint connection along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, FirewallRuleInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); /** - * Creates a new firewall rule or updates an existing firewall rule. + * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 firewall rule. + * @return a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, FirewallRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String firewallRuleName, - FirewallRuleInner parameters, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String serverName, String privateEndpointConnectionName); /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - FirewallRuleInner createOrUpdate( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - FirewallRuleInner createOrUpdate( + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String serverName, - String firewallRuleName, - FirewallRuleInner parameters, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context); /** - * Deletes a firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the private endpoint connection resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String firewallRuleName); + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); /** - * Deletes a firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the private endpoint connection resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String firewallRuleName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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.SINGLE) - void delete(String resourceGroupName, String serverName, String firewallRuleName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String privateEndpointConnectionName); /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @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.SINGLE) - void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); /** - * Gets information about a server firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String firewallRuleName, Context context); + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName); /** - * Gets information about a server firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName); + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a 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 firewall rules as paginated response with {@link PagedIterable}. + * @return all private endpoint connections on a server along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServerWithResponse( + String resourceGroupName, String serverName, Context context); /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a 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 firewall rules as paginated response with {@link PagedIterable}. + * @return all private endpoint connections on a server. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner listByServer(String resourceGroupName, String serverName); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateLinkResourcesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..da655fcc32ef --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Lists the private link resources for MySQL 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 private link resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServerWithResponse( + String resourceGroupName, String serverName, Context context); + + /** + * Lists the private link resources for MySQL 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 private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByServer(String resourceGroupName, String serverName); + + /** + * Gets a private link resource for MySQL server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource for MySQL server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String groupName, Context context); + + /** + * Gets a private link resource for MySQL server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource for MySQL server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String serverName, String groupName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ReplicasClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ReplicasClient.java deleted file mode 100644 index 00ec00a38f6e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ReplicasClient.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.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.ServerInner; - -/** An instance of this class provides access to all the operations defined in ReplicasClient. */ -public interface ReplicasClient { - /** - * List all the replicas 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 servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the replicas 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 servers 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/ServersClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java deleted file mode 100644 index 9a9b76dcffcc..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java +++ /dev/null @@ -1,542 +0,0 @@ -// 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.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; - -/** An instance of this class provides access to all the operations defined in ServersClient. */ -public interface ServersClient { - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerInner parameters); - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerInner parameters, Context context); - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner create(String resourceGroupName, String serverName, ServerInner parameters); - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner create(String resourceGroupName, String serverName, ServerInner parameters, Context context); - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerForUpdate parameters); - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerForUpdate parameters, Context context); - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters); - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters, Context context); - - /** - * Deletes a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String serverName); - - /** - * Deletes a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, Context context); - - /** - * Deletes a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName); - - /** - * Deletes a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about a 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 information about a server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about a 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 information about a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner getByResourceGroup(String resourceGroupName, String serverName); - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List all the servers in a given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all the servers in a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Manual failover a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginFailover(String resourceGroupName, String serverName); - - /** - * Manual failover a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginFailover(String resourceGroupName, String serverName, Context context); - - /** - * Manual failover a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void failover(String resourceGroupName, String serverName); - - /** - * Manual failover a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void failover(String resourceGroupName, String serverName, Context context); - - /** - * Restarts 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 restarting 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> beginRestart( - String resourceGroupName, String serverName, ServerRestartParameter parameters); - - /** - * Restarts 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 restarting 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> beginRestart( - String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context); - - /** - * Restarts 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 restarting 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 restart(String resourceGroupName, String serverName, ServerRestartParameter parameters); - - /** - * Restarts 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 restarting 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 restart(String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context); - - /** - * Starts a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String serverName); - - /** - * Starts a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String serverName, Context context); - - /** - * Starts a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String serverName); - - /** - * Starts a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String serverName, Context context); - - /** - * Stops a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop(String resourceGroupName, String serverName); - - /** - * Stops a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop(String resourceGroupName, String serverName, Context context); - - /** - * Stops a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String serverName); - - /** - * Stops a 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. - */ - @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/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 360d94453368..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of an administrator. */ -@Fluent -public final class AdministratorProperties { - /* - * Type of the sever administrator. - */ - @JsonProperty(value = "administratorType") - private AdministratorType administratorType; - - /* - * Login name of the server administrator. - */ - @JsonProperty(value = "login") - private String login; - - /* - * SID (object ID) of the server administrator. - */ - @JsonProperty(value = "sid") - private String sid; - - /* - * Tenant ID of the administrator. - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /* - * The resource id of the identity used for AAD Authentication. - */ - @JsonProperty(value = "identityResourceId") - 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() { - } -} 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 8903f56b030d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java +++ /dev/null @@ -1,175 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a Administrator. */ -@Fluent -public final class AzureADAdministratorInner extends ProxyResource { - /* - * The properties of an administrator. - */ - @JsonProperty(value = "properties") - private AdministratorProperties innerProperties; - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** 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: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * 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(); - } - } -} 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 0a0e178a7ee5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java +++ /dev/null @@ -1,253 +0,0 @@ -// 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.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Represents BackupAndExport API Response. */ -@Fluent -public final class BackupAndExportResponseInner extends ProxyResource { - /* - * The operation status - */ - @JsonProperty(value = "status") - private OperationStatus status; - - /* - * Start time - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Operation progress (0-100). - */ - @JsonProperty(value = "percentComplete") - private Double percentComplete; - - /* - * The response properties of a backup and export operation. - */ - @JsonProperty(value = "properties") - private BackupAndExportResponseProperties innerProperties; - - /* - * Error Response - * - * The BackupAndExport operation error response. - */ - @JsonProperty(value = "error") - private ManagementError error; - - /** 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 error property: Error Response - * - *

The BackupAndExport operation error response. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: Error Response - * - *

The BackupAndExport operation error response. - * - * @param error the error value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * 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(); - } - } -} 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 0f556bdc7b3d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** BackupAndExport Response Properties. */ -@Fluent -public final class BackupAndExportResponseProperties { - /* - * Size of datasource in bytes - */ - @JsonProperty(value = "datasourceSizeInBytes") - private Long datasourceSizeInBytes; - - /* - * Data transferred in bytes - */ - @JsonProperty(value = "dataTransferredInBytes") - private Long dataTransferredInBytes; - - /* - * Metadata related to backup to be stored for restoring resource in key-value pairs. - */ - @JsonProperty(value = "backupMetadata") - 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() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesInner.java deleted file mode 100644 index 4c83c93d3eb8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapability; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Location capabilities. */ -@Immutable -public final class CapabilityPropertiesInner { - /* - * zone name - */ - @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) - private String zone; - - /* - * Supported high availability mode - */ - @JsonProperty(value = "supportedHAMode", access = JsonProperty.Access.WRITE_ONLY) - private List supportedHAMode; - - /* - * supported geo backup regions - */ - @JsonProperty(value = "supportedGeoBackupRegions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedGeoBackupRegions; - - /* - * A list of supported flexible server editions. - */ - @JsonProperty(value = "supportedFlexibleServerEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedFlexibleServerEditions; - - /** Creates an instance of CapabilityPropertiesInner class. */ - public CapabilityPropertiesInner() { - } - - /** - * Get the zone property: zone name. - * - * @return the zone value. - */ - public String zone() { - return this.zone; - } - - /** - * Get the supportedHAMode property: Supported high availability mode. - * - * @return the supportedHAMode value. - */ - public List supportedHAMode() { - return this.supportedHAMode; - } - - /** - * Get the 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedFlexibleServerEditions() != null) { - supportedFlexibleServerEditions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationForBatchUpdateProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationForBatchUpdateProperties.java deleted file mode 100644 index 4d7b13d5f8f0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationForBatchUpdateProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties can be updated for a configuration. */ -@Fluent -public final class ConfigurationForBatchUpdateProperties { - /* - * Value of the configuration. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Source of the configuration. - */ - @JsonProperty(value = "source") - private String source; - - /** Creates an instance of ConfigurationForBatchUpdateProperties class. */ - public ConfigurationForBatchUpdateProperties() { - } - - /** - * Get the value property: Value of the configuration. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of the configuration. - * - * @param value the value value to set. - * @return the ConfigurationForBatchUpdateProperties object itself. - */ - public ConfigurationForBatchUpdateProperties withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the source property: Source of the configuration. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Source of the configuration. - * - * @param source the source value to set. - * @return the ConfigurationForBatchUpdateProperties object itself. - */ - public ConfigurationForBatchUpdateProperties withSource(String source) { - this.source = source; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 4357c0385ca3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java +++ /dev/null @@ -1,204 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsConfigPendingRestart; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a Configuration. */ -@Fluent -public final class ConfigurationInner extends ProxyResource { - /* - * The properties of a configuration. - */ - @JsonProperty(value = "properties") - private ConfigurationProperties innerProperties; - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of ConfigurationInner class. */ - public ConfigurationInner() { - } - - /** - * Get the innerProperties property: The properties of a configuration. - * - * @return the innerProperties value. - */ - private ConfigurationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the value property: Value of the configuration. - * - * @return the value value. - */ - public String value() { - return this.innerProperties() == null ? null : this.innerProperties().value(); - } - - /** - * Set the value property: Value of the configuration. - * - * @param value the value value to set. - * @return the ConfigurationInner object itself. - */ - public ConfigurationInner withValue(String value) { - if (this.innerProperties() == null) { - this.innerProperties = new ConfigurationProperties(); - } - this.innerProperties().withValue(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. - * - * @return the description value. - */ - 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. - * - * @return the defaultValue value. - */ - public String defaultValue() { - return this.innerProperties() == null ? null : this.innerProperties().defaultValue(); - } - - /** - * Get the dataType property: Data type of the configuration. - * - * @return the dataType value. - */ - public String dataType() { - return this.innerProperties() == null ? null : this.innerProperties().dataType(); - } - - /** - * Get the allowedValues property: Allowed values of the configuration. - * - * @return the allowedValues value. - */ - public String allowedValues() { - return this.innerProperties() == null ? null : this.innerProperties().allowedValues(); - } - - /** - * Get the source property: Source of the configuration. - * - * @return the source value. - */ - public ConfigurationSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Source of the configuration. - * - * @param source the source value to set. - * @return the ConfigurationInner object itself. - */ - public ConfigurationInner withSource(ConfigurationSource source) { - if (this.innerProperties() == null) { - this.innerProperties = new ConfigurationProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the isReadOnly property: If is the configuration read only. - * - * @return the isReadOnly value. - */ - public IsReadOnly isReadOnly() { - return this.innerProperties() == null ? null : this.innerProperties().isReadOnly(); - } - - /** - * Get the isConfigPendingRestart property: If is the configuration pending restart or not. - * - * @return the isConfigPendingRestart value. - */ - public IsConfigPendingRestart isConfigPendingRestart() { - return this.innerProperties() == null ? null : this.innerProperties().isConfigPendingRestart(); - } - - /** - * Get the isDynamicConfig property: If is the configuration dynamic. - * - * @return the isDynamicConfig value. - */ - public IsDynamicConfig isDynamicConfig() { - return this.innerProperties() == null ? null : this.innerProperties().isDynamicConfig(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationListResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationListResultInner.java deleted file mode 100644 index 4c51019cb54f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationListResultInner.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of server configurations. */ -@Fluent -public final class ConfigurationListResultInner { - /* - * The list of server configurations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of ConfigurationListResultInner class. */ - public ConfigurationListResultInner() { - } - - /** - * Get the value property: The list of server configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of server configurations. - * - * @param value the value value to set. - * @return the ConfigurationListResultInner object itself. - */ - public ConfigurationListResultInner 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 ConfigurationListResultInner object itself. - */ - public ConfigurationListResultInner 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()); - } - } -} 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 deleted file mode 100644 index 4b487b154913..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java +++ /dev/null @@ -1,226 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsConfigPendingRestart; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a configuration. */ -@Fluent -public final class ConfigurationProperties { - /* - * Value of the configuration. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Current value of the configuration. - */ - @JsonProperty(value = "currentValue") - private String currentValue; - - /* - * Description of the configuration. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The link used to get the document from community or Azure site. - */ - @JsonProperty(value = "documentationLink", access = JsonProperty.Access.WRITE_ONLY) - private String documentationLink; - - /* - * Default value of the configuration. - */ - @JsonProperty(value = "defaultValue", access = JsonProperty.Access.WRITE_ONLY) - private String defaultValue; - - /* - * Data type of the configuration. - */ - @JsonProperty(value = "dataType", access = JsonProperty.Access.WRITE_ONLY) - private String dataType; - - /* - * Allowed values of the configuration. - */ - @JsonProperty(value = "allowedValues", access = JsonProperty.Access.WRITE_ONLY) - private String allowedValues; - - /* - * Source of the configuration. - */ - @JsonProperty(value = "source") - private ConfigurationSource source; - - /* - * If is the configuration read only. - */ - @JsonProperty(value = "isReadOnly", access = JsonProperty.Access.WRITE_ONLY) - private IsReadOnly isReadOnly; - - /* - * If is the configuration pending restart or not. - */ - @JsonProperty(value = "isConfigPendingRestart", access = JsonProperty.Access.WRITE_ONLY) - private IsConfigPendingRestart isConfigPendingRestart; - - /* - * If is the configuration dynamic. - */ - @JsonProperty(value = "isDynamicConfig", access = JsonProperty.Access.WRITE_ONLY) - private IsDynamicConfig isDynamicConfig; - - /** Creates an instance of ConfigurationProperties class. */ - public ConfigurationProperties() { - } - - /** - * Get the value property: Value of the configuration. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Value of the configuration. - * - * @param value the value value to set. - * @return the ConfigurationProperties object itself. - */ - public ConfigurationProperties withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the currentValue property: Current value of the configuration. - * - * @return the currentValue value. - */ - public String currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: Current value of the configuration. - * - * @param currentValue the currentValue value to set. - * @return the ConfigurationProperties object itself. - */ - public ConfigurationProperties withCurrentValue(String currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the description property: Description of the configuration. - * - * @return the description value. - */ - public String description() { - return this.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.documentationLink; - } - - /** - * Get the defaultValue property: Default value of the configuration. - * - * @return the defaultValue value. - */ - public String defaultValue() { - return this.defaultValue; - } - - /** - * Get the dataType property: Data type of the configuration. - * - * @return the dataType value. - */ - public String dataType() { - return this.dataType; - } - - /** - * Get the allowedValues property: Allowed values of the configuration. - * - * @return the allowedValues value. - */ - public String allowedValues() { - return this.allowedValues; - } - - /** - * Get the source property: Source of the configuration. - * - * @return the source value. - */ - public ConfigurationSource source() { - return this.source; - } - - /** - * Set the source property: Source of the configuration. - * - * @param source the source value to set. - * @return the ConfigurationProperties object itself. - */ - public ConfigurationProperties withSource(ConfigurationSource source) { - this.source = source; - return this; - } - - /** - * Get the isReadOnly property: If is the configuration read only. - * - * @return the isReadOnly value. - */ - public IsReadOnly isReadOnly() { - return this.isReadOnly; - } - - /** - * Get the isConfigPendingRestart property: If is the configuration pending restart or not. - * - * @return the isConfigPendingRestart value. - */ - public IsConfigPendingRestart isConfigPendingRestart() { - return this.isConfigPendingRestart; - } - - /** - * Get the isDynamicConfig property: If is the configuration dynamic. - * - * @return the isDynamicConfig value. - */ - public IsDynamicConfig isDynamicConfig() { - return this.isDynamicConfig; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java deleted file mode 100644 index 5e05985e128c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a Database. */ -@Fluent -public final class DatabaseInner extends ProxyResource { - /* - * The properties of a database. - */ - @JsonProperty(value = "properties") - private DatabaseProperties innerProperties; - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of DatabaseInner class. */ - public DatabaseInner() { - } - - /** - * Get the innerProperties property: The properties of a database. - * - * @return the innerProperties value. - */ - private DatabaseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the charset property: The charset of the database. - * - * @return the charset value. - */ - public String charset() { - return this.innerProperties() == null ? null : this.innerProperties().charset(); - } - - /** - * Set the charset property: The charset of the database. - * - * @param charset the charset value to set. - * @return the DatabaseInner object itself. - */ - public DatabaseInner withCharset(String charset) { - if (this.innerProperties() == null) { - this.innerProperties = new DatabaseProperties(); - } - this.innerProperties().withCharset(charset); - return this; - } - - /** - * Get the collation property: The collation of the database. - * - * @return the collation value. - */ - public String collation() { - return this.innerProperties() == null ? null : this.innerProperties().collation(); - } - - /** - * Set the collation property: The collation of the database. - * - * @param collation the collation value to set. - * @return the DatabaseInner object itself. - */ - public DatabaseInner withCollation(String collation) { - if (this.innerProperties() == null) { - this.innerProperties = new DatabaseProperties(); - } - this.innerProperties().withCollation(collation); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseProperties.java deleted file mode 100644 index 421f0965051e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a database. */ -@Fluent -public final class DatabaseProperties { - /* - * The charset of the database. - */ - @JsonProperty(value = "charset") - private String charset; - - /* - * The collation of the database. - */ - @JsonProperty(value = "collation") - private String collation; - - /** Creates an instance of DatabaseProperties class. */ - public DatabaseProperties() { - } - - /** - * Get the charset property: The charset of the database. - * - * @return the charset value. - */ - public String charset() { - return this.charset; - } - - /** - * Set the charset property: The charset of the database. - * - * @param charset the charset value to set. - * @return the DatabaseProperties object itself. - */ - public DatabaseProperties withCharset(String charset) { - this.charset = charset; - return this; - } - - /** - * Get the collation property: The collation of the database. - * - * @return the collation value. - */ - public String collation() { - return this.collation; - } - - /** - * Set the collation property: The collation of the database. - * - * @param collation the collation value to set. - * @return the DatabaseProperties object itself. - */ - public DatabaseProperties withCollation(String collation) { - this.collation = collation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java deleted file mode 100644 index 89fb5eb8a280..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a server firewall rule. */ -@Fluent -public final class FirewallRuleInner extends ProxyResource { - /* - * The properties of a firewall rule. - */ - @JsonProperty(value = "properties", required = true) - private FirewallRuleProperties innerProperties = new FirewallRuleProperties(); - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of FirewallRuleInner class. */ - public FirewallRuleInner() { - } - - /** - * Get the innerProperties property: The properties of a firewall rule. - * - * @return the innerProperties value. - */ - private FirewallRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. - * - * @return the startIpAddress value. - */ - public String startIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().startIpAddress(); - } - - /** - * Set the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. - * - * @param startIpAddress the startIpAddress value to set. - * @return the FirewallRuleInner object itself. - */ - public FirewallRuleInner withStartIpAddress(String startIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new FirewallRuleProperties(); - } - this.innerProperties().withStartIpAddress(startIpAddress); - return this; - } - - /** - * Get the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 format. - * - * @return the endIpAddress value. - */ - public String endIpAddress() { - return this.innerProperties() == null ? null : this.innerProperties().endIpAddress(); - } - - /** - * Set the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 format. - * - * @param endIpAddress the endIpAddress value to set. - * @return the FirewallRuleInner object itself. - */ - public FirewallRuleInner withEndIpAddress(String endIpAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new FirewallRuleProperties(); - } - this.innerProperties().withEndIpAddress(endIpAddress); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model FirewallRuleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FirewallRuleInner.class); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleProperties.java deleted file mode 100644 index dd16f9b083d6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleProperties.java +++ /dev/null @@ -1,91 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a server firewall rule. */ -@Fluent -public final class FirewallRuleProperties { - /* - * The start IP address of the server firewall rule. Must be IPv4 format. - */ - @JsonProperty(value = "startIpAddress", required = true) - private String startIpAddress; - - /* - * The end IP address of the server firewall rule. Must be IPv4 format. - */ - @JsonProperty(value = "endIpAddress", required = true) - private String endIpAddress; - - /** Creates an instance of FirewallRuleProperties class. */ - public FirewallRuleProperties() { - } - - /** - * Get the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. - * - * @return the startIpAddress value. - */ - public String startIpAddress() { - return this.startIpAddress; - } - - /** - * Set the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. - * - * @param startIpAddress the startIpAddress value to set. - * @return the FirewallRuleProperties object itself. - */ - public FirewallRuleProperties withStartIpAddress(String startIpAddress) { - this.startIpAddress = startIpAddress; - return this; - } - - /** - * Get the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 format. - * - * @return the endIpAddress value. - */ - public String endIpAddress() { - return this.endIpAddress; - } - - /** - * Set the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 format. - * - * @param endIpAddress the endIpAddress value to set. - * @return the FirewallRuleProperties object itself. - */ - public FirewallRuleProperties withEndIpAddress(String endIpAddress) { - this.endIpAddress = endIpAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (startIpAddress() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startIpAddress in model FirewallRuleProperties")); - } - if (endIpAddress() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endIpAddress in model FirewallRuleProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FirewallRuleProperties.class); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/GetPrivateDnsZoneSuffixResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/GetPrivateDnsZoneSuffixResponseInner.java deleted file mode 100644 index b487bd743973..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/GetPrivateDnsZoneSuffixResponseInner.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** The response of get private dns zone suffix. */ -@Fluent -public final class GetPrivateDnsZoneSuffixResponseInner { - /* - * Represents the private DNS zone suffix. - */ - @JsonProperty(value = "privateDnsZoneSuffix") - private String privateDnsZoneSuffix; - - /** Creates an instance of GetPrivateDnsZoneSuffixResponseInner class. */ - public GetPrivateDnsZoneSuffixResponseInner() { - } - - /** - * Get the privateDnsZoneSuffix property: Represents the private DNS zone suffix. - * - * @return the privateDnsZoneSuffix value. - */ - public String privateDnsZoneSuffix() { - return this.privateDnsZoneSuffix; - } - - /** - * Set the privateDnsZoneSuffix property: Represents the private DNS zone suffix. - * - * @param privateDnsZoneSuffix the privateDnsZoneSuffix value to set. - * @return the GetPrivateDnsZoneSuffixResponseInner object itself. - */ - public GetPrivateDnsZoneSuffixResponseInner withPrivateDnsZoneSuffix(String privateDnsZoneSuffix) { - this.privateDnsZoneSuffix = privateDnsZoneSuffix; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 511bd0fe65b3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java +++ /dev/null @@ -1,175 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Represents a logFile. */ -@Fluent -public final class LogFileInner extends ProxyResource { - /* - * The properties of a logFile. - */ - @JsonProperty(value = "properties") - private LogFileProperties innerProperties; - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of LogFileInner class. */ - public LogFileInner() { - } - - /** - * Get the innerProperties property: The properties of a logFile. - * - * @return the innerProperties value. - */ - private LogFileProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * 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(); - } - } -} 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 dfece1b1ac3f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a logFile. */ -@Fluent -public final class LogFileProperties { - /* - * The size in kb of the logFile. - */ - @JsonProperty(value = "sizeInKB") - private Long sizeInKB; - - /* - * Creation timestamp of the log file. - */ - @JsonProperty(value = "createdTime") - private OffsetDateTime createdTime; - - /* - * Type of the log file. - */ - @JsonProperty(value = "type") - private String type; - - /* - * Last modified timestamp of the log file. - */ - @JsonProperty(value = "lastModifiedTime") - private OffsetDateTime lastModifiedTime; - - /* - * The url to download the log file from. - */ - @JsonProperty(value = "url") - 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() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/NameAvailabilityInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/NameAvailabilityInner.java deleted file mode 100644 index 62aa87240e28..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/NameAvailabilityInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a resource name availability. */ -@Fluent -public final class NameAvailabilityInner { - /* - * Error Message. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Indicates whether the resource name is available. - */ - @JsonProperty(value = "nameAvailable") - private Boolean nameAvailable; - - /* - * Reason for name being unavailable. - */ - @JsonProperty(value = "reason") - private String reason; - - /** Creates an instance of NameAvailabilityInner class. */ - public NameAvailabilityInner() { - } - - /** - * Get the message property: Error Message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Error Message. - * - * @param message the message value to set. - * @return the NameAvailabilityInner object itself. - */ - public NameAvailabilityInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the nameAvailable property: Indicates whether the resource name is available. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Set the nameAvailable property: Indicates whether the resource name is available. - * - * @param nameAvailable the nameAvailable value to set. - * @return the NameAvailabilityInner object itself. - */ - public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: Reason for name being unavailable. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Set the reason property: Reason for name being unavailable. - * - * @param reason the reason value to set. - * @return the NameAvailabilityInner object itself. - */ - public NameAvailabilityInner withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationInner.java deleted file mode 100644 index 5673dc733b05..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationInner.java +++ /dev/null @@ -1,135 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** REST API operation definition. */ -@Fluent -public final class OperationInner { - /* - * The name of the operation being performed on this particular object. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The localized display information for this particular operation or action. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The intended executor of the operation. - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Additional descriptions for the operation. - */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** Creates an instance of OperationInner class. */ - public OperationInner() { - } - - /** - * Get the name property: The name of the operation being performed on this particular object. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the operation being performed on this particular object. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The localized display information for this particular operation or action. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The localized display information for this particular operation or action. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: The intended executor of the operation. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: Additional descriptions for the operation. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: Additional descriptions for the operation. - * - * @param properties the properties value to set. - * @return the OperationInner object itself. - */ - public OperationInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..2032f6d484d4 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,130 @@ +// 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.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * 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 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 PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner 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(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 000000000000..141759ebd11a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,54 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connections associated with the specified resource. */ +@Fluent +public final class PrivateEndpointConnectionListResultInner { + /* + * Array of private endpoint connections. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateEndpointConnectionListResultInner class. */ + public PrivateEndpointConnectionListResultInner() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResultInner object itself. + */ + public PrivateEndpointConnectionListResultInner withValue(List value) { + this.value = value; + 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()); + } + } +} 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 new file mode 100644 index 000000000000..168998f51dd8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The group ids for the private endpoint resource. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /* + * The private endpoint resource. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..f2286dbc8560 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,101 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties 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 groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 000000000000..576df77df23c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,54 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateLinkResourceListResultInner class. */ + public PrivateLinkResourceListResultInner() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + 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()); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..8444afd8c9ff --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 deleted file mode 100644 index 207507edf997..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Server backup properties. */ -@Fluent -public final class ServerBackupInner extends ProxyResource { - /* - * The properties of a server backup. - */ - @JsonProperty(value = "properties") - private ServerBackupProperties innerProperties; - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of ServerBackupInner class. */ - public ServerBackupInner() { - } - - /** - * Get the innerProperties property: The properties of a server backup. - * - * @return the innerProperties value. - */ - private ServerBackupProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the backupType property: Backup type. - * - * @return the backupType value. - */ - public String backupType() { - return this.innerProperties() == null ? null : this.innerProperties().backupType(); - } - - /** - * Set the backupType property: Backup type. - * - * @param backupType the backupType value to set. - * @return the ServerBackupInner object itself. - */ - public ServerBackupInner withBackupType(String backupType) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupProperties(); - } - 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 ServerBackupInner object itself. - */ - public ServerBackupInner withCompletedTime(OffsetDateTime completedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupProperties(); - } - 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 ServerBackupInner object itself. - */ - public ServerBackupInner withSource(String source) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupProperties.java deleted file mode 100644 index 5b5e549bc5a3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a server backup. */ -@Fluent -public final class ServerBackupProperties { - /* - * Backup type. - */ - @JsonProperty(value = "backupType") - private String backupType; - - /* - * Backup completed time (ISO8601 format). - */ - @JsonProperty(value = "completedTime") - private OffsetDateTime completedTime; - - /* - * Backup source - */ - @JsonProperty(value = "source") - private String source; - - /** Creates an instance of ServerBackupProperties class. */ - public ServerBackupProperties() { - } - - /** - * Get the backupType property: Backup type. - * - * @return the backupType value. - */ - public String backupType() { - return this.backupType; - } - - /** - * Set the backupType property: Backup type. - * - * @param backupType the backupType value to set. - * @return the ServerBackupProperties object itself. - */ - public ServerBackupProperties withBackupType(String 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 ServerBackupProperties object itself. - */ - public ServerBackupProperties 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 ServerBackupProperties object itself. - */ - public ServerBackupProperties withSource(String source) { - this.source = source; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index c413157dccf5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java +++ /dev/null @@ -1,500 +0,0 @@ -// 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.Resource; -import com.azure.core.management.SystemData; -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.Identity; -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.ServerState; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; -import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Represents a server. */ -@Fluent -public final class ServerInner extends Resource { - /* - * The cmk identity for the server. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /* - * The SKU (pricing tier) of the server. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * Properties of the server. - */ - @JsonProperty(value = "properties") - private ServerProperties innerProperties; - - /* - * The system metadata relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of ServerInner class. */ - public ServerInner() { - } - - /** - * Get the identity property: The cmk identity for the server. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The cmk identity for the server. - * - * @param identity the identity value to set. - * @return the ServerInner object itself. - */ - public ServerInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the sku property: The SKU (pricing tier) of the server. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU (pricing tier) of the server. - * - * @param sku the sku value to set. - * @return the ServerInner object itself. - */ - public ServerInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: Properties of the server. - * - * @return the innerProperties value. - */ - private ServerProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** {@inheritDoc} */ - @Override - public ServerInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the administratorLogin property: The administrator's login name of a server. Can only be specified when the - * server is being created (and is required for creation). - * - * @return the administratorLogin value. - */ - public String administratorLogin() { - return this.innerProperties() == null ? null : this.innerProperties().administratorLogin(); - } - - /** - * Set the administratorLogin property: The administrator's login name of a server. Can only be specified when the - * server is being created (and is required for creation). - * - * @param administratorLogin the administratorLogin value to set. - * @return the ServerInner object itself. - */ - public ServerInner withAdministratorLogin(String administratorLogin) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withAdministratorLogin(administratorLogin); - return this; - } - - /** - * Get the administratorLoginPassword property: The password of the administrator login (required for server - * creation). - * - * @return the administratorLoginPassword value. - */ - public String administratorLoginPassword() { - return this.innerProperties() == null ? null : this.innerProperties().administratorLoginPassword(); - } - - /** - * Set the administratorLoginPassword property: The password of the administrator login (required for server - * creation). - * - * @param administratorLoginPassword the administratorLoginPassword value to set. - * @return the ServerInner object itself. - */ - public ServerInner withAdministratorLoginPassword(String administratorLoginPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withAdministratorLoginPassword(administratorLoginPassword); - 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 ServerInner object itself. - */ - public ServerInner withVersion(ServerVersion version) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - - /** - * Get the availabilityZone property: availability Zone information of the server. - * - * @return the availabilityZone value. - */ - public String availabilityZone() { - return this.innerProperties() == null ? null : this.innerProperties().availabilityZone(); - } - - /** - * Set the availabilityZone property: availability Zone information of the server. - * - * @param availabilityZone the availabilityZone value to set. - * @return the ServerInner object itself. - */ - public ServerInner withAvailabilityZone(String availabilityZone) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withAvailabilityZone(availabilityZone); - return this; - } - - /** - * Get the createMode property: The mode to create a new MySQL server. - * - * @return the createMode value. - */ - public CreateMode createMode() { - return this.innerProperties() == null ? null : this.innerProperties().createMode(); - } - - /** - * Set the createMode property: The mode to create a new MySQL server. - * - * @param createMode the createMode value to set. - * @return the ServerInner object itself. - */ - public ServerInner withCreateMode(CreateMode createMode) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withCreateMode(createMode); - return this; - } - - /** - * Get the sourceServerResourceId property: The source MySQL server id. - * - * @return the sourceServerResourceId value. - */ - public String sourceServerResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().sourceServerResourceId(); - } - - /** - * Set the sourceServerResourceId property: The source MySQL server id. - * - * @param sourceServerResourceId the sourceServerResourceId value to set. - * @return the ServerInner object itself. - */ - public ServerInner withSourceServerResourceId(String sourceServerResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withSourceServerResourceId(sourceServerResourceId); - return this; - } - - /** - * Get the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. - * - * @return the restorePointInTime value. - */ - public OffsetDateTime restorePointInTime() { - return this.innerProperties() == null ? null : this.innerProperties().restorePointInTime(); - } - - /** - * Set the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. - * - * @param restorePointInTime the restorePointInTime value to set. - * @return the ServerInner object itself. - */ - public ServerInner withRestorePointInTime(OffsetDateTime restorePointInTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withRestorePointInTime(restorePointInTime); - return this; - } - - /** - * Get the replicationRole property: The replication role. - * - * @return the replicationRole value. - */ - public ReplicationRole replicationRole() { - return this.innerProperties() == null ? null : this.innerProperties().replicationRole(); - } - - /** - * Set the replicationRole property: The replication role. - * - * @param replicationRole the replicationRole value to set. - * @return the ServerInner object itself. - */ - public ServerInner withReplicationRole(ReplicationRole replicationRole) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withReplicationRole(replicationRole); - return this; - } - - /** - * Get the replicaCapacity property: The maximum number of replicas that a primary server can have. - * - * @return the replicaCapacity value. - */ - public Integer replicaCapacity() { - return this.innerProperties() == null ? null : this.innerProperties().replicaCapacity(); - } - - /** - * Get the dataEncryption property: The Data Encryption for CMK. - * - * @return the dataEncryption value. - */ - public DataEncryption dataEncryption() { - return this.innerProperties() == null ? null : this.innerProperties().dataEncryption(); - } - - /** - * Set the dataEncryption property: The Data Encryption for CMK. - * - * @param dataEncryption the dataEncryption value to set. - * @return the ServerInner object itself. - */ - public ServerInner withDataEncryption(DataEncryption dataEncryption) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withDataEncryption(dataEncryption); - return this; - } - - /** - * Get the state property: The state of a server. - * - * @return the state value. - */ - public ServerState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the fullyQualifiedDomainName property: The fully qualified domain name of a server. - * - * @return the fullyQualifiedDomainName value. - */ - public String fullyQualifiedDomainName() { - return this.innerProperties() == null ? null : this.innerProperties().fullyQualifiedDomainName(); - } - - /** - * Get the storage property: Storage related properties of a server. - * - * @return the storage value. - */ - public Storage storage() { - return this.innerProperties() == null ? null : this.innerProperties().storage(); - } - - /** - * Set the storage property: Storage related properties of a server. - * - * @param storage the storage value to set. - * @return the ServerInner object itself. - */ - public ServerInner withStorage(Storage storage) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withStorage(storage); - return this; - } - - /** - * Get the backup property: Backup related properties of a server. - * - * @return the backup value. - */ - public Backup backup() { - return this.innerProperties() == null ? null : this.innerProperties().backup(); - } - - /** - * Set the backup property: Backup related properties of a server. - * - * @param backup the backup value to set. - * @return the ServerInner object itself. - */ - public ServerInner withBackup(Backup backup) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withBackup(backup); - return this; - } - - /** - * Get the highAvailability property: High availability related properties of a server. - * - * @return the highAvailability value. - */ - public HighAvailability highAvailability() { - return this.innerProperties() == null ? null : this.innerProperties().highAvailability(); - } - - /** - * Set the highAvailability property: High availability related properties of a server. - * - * @param highAvailability the highAvailability value to set. - * @return the ServerInner object itself. - */ - public ServerInner withHighAvailability(HighAvailability highAvailability) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withHighAvailability(highAvailability); - 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 ServerInner object itself. - */ - public ServerInner withNetwork(Network network) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withNetwork(network); - return this; - } - - /** - * Get the maintenanceWindow property: Maintenance window of a server. - * - * @return the maintenanceWindow value. - */ - public MaintenanceWindow maintenanceWindow() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceWindow(); - } - - /** - * Set the maintenanceWindow property: Maintenance window of a server. - * - * @param maintenanceWindow the maintenanceWindow value to set. - * @return the ServerInner object itself. - */ - public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withMaintenanceWindow(maintenanceWindow); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} 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 deleted file mode 100644 index 42bb3aaf094b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java +++ /dev/null @@ -1,469 +0,0 @@ -// 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.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.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -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.Storage; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a server. */ -@Fluent -public final class ServerProperties { - /* - * The administrator's login name of a server. Can only be specified when the server is being created (and is - * required for creation). - */ - @JsonProperty(value = "administratorLogin") - private String administratorLogin; - - /* - * The password of the administrator login (required for server creation). - */ - @JsonProperty(value = "administratorLoginPassword") - private String administratorLoginPassword; - - /* - * Server version. - */ - @JsonProperty(value = "version") - private ServerVersion version; - - /* - * availability Zone information of the server. - */ - @JsonProperty(value = "availabilityZone") - private String availabilityZone; - - /* - * The mode to create a new MySQL server. - */ - @JsonProperty(value = "createMode") - private CreateMode createMode; - - /* - * The source MySQL server id. - */ - @JsonProperty(value = "sourceServerResourceId") - private String sourceServerResourceId; - - /* - * Restore point creation time (ISO8601 format), specifying the time to restore from. - */ - @JsonProperty(value = "restorePointInTime") - private OffsetDateTime restorePointInTime; - - /* - * The replication role. - */ - @JsonProperty(value = "replicationRole") - private ReplicationRole replicationRole; - - /* - * The maximum number of replicas that a primary server can have. - */ - @JsonProperty(value = "replicaCapacity", access = JsonProperty.Access.WRITE_ONLY) - private Integer replicaCapacity; - - /* - * The Data Encryption for CMK. - */ - @JsonProperty(value = "dataEncryption") - private DataEncryption dataEncryption; - - /* - * The state of a server. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private ServerState state; - - /* - * The fully qualified domain name of a server. - */ - @JsonProperty(value = "fullyQualifiedDomainName", access = JsonProperty.Access.WRITE_ONLY) - private String fullyQualifiedDomainName; - - /* - * Storage related properties of a server. - */ - @JsonProperty(value = "storage") - private Storage storage; - - /* - * Backup related properties of a server. - */ - @JsonProperty(value = "backup") - private Backup backup; - - /* - * High availability related properties of a server. - */ - @JsonProperty(value = "highAvailability") - private HighAvailability highAvailability; - - /* - * Network related properties of a server. - */ - @JsonProperty(value = "network") - private Network network; - - /* - * Maintenance window of a server. - */ - @JsonProperty(value = "maintenanceWindow") - private MaintenanceWindow maintenanceWindow; - - /** Creates an instance of ServerProperties class. */ - public ServerProperties() { - } - - /** - * Get the administratorLogin property: The administrator's login name of a server. Can only be specified when the - * server is being created (and is required for creation). - * - * @return the administratorLogin value. - */ - public String administratorLogin() { - return this.administratorLogin; - } - - /** - * Set the administratorLogin property: The administrator's login name of a server. Can only be specified when the - * server is being created (and is required for creation). - * - * @param administratorLogin the administratorLogin value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withAdministratorLogin(String administratorLogin) { - this.administratorLogin = administratorLogin; - return this; - } - - /** - * Get the administratorLoginPassword property: The password of the administrator login (required for server - * creation). - * - * @return the administratorLoginPassword value. - */ - public String administratorLoginPassword() { - return this.administratorLoginPassword; - } - - /** - * Set the administratorLoginPassword property: The password of the administrator login (required for server - * creation). - * - * @param administratorLoginPassword the administratorLoginPassword value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withAdministratorLoginPassword(String administratorLoginPassword) { - this.administratorLoginPassword = administratorLoginPassword; - return this; - } - - /** - * Get the version property: Server version. - * - * @return the version value. - */ - public ServerVersion version() { - return this.version; - } - - /** - * Set the version property: Server version. - * - * @param version the version value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withVersion(ServerVersion version) { - this.version = version; - return this; - } - - /** - * Get the availabilityZone property: availability Zone information of the server. - * - * @return the availabilityZone value. - */ - public String availabilityZone() { - return this.availabilityZone; - } - - /** - * Set the availabilityZone property: availability Zone information of the server. - * - * @param availabilityZone the availabilityZone value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - return this; - } - - /** - * Get the createMode property: The mode to create a new MySQL server. - * - * @return the createMode value. - */ - public CreateMode createMode() { - return this.createMode; - } - - /** - * Set the createMode property: The mode to create a new MySQL server. - * - * @param createMode the createMode value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withCreateMode(CreateMode createMode) { - this.createMode = createMode; - return this; - } - - /** - * Get the sourceServerResourceId property: The source MySQL server id. - * - * @return the sourceServerResourceId value. - */ - public String sourceServerResourceId() { - return this.sourceServerResourceId; - } - - /** - * Set the sourceServerResourceId property: The source MySQL server id. - * - * @param sourceServerResourceId the sourceServerResourceId value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withSourceServerResourceId(String sourceServerResourceId) { - this.sourceServerResourceId = sourceServerResourceId; - return this; - } - - /** - * Get the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. - * - * @return the restorePointInTime value. - */ - public OffsetDateTime restorePointInTime() { - return this.restorePointInTime; - } - - /** - * Set the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. - * - * @param restorePointInTime the restorePointInTime value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withRestorePointInTime(OffsetDateTime restorePointInTime) { - this.restorePointInTime = restorePointInTime; - return this; - } - - /** - * Get the replicationRole property: The replication role. - * - * @return the replicationRole value. - */ - public ReplicationRole replicationRole() { - return this.replicationRole; - } - - /** - * Set the replicationRole property: The replication role. - * - * @param replicationRole the replicationRole value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withReplicationRole(ReplicationRole replicationRole) { - this.replicationRole = replicationRole; - return this; - } - - /** - * Get the replicaCapacity property: The maximum number of replicas that a primary server can have. - * - * @return the replicaCapacity value. - */ - public Integer replicaCapacity() { - return this.replicaCapacity; - } - - /** - * Get the dataEncryption property: The Data Encryption for CMK. - * - * @return the dataEncryption value. - */ - public DataEncryption dataEncryption() { - return this.dataEncryption; - } - - /** - * Set the dataEncryption property: The Data Encryption for CMK. - * - * @param dataEncryption the dataEncryption value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withDataEncryption(DataEncryption dataEncryption) { - this.dataEncryption = dataEncryption; - return this; - } - - /** - * Get the state property: The state of a server. - * - * @return the state value. - */ - public ServerState state() { - return this.state; - } - - /** - * Get the fullyQualifiedDomainName property: The fully qualified domain name of a server. - * - * @return the fullyQualifiedDomainName value. - */ - public String fullyQualifiedDomainName() { - return this.fullyQualifiedDomainName; - } - - /** - * Get the storage property: Storage related properties of a server. - * - * @return the storage value. - */ - public Storage storage() { - return this.storage; - } - - /** - * Set the storage property: Storage related properties of a server. - * - * @param storage the storage value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withStorage(Storage storage) { - this.storage = storage; - return this; - } - - /** - * Get the backup property: Backup related properties of a server. - * - * @return the backup value. - */ - public Backup backup() { - return this.backup; - } - - /** - * Set the backup property: Backup related properties of a server. - * - * @param backup the backup value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withBackup(Backup backup) { - this.backup = backup; - return this; - } - - /** - * Get the highAvailability property: High availability related properties of a server. - * - * @return the highAvailability value. - */ - public HighAvailability highAvailability() { - return this.highAvailability; - } - - /** - * Set the highAvailability property: High availability related properties of a server. - * - * @param highAvailability the highAvailability value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withHighAvailability(HighAvailability highAvailability) { - this.highAvailability = highAvailability; - return this; - } - - /** - * Get the network property: Network related properties of a server. - * - * @return the network value. - */ - public Network network() { - return this.network; - } - - /** - * Set the network property: Network related properties of a server. - * - * @param network the network value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withNetwork(Network network) { - this.network = network; - return this; - } - - /** - * Get the maintenanceWindow property: Maintenance window of a server. - * - * @return the maintenanceWindow value. - */ - public MaintenanceWindow maintenanceWindow() { - return this.maintenanceWindow; - } - - /** - * Set the maintenanceWindow property: Maintenance window of a server. - * - * @param maintenanceWindow the maintenanceWindow value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { - this.maintenanceWindow = maintenanceWindow; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataEncryption() != null) { - dataEncryption().validate(); - } - if (storage() != null) { - storage().validate(); - } - if (backup() != null) { - backup().validate(); - } - if (highAvailability() != null) { - highAvailability().validate(); - } - if (network() != null) { - network().validate(); - } - if (maintenanceWindow() != null) { - maintenanceWindow().validate(); - } - } -} 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 deleted file mode 100644 index 09caef06d7bc..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ /dev/null @@ -1,284 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.models.Backup; -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 com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties that can be updated for a server. */ -@Fluent -public final class ServerPropertiesForUpdate { - /* - * The password of the administrator login. - */ - @JsonProperty(value = "administratorLoginPassword") - private String administratorLoginPassword; - - /* - * Server version. - */ - @JsonProperty(value = "version") - private ServerVersion version; - - /* - * Storage related properties of a server. - */ - @JsonProperty(value = "storage") - private Storage storage; - - /* - * Backup related properties of a server. - */ - @JsonProperty(value = "backup") - private Backup backup; - - /* - * High availability related properties of a server. - */ - @JsonProperty(value = "highAvailability") - private HighAvailability highAvailability; - - /* - * Maintenance window of a server. - */ - @JsonProperty(value = "maintenanceWindow") - private MaintenanceWindow maintenanceWindow; - - /* - * The replication role of the server. - */ - @JsonProperty(value = "replicationRole") - private ReplicationRole replicationRole; - - /* - * The Data Encryption for CMK. - */ - @JsonProperty(value = "dataEncryption") - private DataEncryption dataEncryption; - - /* - * Network related properties of a server - */ - @JsonProperty(value = "network") - private Network network; - - /** Creates an instance of ServerPropertiesForUpdate class. */ - public ServerPropertiesForUpdate() { - } - - /** - * Get the administratorLoginPassword property: The password of the administrator login. - * - * @return the administratorLoginPassword value. - */ - public String administratorLoginPassword() { - return this.administratorLoginPassword; - } - - /** - * Set the administratorLoginPassword property: The password of the administrator login. - * - * @param administratorLoginPassword the administratorLoginPassword value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withAdministratorLoginPassword(String administratorLoginPassword) { - this.administratorLoginPassword = administratorLoginPassword; - return this; - } - - /** - * Get the version property: Server version. - * - * @return the version value. - */ - public ServerVersion version() { - return this.version; - } - - /** - * Set the version property: Server version. - * - * @param version the version value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withVersion(ServerVersion version) { - this.version = version; - return this; - } - - /** - * Get the storage property: Storage related properties of a server. - * - * @return the storage value. - */ - public Storage storage() { - return this.storage; - } - - /** - * Set the storage property: Storage related properties of a server. - * - * @param storage the storage value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withStorage(Storage storage) { - this.storage = storage; - return this; - } - - /** - * Get the backup property: Backup related properties of a server. - * - * @return the backup value. - */ - public Backup backup() { - return this.backup; - } - - /** - * Set the backup property: Backup related properties of a server. - * - * @param backup the backup value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withBackup(Backup backup) { - this.backup = backup; - return this; - } - - /** - * Get the highAvailability property: High availability related properties of a server. - * - * @return the highAvailability value. - */ - public HighAvailability highAvailability() { - return this.highAvailability; - } - - /** - * Set the highAvailability property: High availability related properties of a server. - * - * @param highAvailability the highAvailability value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withHighAvailability(HighAvailability highAvailability) { - this.highAvailability = highAvailability; - return this; - } - - /** - * Get the maintenanceWindow property: Maintenance window of a server. - * - * @return the maintenanceWindow value. - */ - public MaintenanceWindow maintenanceWindow() { - return this.maintenanceWindow; - } - - /** - * Set the maintenanceWindow property: Maintenance window of a server. - * - * @param maintenanceWindow the maintenanceWindow value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { - this.maintenanceWindow = maintenanceWindow; - return this; - } - - /** - * Get the replicationRole property: The replication role of the server. - * - * @return the replicationRole value. - */ - public ReplicationRole replicationRole() { - return this.replicationRole; - } - - /** - * Set the replicationRole property: The replication role of the server. - * - * @param replicationRole the replicationRole value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withReplicationRole(ReplicationRole replicationRole) { - this.replicationRole = replicationRole; - return this; - } - - /** - * Get the dataEncryption property: The Data Encryption for CMK. - * - * @return the dataEncryption value. - */ - public DataEncryption dataEncryption() { - return this.dataEncryption; - } - - /** - * Set the dataEncryption property: The Data Encryption for CMK. - * - * @param dataEncryption the dataEncryption value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withDataEncryption(DataEncryption dataEncryption) { - this.dataEncryption = dataEncryption; - return this; - } - - /** - * Get the network property: Network related properties of a server. - * - * @return the network value. - */ - public Network network() { - return this.network; - } - - /** - * Set the network property: Network related properties of a server. - * - * @param network the network value to set. - * @return the ServerPropertiesForUpdate object itself. - */ - public ServerPropertiesForUpdate withNetwork(Network network) { - this.network = network; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storage() != null) { - storage().validate(); - } - if (backup() != null) { - backup().validate(); - } - if (highAvailability() != null) { - highAvailability().validate(); - } - if (maintenanceWindow() != null) { - maintenanceWindow().validate(); - } - if (dataEncryption() != null) { - dataEncryption().validate(); - } - if (network() != null) { - network().validate(); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java deleted file mode 100644 index e64b2d25e0e1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents ValidateBackup API Response. */ -@Fluent -public final class ValidateBackupResponseInner { - /* - * The response properties of a pre backup operation. - */ - @JsonProperty(value = "properties") - 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(); - } - } -} 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 dfa9984ee305..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** ValidateBackup Response Properties. */ -@Fluent -public final class ValidateBackupResponseProperties { - /* - * Estimated no of storage containers required for resource data to be backed up. - */ - @JsonProperty(value = "numberOfContainers") - 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() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java deleted file mode 100644 index 270ee1a27a02..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.mysqlflexibleserver.models.DelegatedSubnetUsage; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Virtual network subnet usage data. */ -@Immutable -public final class VirtualNetworkSubnetUsageResultInner { - /* - * The location name. - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * The subscription id. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * A list of delegated subnet usage - */ - @JsonProperty(value = "delegatedSubnetsUsage", access = JsonProperty.Access.WRITE_ONLY) - private List delegatedSubnetsUsage; - - /** Creates an instance of VirtualNetworkSubnetUsageResultInner class. */ - public VirtualNetworkSubnetUsageResultInner() { - } - - /** - * Get the location property: The location name. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the subscriptionId property: The subscription id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the delegatedSubnetsUsage property: A list of delegated subnet usage. - * - * @return the delegatedSubnetsUsage value. - */ - public List delegatedSubnetsUsage() { - return this.delegatedSubnetsUsage; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (delegatedSubnetsUsage() != null) { - delegatedSubnetsUsage().forEach(e -> e.validate()); - } - } -} 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 bd4a5569be38..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -// 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.administratorName = - AdministratorName.fromString(Utils.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 ec983c8ec867..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java +++ /dev/null @@ -1,1152 +0,0 @@ -// 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 = "2021-12-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 = "2021-12-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 = "2021-12-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 = "2021-12-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 = "2021-12-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 = "2021-12-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 = "2021-12-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 = "2021-12-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 - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a List of 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 - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a List of 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/BackupAndExportResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java deleted file mode 100644 index 6200fdecdb31..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.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.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 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 6eb944a5fa10..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java +++ /dev/null @@ -1,511 +0,0 @@ -// 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 = "2022-09-30-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 = "2022-09-30-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 = "2022-09-30-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 = "2022-09-30-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 4f71540a67e9..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.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.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 deleted file mode 100644 index e3426f53af40..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java +++ /dev/null @@ -1,681 +0,0 @@ -// 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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BackupsClient. */ -public final class BackupsClientImpl implements BackupsClient { - /** The proxy service used to perform REST calls. */ - private final BackupsService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of BackupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(BackupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientBackups to be used by the proxy service to - * perform REST calls. - */ - @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}) - @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}/backups") - @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); - } - - /** - * 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 = "2022-09-30-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 = "2022-09-30-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. - * - * @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> 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 = "2022-09-30-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())); - } - - /** - * 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 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> 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 = "2022-09-30-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); - } - - /** - * 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 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 getAsync(String resourceGroupName, String serverName, String backupName) { - return getWithResponseAsync(resourceGroupName, serverName, backupName) - .flatMap(res -> Mono.justOrEmpty(res.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. - * @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 getWithResponse( - String resourceGroupName, String serverName, String backupName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, backupName, context).block(); - } - - /** - * 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 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 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> 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 = "2022-09-30-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 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> 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 = "2022-09-30-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 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 listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(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 listByServerAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(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 listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(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 listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server backups 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/BackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java deleted file mode 100644 index d01ef6eb0006..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.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.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.BackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Backups; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; - -public final class BackupsImpl implements Backups { - private static final ClientLogger LOGGER = new ClientLogger(BackupsImpl.class); - - private final BackupsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public BackupsImpl( - BackupsClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = 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 = - this.serviceClient().getWithResponse(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 get(String resourceGroupName, String serverName, String backupName) { - ServerBackupInner inner = this.serviceClient().get(resourceGroupName, serverName, backupName); - if (inner != null) { - return new ServerBackupImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ServerBackupImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ServerBackupImpl(inner1, this.manager())); - } - - private BackupsClient 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/CheckNameAvailabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java deleted file mode 100644 index e8ade0c13226..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CheckNameAvailabilitiesClient. */ -public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailabilitiesClient { - /** The proxy service used to perform REST calls. */ - private final CheckNameAvailabilitiesService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of CheckNameAvailabilitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CheckNameAvailabilitiesClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy - .create(CheckNameAvailabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientCheckNameAvailabilities to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface CheckNameAvailabilitiesService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> execute( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, - @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync( - String locationName, NameAvailabilityRequest nameAvailabilityRequest) { - 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 (nameAvailabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); - } else { - nameAvailabilityRequest.validate(); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .execute( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - locationName, - nameAvailabilityRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync( - String locationName, NameAvailabilityRequest nameAvailabilityRequest, 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 (nameAvailabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); - } else { - nameAvailabilityRequest.validate(); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .execute( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - locationName, - nameAvailabilityRequest, - accept, - context); - } - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync( - String locationName, NameAvailabilityRequest nameAvailabilityRequest) { - return executeWithResponseAsync(locationName, nameAvailabilityRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeWithResponse( - String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context) { - return executeWithResponseAsync(locationName, nameAvailabilityRequest, context).block(); - } - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityInner execute(String locationName, NameAvailabilityRequest nameAvailabilityRequest) { - return executeWithResponse(locationName, nameAvailabilityRequest, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java deleted file mode 100644 index 07f8df796867..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.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.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.CheckNameAvailabilitiesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilities; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -public final class CheckNameAvailabilitiesImpl implements CheckNameAvailabilities { - private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilitiesImpl.class); - - private final CheckNameAvailabilitiesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public CheckNameAvailabilitiesImpl( - CheckNameAvailabilitiesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response executeWithResponse( - String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context) { - Response inner = - this.serviceClient().executeWithResponse(locationName, nameAvailabilityRequest, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new NameAvailabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public NameAvailability execute(String locationName, NameAvailabilityRequest nameAvailabilityRequest) { - NameAvailabilityInner inner = this.serviceClient().execute(locationName, nameAvailabilityRequest); - if (inner != null) { - return new NameAvailabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - private CheckNameAvailabilitiesClient 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/CheckNameAvailabilityWithoutLocationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java deleted file mode 100644 index 1d771a3629cb..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * CheckNameAvailabilityWithoutLocationsClient. - */ -public final class CheckNameAvailabilityWithoutLocationsClientImpl - implements CheckNameAvailabilityWithoutLocationsClient { - /** The proxy service used to perform REST calls. */ - private final CheckNameAvailabilityWithoutLocationsService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of CheckNameAvailabilityWithoutLocationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CheckNameAvailabilityWithoutLocationsClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy - .create( - CheckNameAvailabilityWithoutLocationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientCheckNameAvailabilityWithoutLocations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface CheckNameAvailabilityWithoutLocationsService { - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> execute( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync( - NameAvailabilityRequest nameAvailabilityRequest) { - 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 (nameAvailabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); - } else { - nameAvailabilityRequest.validate(); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .execute( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - nameAvailabilityRequest, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync( - NameAvailabilityRequest nameAvailabilityRequest, 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 (nameAvailabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); - } else { - nameAvailabilityRequest.validate(); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .execute( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - nameAvailabilityRequest, - accept, - context); - } - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync(NameAvailabilityRequest nameAvailabilityRequest) { - return executeWithResponseAsync(nameAvailabilityRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeWithResponse( - NameAvailabilityRequest nameAvailabilityRequest, Context context) { - return executeWithResponseAsync(nameAvailabilityRequest, context).block(); - } - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityInner execute(NameAvailabilityRequest nameAvailabilityRequest) { - return executeWithResponse(nameAvailabilityRequest, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsImpl.java deleted file mode 100644 index 568a42b28ddf..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsImpl.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.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.CheckNameAvailabilityWithoutLocationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilityWithoutLocations; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -public final class CheckNameAvailabilityWithoutLocationsImpl implements CheckNameAvailabilityWithoutLocations { - private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityWithoutLocationsImpl.class); - - private final CheckNameAvailabilityWithoutLocationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public CheckNameAvailabilityWithoutLocationsImpl( - CheckNameAvailabilityWithoutLocationsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response executeWithResponse( - NameAvailabilityRequest nameAvailabilityRequest, Context context) { - Response inner = - this.serviceClient().executeWithResponse(nameAvailabilityRequest, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new NameAvailabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public NameAvailability execute(NameAvailabilityRequest nameAvailabilityRequest) { - NameAvailabilityInner inner = this.serviceClient().execute(nameAvailabilityRequest); - if (inner != null) { - return new NameAvailabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - private CheckNameAvailabilityWithoutLocationsClient 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/CheckVirtualNetworkSubnetUsagesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java deleted file mode 100644 index 4f32ae9315d0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -// 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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CheckVirtualNetworkSubnetUsagesClient. */ -public final class CheckVirtualNetworkSubnetUsagesClientImpl implements CheckVirtualNetworkSubnetUsagesClient { - /** The proxy service used to perform REST calls. */ - private final CheckVirtualNetworkSubnetUsagesService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of CheckVirtualNetworkSubnetUsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CheckVirtualNetworkSubnetUsagesClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy - .create( - CheckVirtualNetworkSubnetUsagesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientCheckVirtualNetworkSubnetUsages to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface CheckVirtualNetworkSubnetUsagesService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkVirtualNetworkSubnetUsage") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> execute( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, - @BodyParam("application/json") VirtualNetworkSubnetUsageParameter parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync( - String locationName, VirtualNetworkSubnetUsageParameter 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName 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 = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .execute( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - locationName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync( - String locationName, VirtualNetworkSubnetUsageParameter 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName 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 = "2021-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .execute( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - locationName, - parameters, - accept, - context); - } - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync( - String locationName, VirtualNetworkSubnetUsageParameter parameters) { - return executeWithResponseAsync(locationName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeWithResponse( - String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context) { - return executeWithResponseAsync(locationName, parameters, context).block(); - } - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkSubnetUsageResultInner execute( - String locationName, VirtualNetworkSubnetUsageParameter parameters) { - return executeWithResponse(locationName, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesImpl.java deleted file mode 100644 index 92bc0f54aec7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesImpl.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.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.CheckVirtualNetworkSubnetUsagesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CheckVirtualNetworkSubnetUsages; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageResult; - -public final class CheckVirtualNetworkSubnetUsagesImpl implements CheckVirtualNetworkSubnetUsages { - private static final ClientLogger LOGGER = new ClientLogger(CheckVirtualNetworkSubnetUsagesImpl.class); - - private final CheckVirtualNetworkSubnetUsagesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public CheckVirtualNetworkSubnetUsagesImpl( - CheckVirtualNetworkSubnetUsagesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response executeWithResponse( - String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context) { - Response inner = - this.serviceClient().executeWithResponse(locationName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualNetworkSubnetUsageResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public VirtualNetworkSubnetUsageResult execute(String locationName, VirtualNetworkSubnetUsageParameter parameters) { - VirtualNetworkSubnetUsageResultInner inner = this.serviceClient().execute(locationName, parameters); - if (inner != null) { - return new VirtualNetworkSubnetUsageResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private CheckVirtualNetworkSubnetUsagesClient 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/ConfigurationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java deleted file mode 100644 index 6f167f8ec87a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java +++ /dev/null @@ -1,194 +0,0 @@ -// 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.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsConfigPendingRestart; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig; -import com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly; - -public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update { - private ConfigurationInner 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 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(); - } - - public String dataType() { - return this.innerModel().dataType(); - } - - public String allowedValues() { - return this.innerModel().allowedValues(); - } - - public ConfigurationSource source() { - return this.innerModel().source(); - } - - public IsReadOnly isReadOnly() { - return this.innerModel().isReadOnly(); - } - - public IsConfigPendingRestart isConfigPendingRestart() { - return this.innerModel().isConfigPendingRestart(); - } - - public IsDynamicConfig isDynamicConfig() { - return this.innerModel().isDynamicConfig(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ConfigurationInner innerModel() { - return this.innerObject; - } - - 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.configurationName = Utils.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 deleted file mode 100644 index ea282327b1ca..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java +++ /dev/null @@ -1,1548 +0,0 @@ -// 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.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; -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.ConfigurationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ -public final class ConfigurationsClientImpl implements ConfigurationsClient { - /** The proxy service used to perform REST calls. */ - private final ConfigurationsService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of ConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ConfigurationsClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy.create(ConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientConfigurations to be used by the proxy service - * to perform REST calls. - */ - @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}) - @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("configurationName") String configurationName, - @BodyParam("application/json") ConfigurationInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("configurationName") String configurationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> batchUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @BodyParam("application/json") ConfigurationListForBatchUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("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); - - @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); - } - - /** - * 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 = "2021-12-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 = "2021-12-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. - * - * @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>> updateWithResponseAsync( - 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 = "2021-12-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)) - .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>> updateWithResponseAsync( - 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 = "2021-12-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); - } - - /** - * 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> beginUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - Mono>> mono = - updateWithResponseAsync(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> beginUpdateAsync( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(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> beginUpdate( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return this.beginUpdateAsync(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> beginUpdate( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - return this - .beginUpdateAsync(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 updateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return beginUpdateAsync(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 updateAsync( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - return beginUpdateAsync(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 update( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return updateAsync(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 update( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - return updateAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); - } - - /** - * Gets information about a configuration of 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String configurationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (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.")); - } - final String apiVersion = "2021-12-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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a configuration of 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String configurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (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.")); - } - final String apiVersion = "2021-12-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); - } - - /** - * Gets information about a configuration of 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String configurationName) { - return getWithResponseAsync(resourceGroupName, serverName, configurationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about a configuration of 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String configurationName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, configurationName, context).block(); - } - - /** - * Gets information about a configuration of 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner get(String resourceGroupName, String serverName, String configurationName) { - return getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> batchUpdateWithResponseAsync( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate 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 = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .batchUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> batchUpdateWithResponseAsync( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate 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 = "2021-12-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); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfigurationListResultInner> beginBatchUpdateAsync( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - Mono>> mono = batchUpdateWithResponseAsync(resourceGroupName, serverName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationListResultInner.class, - ConfigurationListResultInner.class, - this.client.getContext()); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfigurationListResultInner> beginBatchUpdateAsync( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - batchUpdateWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationListResultInner.class, - ConfigurationListResultInner.class, - context); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationListResultInner> beginBatchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - return this.beginBatchUpdateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationListResultInner> beginBatchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { - return this.beginBatchUpdateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono batchUpdateAsync( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - return beginBatchUpdateAsync(resourceGroupName, serverName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono batchUpdateAsync( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { - return beginBatchUpdateAsync(resourceGroupName, serverName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationListResultInner batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - return batchUpdateAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationListResultInner batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { - return batchUpdateAsync(resourceGroupName, serverName, parameters, context).block(); - } - - /** - * 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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, String tags, String keyword, Integer page, Integer pageSize) { - 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 = "2021-12-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)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the configurations 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, - String serverName, - String tags, - String keyword, - Integer page, - Integer pageSize, - 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 = "2021-12-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) - .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. - * - * @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 configurations as paginated response with {@link PagedFlux}. - */ - @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), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, - Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @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)); - } - - /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @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)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations 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/ConfigurationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java deleted file mode 100644 index 7691bc15217a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.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.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.ConfigurationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configurations; - -public final class ConfigurationsImpl implements Configurations { - private static final ClientLogger LOGGER = new ClientLogger(ConfigurationsImpl.class); - - private final ConfigurationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public ConfigurationsImpl( - ConfigurationsClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String configurationName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, configurationName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Configuration get(String resourceGroupName, String serverName, String configurationName) { - ConfigurationInner inner = this.serviceClient().get(resourceGroupName, serverName, configurationName); - if (inner != null) { - return new ConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public ConfigurationListResult batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - ConfigurationListResultInner inner = - this.serviceClient().batchUpdate(resourceGroupName, serverName, parameters); - if (inner != null) { - return new ConfigurationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public ConfigurationListResult batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { - ConfigurationListResultInner inner = - this.serviceClient().batchUpdate(resourceGroupName, serverName, parameters, context); - if (inner != null) { - return new ConfigurationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable listByServer( - String resourceGroupName, - String serverName, - String tags, - String keyword, - Integer page, - Integer pageSize, - Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, tags, keyword, page, pageSize, context); - return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); - } - - public Configuration getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 = Utils.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; - } - - 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/DatabaseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabaseImpl.java deleted file mode 100644 index b67d39eb2e3a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabaseImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; - -public final class DatabaseImpl implements Database, Database.Definition, Database.Update { - private DatabaseInner 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 String charset() { - return this.innerModel().charset(); - } - - public String collation() { - return this.innerModel().collation(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public DatabaseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private String databaseName; - - public DatabaseImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public Database create() { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), Context.NONE); - return this; - } - - public Database create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), context); - return this; - } - - DatabaseImpl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new DatabaseInner(); - this.serviceManager = serviceManager; - this.databaseName = name; - } - - public DatabaseImpl update() { - return this; - } - - public Database apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), Context.NONE); - return this; - } - - public Database apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), context); - return this; - } - - DatabaseImpl(DatabaseInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.databaseName = Utils.getValueFromIdByName(innerObject.id(), "databases"); - } - - public Database refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .getWithResponse(resourceGroupName, serverName, databaseName, Context.NONE) - .getValue(); - return this; - } - - public Database refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .getWithResponse(resourceGroupName, serverName, databaseName, context) - .getValue(); - return this; - } - - public DatabaseImpl withCharset(String charset) { - this.innerModel().withCharset(charset); - return this; - } - - public DatabaseImpl withCollation(String collation) { - this.innerModel().withCollation(collation); - return this; - } -} 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 deleted file mode 100644 index 53bb088a3083..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java +++ /dev/null @@ -1,1089 +0,0 @@ -// 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.DatabasesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.DatabaseListResult; -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 DatabasesClient. */ -public final class DatabasesClientImpl implements DatabasesClient { - /** The proxy service used to perform REST calls. */ - private final DatabasesService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of DatabasesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DatabasesClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy.create(DatabasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientDatabases to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface DatabasesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") - @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("databaseName") String databaseName, - @BodyParam("application/json") DatabaseInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") - @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("databaseName") String databaseName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") - @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("databaseName") String databaseName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases") - @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 a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Database along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serverName, String databaseName, DatabaseInner 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 (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName 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 = "2021-12-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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Database along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serverName, String databaseName, DatabaseInner 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 (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName 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 = "2021-12-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); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Database. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, databaseName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DatabaseInner.class, - DatabaseInner.class, - this.client.getContext()); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Database. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, databaseName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, context); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Database. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DatabaseInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).getSyncPoller(); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Database. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DatabaseInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Database on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Database on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseInner createOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).block(); - } - - /** - * Creates a new database or updates an existing database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param parameters The required parameters for creating or updating a database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseInner createOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters, context).block(); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, String databaseName) { - 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 (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - databaseName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, String databaseName, 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 (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - final String apiVersion = "2021-12-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); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, String databaseName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName, databaseName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, String databaseName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, databaseName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, String databaseName) { - return this.beginDeleteAsync(resourceGroupName, serverName, databaseName).getSyncPoller(); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, String databaseName, Context context) { - return this.beginDeleteAsync(resourceGroupName, serverName, databaseName, context).getSyncPoller(); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, String databaseName) { - return beginDeleteAsync(resourceGroupName, serverName, databaseName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, String databaseName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, databaseName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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, String databaseName) { - deleteAsync(resourceGroupName, serverName, databaseName).block(); - } - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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, String databaseName, Context context) { - deleteAsync(resourceGroupName, serverName, databaseName, context).block(); - } - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 database along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String databaseName) { - 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 (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - final String apiVersion = "2021-12-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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 database along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String databaseName, 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 (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - final String apiVersion = "2021-12-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); - } - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 database on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String databaseName) { - return getWithResponseAsync(resourceGroupName, serverName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 database along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String databaseName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, databaseName, context).block(); - } - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseInner get(String resourceGroupName, String serverName, String databaseName) { - return getWithResponse(resourceGroupName, serverName, databaseName, Context.NONE).getValue(); - } - - /** - * List all the databases 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 databases 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 = "2021-12-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 databases 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 databases 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 = "2021-12-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 databases 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 databases 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 databases 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 databases 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 databases 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 databases 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 databases 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 databases as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a List of databases along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a List of databases 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/DatabasesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesImpl.java deleted file mode 100644 index 8dd7479cfce9..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesImpl.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.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.DatabasesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import com.azure.resourcemanager.mysqlflexibleserver.models.Databases; - -public final class DatabasesImpl implements Databases { - private static final ClientLogger LOGGER = new ClientLogger(DatabasesImpl.class); - - private final DatabasesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public DatabasesImpl( - DatabasesClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String resourceGroupName, String serverName, String databaseName) { - this.serviceClient().delete(resourceGroupName, serverName, databaseName); - } - - public void delete(String resourceGroupName, String serverName, String databaseName, Context context) { - this.serviceClient().delete(resourceGroupName, serverName, databaseName, context); - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String databaseName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, databaseName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DatabaseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Database get(String resourceGroupName, String serverName, String databaseName) { - DatabaseInner inner = this.serviceClient().get(resourceGroupName, serverName, databaseName); - if (inner != null) { - return new DatabaseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); - } - - public Database getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 databaseName = Utils.getValueFromIdByName(id, "databases"); - if (databaseName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, databaseName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 databaseName = Utils.getValueFromIdByName(id, "databases"); - if (databaseName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, databaseName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 databaseName = Utils.getValueFromIdByName(id, "databases"); - if (databaseName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); - } - this.delete(resourceGroupName, serverName, databaseName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 databaseName = Utils.getValueFromIdByName(id, "databases"); - if (databaseName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); - } - this.delete(resourceGroupName, serverName, databaseName, context); - } - - private DatabasesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public DatabaseImpl define(String name) { - return new DatabaseImpl(name, this.manager()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRuleImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRuleImpl.java deleted file mode 100644 index 8bd2814040c5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRuleImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// 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.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; - -public final class FirewallRuleImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { - private FirewallRuleInner 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 String startIpAddress() { - return this.innerModel().startIpAddress(); - } - - public String endIpAddress() { - return this.innerModel().endIpAddress(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public FirewallRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private String firewallRuleName; - - public FirewallRuleImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public FirewallRule create() { - this.innerObject = - serviceManager - .serviceClient() - .getFirewallRules() - .createOrUpdate(resourceGroupName, serverName, firewallRuleName, this.innerModel(), Context.NONE); - return this; - } - - public FirewallRule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getFirewallRules() - .createOrUpdate(resourceGroupName, serverName, firewallRuleName, this.innerModel(), context); - return this; - } - - FirewallRuleImpl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new FirewallRuleInner(); - this.serviceManager = serviceManager; - this.firewallRuleName = name; - } - - public FirewallRuleImpl update() { - return this; - } - - public FirewallRule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getFirewallRules() - .createOrUpdate(resourceGroupName, serverName, firewallRuleName, this.innerModel(), Context.NONE); - return this; - } - - public FirewallRule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getFirewallRules() - .createOrUpdate(resourceGroupName, serverName, firewallRuleName, this.innerModel(), context); - return this; - } - - FirewallRuleImpl( - FirewallRuleInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.firewallRuleName = Utils.getValueFromIdByName(innerObject.id(), "firewallRules"); - } - - public FirewallRule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getFirewallRules() - .getWithResponse(resourceGroupName, serverName, firewallRuleName, Context.NONE) - .getValue(); - return this; - } - - public FirewallRule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getFirewallRules() - .getWithResponse(resourceGroupName, serverName, firewallRuleName, context) - .getValue(); - return this; - } - - public FirewallRuleImpl withStartIpAddress(String startIpAddress) { - this.innerModel().withStartIpAddress(startIpAddress); - return this; - } - - public FirewallRuleImpl withEndIpAddress(String endIpAddress) { - this.innerModel().withEndIpAddress(endIpAddress); - return this; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesImpl.java deleted file mode 100644 index 64d8b39681de..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// 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.FirewallRulesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRules; - -public final class FirewallRulesImpl implements FirewallRules { - private static final ClientLogger LOGGER = new ClientLogger(FirewallRulesImpl.class); - - private final FirewallRulesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public FirewallRulesImpl( - FirewallRulesClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String resourceGroupName, String serverName, String firewallRuleName) { - this.serviceClient().delete(resourceGroupName, serverName, firewallRuleName); - } - - public void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context) { - this.serviceClient().delete(resourceGroupName, serverName, firewallRuleName, context); - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, firewallRuleName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new FirewallRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public FirewallRule get(String resourceGroupName, String serverName, String firewallRuleName) { - FirewallRuleInner inner = this.serviceClient().get(resourceGroupName, serverName, firewallRuleName); - if (inner != null) { - return new FirewallRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager())); - } - - public FirewallRule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); - if (firewallRuleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, firewallRuleName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); - if (firewallRuleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, firewallRuleName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); - if (firewallRuleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); - } - this.delete(resourceGroupName, serverName, firewallRuleName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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 firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); - if (firewallRuleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); - } - this.delete(resourceGroupName, serverName, firewallRuleName, context); - } - - private FirewallRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public FirewallRuleImpl define(String name) { - return new FirewallRuleImpl(name, this.manager()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixResponseImpl.java deleted file mode 100644 index 3dc69782ccc0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixResponseImpl.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.implementation; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixResponse; - -public final class GetPrivateDnsZoneSuffixResponseImpl implements GetPrivateDnsZoneSuffixResponse { - private GetPrivateDnsZoneSuffixResponseInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - GetPrivateDnsZoneSuffixResponseImpl( - GetPrivateDnsZoneSuffixResponseInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String privateDnsZoneSuffix() { - return this.innerModel().privateDnsZoneSuffix(); - } - - public GetPrivateDnsZoneSuffixResponseInner 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/GetPrivateDnsZoneSuffixesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java deleted file mode 100644 index d2e657c1d9f6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -// 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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GetPrivateDnsZoneSuffixesClient. */ -public final class GetPrivateDnsZoneSuffixesClientImpl implements GetPrivateDnsZoneSuffixesClient { - /** The proxy service used to perform REST calls. */ - private final GetPrivateDnsZoneSuffixesService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of GetPrivateDnsZoneSuffixesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GetPrivateDnsZoneSuffixesClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy - .create( - GetPrivateDnsZoneSuffixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientGetPrivateDnsZoneSuffixes to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface GetPrivateDnsZoneSuffixesService { - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.DBforMySQL/getPrivateDnsZoneSuffix") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> execute( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get private DNS zone suffix in the cloud. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get private DNS zone suffix in the cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Get private DNS zone suffix in the cloud. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync() { - return executeWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get private DNS zone suffix in the cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeWithResponse(Context context) { - return executeWithResponseAsync(context).block(); - } - - /** - * Get private DNS zone suffix in the cloud. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetPrivateDnsZoneSuffixResponseInner execute() { - return executeWithResponse(Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java deleted file mode 100644 index 6dc3447c2748..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// 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.GetPrivateDnsZoneSuffixesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixes; - -public final class GetPrivateDnsZoneSuffixesImpl implements GetPrivateDnsZoneSuffixes { - private static final ClientLogger LOGGER = new ClientLogger(GetPrivateDnsZoneSuffixesImpl.class); - - private final GetPrivateDnsZoneSuffixesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public GetPrivateDnsZoneSuffixesImpl( - GetPrivateDnsZoneSuffixesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response executeWithResponse(Context context) { - Response inner = this.serviceClient().executeWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GetPrivateDnsZoneSuffixResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GetPrivateDnsZoneSuffixResponse execute() { - GetPrivateDnsZoneSuffixResponseInner inner = this.serviceClient().execute(); - if (inner != null) { - return new GetPrivateDnsZoneSuffixResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private GetPrivateDnsZoneSuffixesClient 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/LocationBasedCapabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java deleted file mode 100644 index 8c0c04a24a47..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java +++ /dev/null @@ -1,313 +0,0 @@ -// 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.LocationBasedCapabilitiesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitiesListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LocationBasedCapabilitiesClient. */ -public final class LocationBasedCapabilitiesClientImpl implements LocationBasedCapabilitiesClient { - /** The proxy service used to perform REST calls. */ - private final LocationBasedCapabilitiesService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LocationBasedCapabilitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationBasedCapabilitiesClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy - .create( - LocationBasedCapabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLocationBasedCapabilities to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LocationBasedCapabilitiesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilities") - @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("{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 = "2021-12-01-preview"; - 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 = "2021-12-01-preview"; - 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 the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability 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 - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability 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/LocationBasedCapabilitiesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java deleted file mode 100644 index 8d01cb74c931..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.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.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.LocationBasedCapabilitiesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilityProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilities; - -public final class LocationBasedCapabilitiesImpl implements LocationBasedCapabilities { - private static final ClientLogger LOGGER = new ClientLogger(LocationBasedCapabilitiesImpl.class); - - private final LocationBasedCapabilitiesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LocationBasedCapabilitiesImpl( - LocationBasedCapabilitiesClient 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 Utils.mapPage(inner, inner1 -> new CapabilityPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable list(String locationName, Context context) { - PagedIterable inner = this.serviceClient().list(locationName, context); - return Utils.mapPage(inner, inner1 -> new CapabilityPropertiesImpl(inner1, this.manager())); - } - - private LocationBasedCapabilitiesClient 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 e0b9fc6ffa02..000000000000 --- 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 b0ee993e1081..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java +++ /dev/null @@ -1,334 +0,0 @@ -// 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 = "2021-12-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 = "2021-12-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 - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a List of logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a List of logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 55a9e2825b55..000000000000 --- 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 Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - private LogFilesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.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 1c4c5ba62488..0f84991d791d 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 @@ -18,12 +18,12 @@ @ServiceClientBuilder(serviceClients = {MySqlManagementClientImpl.class}) public final class MySqlManagementClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @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 d342a6137625..39d9bb5fbbcd 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 @@ -22,22 +22,9 @@ 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.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; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient; -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.LogFilesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; -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.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -50,11 +37,11 @@ /** Initializes a new instance of the MySqlManagementClientImpl type. */ @ServiceClient(builder = MySqlManagementClientBuilder.class) public final class MySqlManagementClientImpl implements MySqlManagementClient { - /** The ID of the target subscription. */ + /** The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -74,6 +61,18 @@ public String getEndpoint() { return this.endpoint; } + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -110,184 +109,28 @@ 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 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. */ - private final ServersClient servers; - - /** - * Gets the ServersClient object to access its operations. - * - * @return the ServersClient object. - */ - public ServersClient getServers() { - return this.servers; - } - - /** The ReplicasClient object to access its operations. */ - private final ReplicasClient replicas; - - /** - * Gets the ReplicasClient object to access its operations. - * - * @return the ReplicasClient object. - */ - public ReplicasClient getReplicas() { - return this.replicas; - } - - /** The LogFilesClient object to access its operations. */ - private final LogFilesClient logFiles; - - /** - * Gets the LogFilesClient object to access its operations. - * - * @return the LogFilesClient object. - */ - public LogFilesClient getLogFiles() { - return this.logFiles; - } - - /** The LocationBasedCapabilitiesClient object to access its operations. */ - private final LocationBasedCapabilitiesClient locationBasedCapabilities; - - /** - * Gets the LocationBasedCapabilitiesClient object to access its operations. - * - * @return the LocationBasedCapabilitiesClient object. - */ - public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { - return this.locationBasedCapabilities; - } - - /** The CheckVirtualNetworkSubnetUsagesClient object to access its operations. */ - private final CheckVirtualNetworkSubnetUsagesClient checkVirtualNetworkSubnetUsages; - - /** - * Gets the CheckVirtualNetworkSubnetUsagesClient object to access its operations. - * - * @return the CheckVirtualNetworkSubnetUsagesClient object. - */ - public CheckVirtualNetworkSubnetUsagesClient getCheckVirtualNetworkSubnetUsages() { - return this.checkVirtualNetworkSubnetUsages; - } - - /** The CheckNameAvailabilitiesClient object to access its operations. */ - private final CheckNameAvailabilitiesClient checkNameAvailabilities; - - /** - * Gets the CheckNameAvailabilitiesClient object to access its operations. - * - * @return the CheckNameAvailabilitiesClient object. - */ - public CheckNameAvailabilitiesClient getCheckNameAvailabilities() { - return this.checkNameAvailabilities; - } - - /** The CheckNameAvailabilityWithoutLocationsClient object to access its operations. */ - private final CheckNameAvailabilityWithoutLocationsClient checkNameAvailabilityWithoutLocations; - - /** - * Gets the CheckNameAvailabilityWithoutLocationsClient object to access its operations. - * - * @return the CheckNameAvailabilityWithoutLocationsClient object. - */ - public CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWithoutLocations() { - return this.checkNameAvailabilityWithoutLocations; - } - - /** The GetPrivateDnsZoneSuffixesClient object to access its operations. */ - private final GetPrivateDnsZoneSuffixesClient getPrivateDnsZoneSuffixes; + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; /** - * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the GetPrivateDnsZoneSuffixesClient object. + * @return the PrivateEndpointConnectionsClient object. */ - public GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes() { - return this.getPrivateDnsZoneSuffixes; + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; /** - * Gets the OperationsClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the OperationsClient object. + * @return the PrivateLinkResourcesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; } /** @@ -297,7 +140,7 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ MySqlManagementClientImpl( @@ -312,21 +155,9 @@ public OperationsClient getOperations() { 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.configurations = new ConfigurationsClientImpl(this); - this.databases = new DatabasesClientImpl(this); - this.firewallRules = new FirewallRulesClientImpl(this); - this.servers = new ServersClientImpl(this); - this.replicas = new ReplicasClientImpl(this); - this.logFiles = new LogFilesClientImpl(this); - this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); - this.checkVirtualNetworkSubnetUsages = new CheckVirtualNetworkSubnetUsagesClientImpl(this); - this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); - this.checkNameAvailabilityWithoutLocations = new CheckNameAvailabilityWithoutLocationsClientImpl(this); - this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.apiVersion = "2023-06-30"; + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/NameAvailabilityImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/NameAvailabilityImpl.java deleted file mode 100644 index 78ed91968815..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/NameAvailabilityImpl.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.NameAvailabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; - -public final class NameAvailabilityImpl implements NameAvailability { - private NameAvailabilityInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - NameAvailabilityImpl( - NameAvailabilityInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String message() { - return this.innerModel().message(); - } - - public Boolean nameAvailable() { - return this.innerModel().nameAvailable(); - } - - public String reason() { - return this.innerModel().reason(); - } - - public NameAvailabilityInner 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/OperationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationImpl.java deleted file mode 100644 index 853509cd0b7b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationImpl.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.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Operation; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import java.util.Collections; -import java.util.Map; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - OperationImpl( - OperationInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public String origin() { - return this.innerModel().origin(); - } - - public Map properties() { - Map inner = this.innerModel().properties(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public OperationInner 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 deleted file mode 100644 index 0421db5b1224..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.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.OperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(MySqlManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.DBforMySQL/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), 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())); - } - - /** - * Lists all of the available REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2021-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations 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 - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations 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/OperationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsImpl.java deleted file mode 100644 index 3d57c6ae64e4..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsImpl.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.OperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Operation; -import com.azure.resourcemanager.mysqlflexibleserver.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient 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/PrivateEndpointConnectionImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..64e82f25040d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner 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 List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serverName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, serverName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, serverName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, serverName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, serverName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 000000000000..275435b04ee5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,48 @@ +// 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.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { + private PrivateEndpointConnectionListResultInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + PrivateEndpointConnectionListResultImpl( + PrivateEndpointConnectionListResultInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionListResultInner 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/FirewallRulesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java similarity index 64% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java index df8ca09c2ece..4e6a2a68fb30 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/PrivateEndpointConnectionsClientImpl.java @@ -19,10 +19,6 @@ 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; @@ -31,137 +27,290 @@ 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.FirewallRulesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRuleListResult; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ -public final class FirewallRulesClientImpl implements FirewallRulesClient { +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { /** The proxy service used to perform REST calls. */ - private final FirewallRulesService service; + private final PrivateEndpointConnectionsService service; /** The service client containing this operation class. */ private final MySqlManagementClientImpl client; /** - * Initializes an instance of FirewallRulesClientImpl. + * Initializes an instance of PrivateEndpointConnectionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - FirewallRulesClientImpl(MySqlManagementClientImpl client) { + PrivateEndpointConnectionsClientImpl(MySqlManagementClientImpl client) { this.service = - RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MySqlManagementClientFirewallRules to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for MySqlManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") - public interface FirewallRulesService { + public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") - @ExpectedResponses({200, 201, 202}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( + Mono> get( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("firewallRuleName") String firewallRuleName, - @BodyParam("application/json") FirewallRuleInner parameters, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") - @ExpectedResponses({200, 202, 204}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("firewallRuleName") String firewallRuleName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono>> delete( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("firewallRuleName") String firewallRuleName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( + Mono> listByServer( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @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> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 firewall rule along with {@link Response} on successful completion of {@link Mono}. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String privateEndpointConnectionName, 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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.")); @@ -169,16 +318,23 @@ private Mono>> createOrUpdateWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (firewallRuleName == null) { + if (privateEndpointConnectionName == null) { return Mono - .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -186,11 +342,11 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, - firewallRuleName, + privateEndpointConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), parameters, accept, context)) @@ -198,24 +354,25 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule along with {@link Response} on successful completion of {@link Mono}. + * @return the private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String serverName, - String firewallRuleName, - FirewallRuleInner parameters, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -223,12 +380,6 @@ private Mono>> createOrUpdateWithResponseAsync( 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.")); @@ -236,224 +387,252 @@ private Mono>> createOrUpdateWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (firewallRuleName == null) { + if (privateEndpointConnectionName == null) { return Mono - .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 = "2021-12-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, + privateEndpointConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), parameters, accept, context); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a server firewall rule. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FirewallRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters); + createOrUpdateWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters); return this .client - .getLroResult( + .getLroResult( mono, this.client.getHttpPipeline(), - FirewallRuleInner.class, - FirewallRuleInner.class, + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, this.client.getContext()); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a server firewall rule. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FirewallRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - String firewallRuleName, - FirewallRuleInner parameters, - Context context) { + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters, context); + createOrUpdateWithResponseAsync( + resourceGroupName, serverName, privateEndpointConnectionName, parameters, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), FirewallRuleInner.class, FirewallRuleInner.class, context); + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a server firewall rule. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FirewallRuleInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { return this - .beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters) + .beginCreateOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters) .getSyncPoller(); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a server firewall rule. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FirewallRuleInner> beginCreateOrUpdate( + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String serverName, - String firewallRuleName, - FirewallRuleInner parameters, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context) { return this - .beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters, context) + .beginCreateOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) .getSyncPoller(); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule on successful completion of {@link Mono}. + * @return the private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule on successful completion of {@link Mono}. + * @return the private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( + private Mono createOrUpdateAsync( String resourceGroupName, String serverName, - String firewallRuleName, - FirewallRuleInner parameters, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters, context) + return beginCreateOrUpdateAsync( + resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule. + * @return the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FirewallRuleInner createOrUpdate( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).block(); + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).block(); } /** - * Creates a new firewall rule or updates an existing firewall rule. + * Approve or reject a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param parameters The required parameters for creating or updating a firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param parameters The private endpoint connection resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server firewall rule. + * @return the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FirewallRuleInner createOrUpdate( + public PrivateEndpointConnectionInner createOrUpdate( String resourceGroupName, String serverName, - String firewallRuleName, - FirewallRuleInner parameters, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters, context).block(); + return createOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) + .block(); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -461,19 +640,13 @@ public FirewallRuleInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, String firewallRuleName) { + String resourceGroupName, String serverName, String privateEndpointConnectionName) { 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.")); @@ -481,11 +654,18 @@ private Mono>> deleteWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (firewallRuleName == null) { + if (privateEndpointConnectionName == null) { return Mono - .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -493,22 +673,22 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, - firewallRuleName, + privateEndpointConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -517,19 +697,13 @@ private Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { + String resourceGroupName, String serverName, String privateEndpointConnectionName, 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.")); @@ -537,31 +711,38 @@ private Mono>> deleteWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (firewallRuleName == null) { + if (privateEndpointConnectionName == null) { return Mono - .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 = "2021-12-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, + privateEndpointConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -569,9 +750,9 @@ private Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, String firewallRuleName) { + String resourceGroupName, String serverName, String privateEndpointConnectionName) { Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, firewallRuleName); + deleteWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName); return this .client .getLroResult( @@ -579,11 +760,11 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -592,21 +773,21 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, firewallRuleName, context); + deleteWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -614,16 +795,16 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String firewallRuleName) { - return this.beginDeleteAsync(resourceGroupName, serverName, firewallRuleName).getSyncPoller(); + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return this.beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName).getSyncPoller(); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -632,34 +813,36 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { - return this.beginDeleteAsync(resourceGroupName, serverName, firewallRuleName, context).getSyncPoller(); + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context) + .getSyncPoller(); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { - return beginDeleteAsync(resourceGroupName, serverName, firewallRuleName) + private Mono deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -668,127 +851,64 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, firewallRuleName, context) + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, String firewallRuleName) { - deleteAsync(resourceGroupName, serverName, firewallRuleName).block(); + public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, serverName, privateEndpointConnectionName).block(); } /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context) { - deleteAsync(resourceGroupName, serverName, firewallRuleName, context).block(); - } - - /** - * Gets information about a server firewall rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String firewallRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (firewallRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-12-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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public void delete( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).block(); } /** - * Gets information about a server firewall rule. + * Gets all private endpoint connections on a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule along with {@link Response} on successful completion of {@link - * Mono}. + * @return all private endpoint connections on a server along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { + private Mono> listByServerWithResponseAsync( + 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.")); @@ -796,109 +916,12 @@ private Mono> getWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (firewallRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); - } - final String apiVersion = "2021-12-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); - } - - /** - * Gets information about a server firewall rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String firewallRuleName) { - return getWithResponseAsync(resourceGroupName, serverName, firewallRuleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about a server firewall rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String firewallRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, firewallRuleName, context).block(); - } - - /** - * Gets information about a server firewall rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName) { - return getWithResponse(resourceGroupName, serverName, firewallRuleName, Context.NONE).getValue(); - } - - /** - * List all the firewall rules 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 firewall rules 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 = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -906,26 +929,17 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -933,10 +947,11 @@ private Mono> listByServerSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of firewall rules along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all private endpoint connections on a server along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( + private Mono> listByServerWithResponseAsync( String resourceGroupName, String serverName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -944,12 +959,6 @@ private Mono> listByServerSinglePageAsync( 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.")); @@ -957,48 +966,44 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2021-12-01-preview"; + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a 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 firewall rules as paginated response with {@link PagedFlux}. + * @return all private endpoint connections on a server on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServerAsync( + String resourceGroupName, String serverName) { + return listByServerWithResponseAsync(resourceGroupName, serverName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -1006,117 +1011,26 @@ private PagedFlux listByServerAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of firewall rules as paginated response with {@link PagedFlux}. + * @return all private endpoint connections on a server along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync( + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServerWithResponse( String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + return listByServerWithResponseAsync(resourceGroupName, serverName, context).block(); } /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a 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 firewall rules 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 firewall rules 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 firewall rules as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of firewall rules along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of firewall rules along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all private endpoint connections on a server. */ @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)); + public PrivateEndpointConnectionListResultInner listByServer(String resourceGroupName, String serverName) { + return listByServerWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); } } 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/PrivateEndpointConnectionsImpl.java similarity index 54% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java index 5055e5c2c409..9d3483ac5b6b 100644 --- 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/PrivateEndpointConnectionsImpl.java @@ -4,78 +4,92 @@ 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; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnections; -public final class AzureADAdministratorsImpl implements AzureADAdministrators { - private static final ClientLogger LOGGER = new ClientLogger(AzureADAdministratorsImpl.class); +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); - private final AzureADAdministratorsClient innerClient; + private final PrivateEndpointConnectionsClient innerClient; private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - public AzureADAdministratorsImpl( - AzureADAdministratorsClient innerClient, + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient 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); + public Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureADAdministratorImpl(inner.getValue(), this.manager())); + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } else { return null; } } - public AzureADAdministrator get(String resourceGroupName, String serverName, AdministratorName administratorName) { - AzureADAdministratorInner inner = this.serviceClient().get(resourceGroupName, serverName, administratorName); + public PrivateEndpointConnection get( + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, serverName, privateEndpointConnectionName); if (inner != null) { - return new AzureADAdministratorImpl(inner, this.manager()); + return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { return null; } } - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, serverName, privateEndpointConnectionName); } - public PagedIterable listByServer( + public void delete( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, serverName, privateEndpointConnectionName, context); + } + + public Response listByServerWithResponse( String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); + Response inner = + this.serviceClient().listByServerWithResponse(resourceGroupName, serverName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnectionListResult listByServer(String resourceGroupName, String serverName) { + PrivateEndpointConnectionListResultInner inner = + this.serviceClient().listByServer(resourceGroupName, serverName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } } - public AzureADAdministrator getById(String id) { + public PrivateEndpointConnection getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -92,19 +106,22 @@ public AzureADAdministrator getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } - String administratorNameLocal = Utils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( String - .format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - return this.getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE).getValue(); + return this + .getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE) + .getValue(); } - public Response getByIdWithResponse(String id, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -121,16 +138,17 @@ public Response getByIdWithResponse(String id, Context con String .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } - String administratorNameLocal = Utils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( String - .format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - return this.getWithResponse(resourceGroupName, serverName, administratorName, context); + return this.getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context); } public void deleteById(String id) { @@ -150,16 +168,17 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } - String administratorNameLocal = Utils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( String - .format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - this.delete(resourceGroupName, serverName, administratorName, Context.NONE); + this.delete(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -179,19 +198,20 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } - String administratorNameLocal = Utils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( String - .format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - this.delete(resourceGroupName, serverName, administratorName, context); + this.delete(resourceGroupName, serverName, privateEndpointConnectionName, context); } - private AzureADAdministratorsClient serviceClient() { + private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } @@ -199,7 +219,7 @@ private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } - public AzureADAdministratorImpl define(AdministratorName name) { - return new AzureADAdministratorImpl(name, this.manager()); + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityPropertiesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceImpl.java similarity index 50% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityPropertiesImpl.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceImpl.java index 65bd56073caf..3c6f50965553 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityPropertiesImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceImpl.java @@ -4,39 +4,46 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilityProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapability; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; import java.util.Collections; import java.util.List; -public final class CapabilityPropertiesImpl implements CapabilityProperties { - private CapabilityPropertiesInner innerObject; +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - CapabilityPropertiesImpl( - CapabilityPropertiesInner innerObject, + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String zone() { - return this.innerModel().zone(); + public String id() { + return this.innerModel().id(); } - public List supportedHAMode() { - List inner = this.innerModel().supportedHAMode(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); } - public List supportedGeoBackupRegions() { - List inner = this.innerModel().supportedGeoBackupRegions(); + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -44,8 +51,8 @@ public List supportedGeoBackupRegions() { } } - public List supportedFlexibleServerEditions() { - List inner = this.innerModel().supportedFlexibleServerEditions(); + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -53,7 +60,7 @@ public List supportedFlexibleServerEditions() { } } - public CapabilityPropertiesInner innerModel() { + public PrivateLinkResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationListResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceListResultImpl.java similarity index 61% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationListResultImpl.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceListResultImpl.java index e6ada232e096..35b5d6a76555 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationListResultImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceListResultImpl.java @@ -4,45 +4,41 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceListResult; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -public final class ConfigurationListResultImpl implements ConfigurationListResult { - private ConfigurationListResultInner innerObject; +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - ConfigurationListResultImpl( - ConfigurationListResultInner innerObject, + PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections .unmodifiableList( inner .stream() - .map(inner1 -> new ConfigurationImpl(inner1, this.manager())) + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) .collect(Collectors.toList())); } else { return Collections.emptyList(); } } - public String nextLink() { - return this.innerModel().nextLink(); - } - - public ConfigurationListResultInner innerModel() { + public PrivateLinkResourceListResultInner innerModel() { return this.innerObject; } 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/PrivateLinkResourcesClientImpl.java similarity index 52% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java index ca2ddd3f5ef8..749e5a55b42f 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/PrivateLinkResourcesClientImpl.java @@ -16,94 +16,92 @@ 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.ReplicasClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerListResult; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ReplicasClient. */ -public final class ReplicasClientImpl implements ReplicasClient { +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { /** The proxy service used to perform REST calls. */ - private final ReplicasService service; + private final PrivateLinkResourcesService service; /** The service client containing this operation class. */ private final MySqlManagementClientImpl client; /** - * Initializes an instance of ReplicasClientImpl. + * Initializes an instance of PrivateLinkResourcesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ReplicasClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(ReplicasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + PrivateLinkResourcesClientImpl(MySqlManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MySqlManagementClientReplicas to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for MySqlManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") - public interface ReplicasService { + public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/replicas") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( + Mono> listByServer( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @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}") + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources/{groupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + Mono> get( @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("groupName") String groupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * List all the replicas for a given server. + * Lists the private link resources for MySQL 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 servers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of private link resources along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { + private Mono> listByServerWithResponseAsync( + 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.")); @@ -111,7 +109,12 @@ private Mono> listByServerSinglePageAsync(String reso if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2022-09-30-preview"; + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -119,26 +122,17 @@ private Mono> listByServerSinglePageAsync(String reso service .listByServer( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the replicas for a given server. + * Lists the private link resources for MySQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -146,10 +140,10 @@ private Mono> listByServerSinglePageAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of private link resources along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( + private Mono> listByServerWithResponseAsync( String resourceGroupName, String serverName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -157,12 +151,6 @@ private Mono> listByServerSinglePageAsync( 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.")); @@ -170,48 +158,43 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2022-09-30-preview"; + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * List all the replicas for a given server. + * Lists the private link resources for MySQL 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 servers as paginated response with {@link PagedFlux}. + * @return a list of private link resources on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithResponseAsync(resourceGroupName, serverName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all the replicas for a given server. + * Lists the private link resources for MySQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -219,116 +202,183 @@ private PagedFlux listByServerAsync(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedFlux}. + * @return a list of private link resources along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServerWithResponse( + String resourceGroupName, String serverName, Context context) { + return listByServerWithResponseAsync(resourceGroupName, serverName, context).block(); } /** - * List all the replicas for a given server. + * Lists the private link resources for MySQL 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 servers as paginated response with {@link PagedIterable}. + * @return a list of private link resources. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByServer(String resourceGroupName, String serverName) { + return listByServerWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); } /** - * List all the replicas for a given server. + * Gets a private link resource for MySQL 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 servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a private link resource for MySQL server along with {@link Response} 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.")); - } + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String groupName) { 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; 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)) + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serverName, + groupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the next page of items. + * Gets a private link resource for MySQL server. * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a private link resource for MySQL server along with {@link Response} 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.")); - } + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String groupName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .get( + this.client.getEndpoint(), + resourceGroupName, + serverName, + groupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a private link resource for MySQL server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource for MySQL server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serverName, String groupName) { + return getWithResponseAsync(resourceGroupName, serverName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private link resource for MySQL server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource for MySQL server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, groupName, context).block(); + } + + /** + * Gets a private link resource for MySQL server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource for MySQL server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String serverName, String groupName) { + return getWithResponse(resourceGroupName, serverName, groupName, Context.NONE).getValue(); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..c55fabeb0317 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,87 @@ +// 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.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listByServerWithResponse( + String resourceGroupName, String serverName, Context context) { + Response inner = + this.serviceClient().listByServerWithResponse(resourceGroupName, serverName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResourceListResult listByServer(String resourceGroupName, String serverName) { + PrivateLinkResourceListResultInner inner = this.serviceClient().listByServer(resourceGroupName, serverName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serverName, String groupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serverName, groupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResource get(String resourceGroupName, String serverName, String groupName) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, serverName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient 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/ReplicasImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasImpl.java deleted file mode 100644 index 76edbc7113be..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasImpl.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.ReplicasClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Replicas; -import com.azure.resourcemanager.mysqlflexibleserver.models.Server; - -public final class ReplicasImpl implements Replicas { - private static final ClientLogger LOGGER = new ClientLogger(ReplicasImpl.class); - - private final ReplicasClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public ReplicasImpl( - ReplicasClient 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 Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - private ReplicasClient 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/ServerBackupImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupImpl.java deleted file mode 100644 index ca699a09753b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.ServerBackupInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.time.OffsetDateTime; - -public final class ServerBackupImpl implements ServerBackup { - private ServerBackupInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - ServerBackupImpl( - ServerBackupInner 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 backupType() { - return this.innerModel().backupType(); - } - - public OffsetDateTime completedTime() { - return this.innerModel().completedTime(); - } - - public String source() { - return this.innerModel().source(); - } - - public ServerBackupInner 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/ServerImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java deleted file mode 100644 index 6a239ccf4957..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java +++ /dev/null @@ -1,439 +0,0 @@ -// 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.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -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.Identity; -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.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.Map; - -public final class ServerImpl implements Server, Server.Definition, Server.Update { - private ServerInner 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 String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String administratorLogin() { - return this.innerModel().administratorLogin(); - } - - public String administratorLoginPassword() { - return this.innerModel().administratorLoginPassword(); - } - - public ServerVersion version() { - return this.innerModel().version(); - } - - public String availabilityZone() { - return this.innerModel().availabilityZone(); - } - - public CreateMode createMode() { - return this.innerModel().createMode(); - } - - public String sourceServerResourceId() { - return this.innerModel().sourceServerResourceId(); - } - - public OffsetDateTime restorePointInTime() { - return this.innerModel().restorePointInTime(); - } - - public ReplicationRole replicationRole() { - return this.innerModel().replicationRole(); - } - - public Integer replicaCapacity() { - return this.innerModel().replicaCapacity(); - } - - public DataEncryption dataEncryption() { - return this.innerModel().dataEncryption(); - } - - public ServerState state() { - return this.innerModel().state(); - } - - public String fullyQualifiedDomainName() { - return this.innerModel().fullyQualifiedDomainName(); - } - - public Storage storage() { - return this.innerModel().storage(); - } - - public Backup backup() { - return this.innerModel().backup(); - } - - public HighAvailability highAvailability() { - return this.innerModel().highAvailability(); - } - - public Network network() { - return this.innerModel().network(); - } - - public MaintenanceWindow maintenanceWindow() { - return this.innerModel().maintenanceWindow(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ServerInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private ServerForUpdate updateParameters; - - public ServerImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Server create() { - this.innerObject = - serviceManager - .serviceClient() - .getServers() - .create(resourceGroupName, serverName, this.innerModel(), Context.NONE); - return this; - } - - public Server create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServers() - .create(resourceGroupName, serverName, this.innerModel(), context); - return this; - } - - ServerImpl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new ServerInner(); - this.serviceManager = serviceManager; - this.serverName = name; - } - - public ServerImpl update() { - this.updateParameters = new ServerForUpdate(); - return this; - } - - public Server apply() { - this.innerObject = - serviceManager - .serviceClient() - .getServers() - .update(resourceGroupName, serverName, updateParameters, Context.NONE); - return this; - } - - public Server apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServers() - .update(resourceGroupName, serverName, updateParameters, context); - return this; - } - - ServerImpl(ServerInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - } - - public Server refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getServers() - .getByResourceGroupWithResponse(resourceGroupName, serverName, Context.NONE) - .getValue(); - return this; - } - - public Server refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServers() - .getByResourceGroupWithResponse(resourceGroupName, serverName, context) - .getValue(); - return this; - } - - public void failover() { - serviceManager.servers().failover(resourceGroupName, serverName); - } - - public void failover(Context context) { - serviceManager.servers().failover(resourceGroupName, serverName, context); - } - - public void restart(ServerRestartParameter parameters) { - serviceManager.servers().restart(resourceGroupName, serverName, parameters); - } - - public void restart(ServerRestartParameter parameters, Context context) { - serviceManager.servers().restart(resourceGroupName, serverName, parameters, context); - } - - public void start() { - serviceManager.servers().start(resourceGroupName, serverName); - } - - public void start(Context context) { - serviceManager.servers().start(resourceGroupName, serverName, context); - } - - public void stop() { - serviceManager.servers().stop(resourceGroupName, serverName); - } - - 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; - } - - public ServerImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ServerImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateParameters.withTags(tags); - return this; - } - } - - public ServerImpl withIdentity(Identity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateParameters.withIdentity(identity); - return this; - } - } - - public ServerImpl withSku(Sku sku) { - if (isInCreateMode()) { - this.innerModel().withSku(sku); - return this; - } else { - this.updateParameters.withSku(sku); - return this; - } - } - - public ServerImpl withAdministratorLogin(String administratorLogin) { - this.innerModel().withAdministratorLogin(administratorLogin); - return this; - } - - public ServerImpl withAdministratorLoginPassword(String administratorLoginPassword) { - if (isInCreateMode()) { - this.innerModel().withAdministratorLoginPassword(administratorLoginPassword); - return this; - } else { - this.updateParameters.withAdministratorLoginPassword(administratorLoginPassword); - return this; - } - } - - public ServerImpl withVersion(ServerVersion version) { - if (isInCreateMode()) { - this.innerModel().withVersion(version); - return this; - } else { - this.updateParameters.withVersion(version); - return this; - } - } - - public ServerImpl withAvailabilityZone(String availabilityZone) { - this.innerModel().withAvailabilityZone(availabilityZone); - return this; - } - - public ServerImpl withCreateMode(CreateMode createMode) { - this.innerModel().withCreateMode(createMode); - return this; - } - - public ServerImpl withSourceServerResourceId(String sourceServerResourceId) { - this.innerModel().withSourceServerResourceId(sourceServerResourceId); - return this; - } - - public ServerImpl withRestorePointInTime(OffsetDateTime restorePointInTime) { - this.innerModel().withRestorePointInTime(restorePointInTime); - return this; - } - - public ServerImpl withReplicationRole(ReplicationRole replicationRole) { - if (isInCreateMode()) { - this.innerModel().withReplicationRole(replicationRole); - return this; - } else { - this.updateParameters.withReplicationRole(replicationRole); - return this; - } - } - - public ServerImpl withDataEncryption(DataEncryption dataEncryption) { - if (isInCreateMode()) { - this.innerModel().withDataEncryption(dataEncryption); - return this; - } else { - this.updateParameters.withDataEncryption(dataEncryption); - return this; - } - } - - public ServerImpl withStorage(Storage storage) { - if (isInCreateMode()) { - this.innerModel().withStorage(storage); - return this; - } else { - this.updateParameters.withStorage(storage); - return this; - } - } - - public ServerImpl withBackup(Backup backup) { - if (isInCreateMode()) { - this.innerModel().withBackup(backup); - return this; - } else { - this.updateParameters.withBackup(backup); - return this; - } - } - - public ServerImpl withHighAvailability(HighAvailability highAvailability) { - if (isInCreateMode()) { - this.innerModel().withHighAvailability(highAvailability); - return this; - } else { - this.updateParameters.withHighAvailability(highAvailability); - return this; - } - } - - public ServerImpl withNetwork(Network network) { - if (isInCreateMode()) { - this.innerModel().withNetwork(network); - return this; - } else { - this.updateParameters.withNetwork(network); - return this; - } - } - - public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { - this.updateParameters.withMaintenanceWindow(maintenanceWindow); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} 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 deleted file mode 100644 index 170838e9d66a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java +++ /dev/null @@ -1,2798 +0,0 @@ -// 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.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; -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.ServersClient; -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; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServersClient. */ -public final class ServersClientImpl implements ServersClient { - /** The proxy service used to perform REST calls. */ - private final ServersService service; - - /** The service client containing this operation class. */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of ServersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServersClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(ServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientServers to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface ServersService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") - @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, - @BodyParam("application/json") ServerInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") - @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, - @BodyParam("application/json") ServerForUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") - @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, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @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( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/flexibleServers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/failover") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> failover( - @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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerRestartParameter parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @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"}) - @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}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String serverName, ServerInner 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 = "2022-09-30-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())); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String serverName, ServerInner 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 = "2022-09-30-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); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginCreateAsync( - String resourceGroupName, String serverName, ServerInner parameters) { - Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ServerInner.class, ServerInner.class, this.client.getContext()); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginCreateAsync( - String resourceGroupName, String serverName, ServerInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ServerInner.class, ServerInner.class, context); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerInner parameters) { - return this.beginCreateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerInner parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, ServerInner parameters) { - return beginCreateAsync(resourceGroupName, serverName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String serverName, ServerInner parameters, Context context) { - return beginCreateAsync(resourceGroupName, serverName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner create(String resourceGroupName, String serverName, ServerInner parameters) { - return createAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Creates a new server or updates an existing server. The update action will overwrite the existing 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 creating or updating 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 server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner create(String resourceGroupName, String serverName, ServerInner parameters, Context context) { - return createAsync(resourceGroupName, serverName, parameters, context).block(); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String serverName, ServerForUpdate 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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String serverName, ServerForUpdate 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 = "2022-09-30-preview"; - 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); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginUpdateAsync( - String resourceGroupName, String serverName, ServerForUpdate parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, serverName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ServerInner.class, ServerInner.class, this.client.getContext()); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginUpdateAsync( - String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ServerInner.class, ServerInner.class, context); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerForUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, ServerForUpdate parameters) { - return beginUpdateAsync(resourceGroupName, serverName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, serverName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters) { - return updateAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Updates an existing server. The request body can contain one to many of the properties present in the normal - * server definition. - * - * @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 updating 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 server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner update( - String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { - return updateAsync(resourceGroupName, serverName, parameters, context).block(); - } - - /** - * Deletes a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - 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 = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Deletes a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName) { - return this.beginDeleteAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Deletes a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, Context context) { - return this.beginDeleteAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Deletes a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName) { - return beginDeleteAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName) { - deleteAsync(resourceGroupName, serverName).block(); - } - - /** - * Deletes a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, Context context) { - deleteAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Gets information about a 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 information about a server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - 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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a 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 information about a server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - 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 = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Gets information about a 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 information about a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String serverName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, serverName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about a 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 information about a server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String serverName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Gets information about a 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 information about a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner getByResourceGroup(String resourceGroupName, String serverName) { - return getByResourceGroupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); - } - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List all the servers in a given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, 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())); - } - - /** - * List all the servers in a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the servers in a given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the servers in a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the servers in a given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all the servers in a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Manual failover a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> failoverWithResponseAsync(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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .failover( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Manual failover a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> failoverWithResponseAsync( - 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 = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .failover( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Manual failover a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String serverName) { - Mono>> mono = failoverWithResponseAsync(resourceGroupName, serverName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Manual failover a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginFailoverAsync( - String resourceGroupName, String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = failoverWithResponseAsync(resourceGroupName, serverName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Manual failover a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginFailover(String resourceGroupName, String serverName) { - return this.beginFailoverAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Manual failover a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginFailover( - String resourceGroupName, String serverName, Context context) { - return this.beginFailoverAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Manual failover a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono failoverAsync(String resourceGroupName, String serverName) { - return beginFailoverAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Manual failover a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono failoverAsync(String resourceGroupName, String serverName, Context context) { - return beginFailoverAsync(resourceGroupName, serverName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Manual failover a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void failover(String resourceGroupName, String serverName) { - failoverAsync(resourceGroupName, serverName).block(); - } - - /** - * Manual failover a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void failover(String resourceGroupName, String serverName, Context context) { - failoverAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Restarts 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 restarting 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>> restartWithResponseAsync( - String resourceGroupName, String serverName, ServerRestartParameter 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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts 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 restarting 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>> restartWithResponseAsync( - String resourceGroupName, String serverName, ServerRestartParameter 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 = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - parameters, - accept, - context); - } - - /** - * Restarts 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 restarting 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> beginRestartAsync( - String resourceGroupName, String serverName, ServerRestartParameter parameters) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, serverName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restarts 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 restarting 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> beginRestartAsync( - String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restarts 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 restarting 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> beginRestart( - String resourceGroupName, String serverName, ServerRestartParameter parameters) { - return this.beginRestartAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Restarts 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 restarting 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> beginRestart( - String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context) { - return this.beginRestartAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Restarts 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 restarting 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 restartAsync(String resourceGroupName, String serverName, ServerRestartParameter parameters) { - return beginRestartAsync(resourceGroupName, serverName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts 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 restarting 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 restartAsync( - String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context) { - return beginRestartAsync(resourceGroupName, serverName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts 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 restarting 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 restart(String resourceGroupName, String serverName, ServerRestartParameter parameters) { - restartAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Restarts 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 restarting 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 restart( - String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context) { - restartAsync(resourceGroupName, serverName, parameters, context).block(); - } - - /** - * Starts a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - 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 = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Starts a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String serverName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, serverName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, serverName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String serverName) { - return this.beginStartAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Starts a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String serverName, Context context) { - return this.beginStartAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Starts a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String serverName) { - return beginStartAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String serverName, Context context) { - return beginStartAsync(resourceGroupName, serverName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String serverName) { - startAsync(resourceGroupName, serverName).block(); - } - - /** - * Starts a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String serverName, Context context) { - startAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Stops a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync(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 = "2022-09-30-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops a 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - 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 = "2022-09-30-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Stops a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync(String resourceGroupName, String serverName) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, serverName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Stops a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = stopWithResponseAsync(resourceGroupName, serverName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop(String resourceGroupName, String serverName) { - return this.beginStopAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Stops a 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop(String resourceGroupName, String serverName, Context context) { - return this.beginStopAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Stops a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String serverName) { - return beginStopAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String serverName, Context context) { - return beginStopAsync(resourceGroupName, serverName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String serverName) { - stopAsync(resourceGroupName, serverName).block(); - } - - /** - * Stops a 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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 = "2022-09-30-preview"; - 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 = "2022-09-30-preview"; - 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. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers 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 - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers 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/ServersImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java deleted file mode 100644 index 66d4598822e7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.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.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.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -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; - -public final class ServersImpl implements Servers { - private static final ClientLogger LOGGER = new ClientLogger(ServersImpl.class); - - private final ServersClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public ServersImpl( - ServersClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void deleteByResourceGroup(String resourceGroupName, String serverName) { - this.serviceClient().delete(resourceGroupName, serverName); - } - - public void delete(String resourceGroupName, String serverName, Context context) { - this.serviceClient().delete(resourceGroupName, serverName, context); - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String serverName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, serverName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Server getByResourceGroup(String resourceGroupName, String serverName) { - ServerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, serverName); - if (inner != null) { - return new ServerImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - public void failover(String resourceGroupName, String serverName) { - this.serviceClient().failover(resourceGroupName, serverName); - } - - public void failover(String resourceGroupName, String serverName, Context context) { - this.serviceClient().failover(resourceGroupName, serverName, context); - } - - public void restart(String resourceGroupName, String serverName, ServerRestartParameter parameters) { - this.serviceClient().restart(resourceGroupName, serverName, parameters); - } - - public void restart( - String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context) { - this.serviceClient().restart(resourceGroupName, serverName, parameters, context); - } - - public void start(String resourceGroupName, String serverName) { - this.serviceClient().start(resourceGroupName, serverName); - } - - public void start(String resourceGroupName, String serverName, Context context) { - this.serviceClient().start(resourceGroupName, serverName, context); - } - - public void stop(String resourceGroupName, String serverName) { - this.serviceClient().stop(resourceGroupName, serverName); - } - - 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 = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, serverName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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))); - } - this.delete(resourceGroupName, serverName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.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))); - } - this.delete(resourceGroupName, serverName, context); - } - - private ServersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public ServerImpl define(String name) { - return new ServerImpl(name, this.manager()); - } -} 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 b2892c8a5a95..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.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.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/implementation/VirtualNetworkSubnetUsageResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java deleted file mode 100644 index a87f1cd81aa3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// 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.VirtualNetworkSubnetUsageResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.DelegatedSubnetUsage; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -import java.util.Collections; -import java.util.List; - -public final class VirtualNetworkSubnetUsageResultImpl implements VirtualNetworkSubnetUsageResult { - private VirtualNetworkSubnetUsageResultInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - VirtualNetworkSubnetUsageResultImpl( - VirtualNetworkSubnetUsageResultInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String location() { - return this.innerModel().location(); - } - - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public List delegatedSubnetsUsage() { - List inner = this.innerModel().delegatedSubnetsUsage(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public VirtualNetworkSubnetUsageResultInner 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 2b74b1e180c4..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A List of azure ad administrators. */ -@Fluent -public final class AdministratorListResult { - /* - * The list of azure ad administrator of a server - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - 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()); - } - } -} 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 328edfd99815..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -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. - */ - @JsonCreator - 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 400f1ee8a784..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -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. - */ - @JsonCreator - 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/AzureADAdministrator.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java deleted file mode 100644 index edd1a5c2df80..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.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.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: The system metadata relating to this resource. - * - * @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 047270e33a8c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java +++ /dev/null @@ -1,142 +0,0 @@ -// 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 deleted file mode 100644 index 9656c317b558..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java +++ /dev/null @@ -1,92 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Storage Profile properties of a server. */ -@Fluent -public final class Backup { - /* - * Backup retention days for the server. - */ - @JsonProperty(value = "backupRetentionDays") - private Integer backupRetentionDays; - - /* - * Whether or not geo redundant backup is enabled. - */ - @JsonProperty(value = "geoRedundantBackup") - private EnableStatusEnum geoRedundantBackup; - - /* - * Earliest restore point creation time (ISO8601 format) - */ - @JsonProperty(value = "earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime earliestRestoreDate; - - /** Creates an instance of Backup class. */ - public Backup() { - } - - /** - * Get the backupRetentionDays property: Backup retention days for the server. - * - * @return the backupRetentionDays value. - */ - public Integer backupRetentionDays() { - return this.backupRetentionDays; - } - - /** - * Set the backupRetentionDays property: Backup retention days for the server. - * - * @param backupRetentionDays the backupRetentionDays value to set. - * @return the Backup object itself. - */ - public Backup withBackupRetentionDays(Integer backupRetentionDays) { - this.backupRetentionDays = backupRetentionDays; - return this; - } - - /** - * Get the geoRedundantBackup property: Whether or not geo redundant backup is enabled. - * - * @return the geoRedundantBackup value. - */ - public EnableStatusEnum geoRedundantBackup() { - return this.geoRedundantBackup; - } - - /** - * Set the geoRedundantBackup property: Whether or not geo redundant backup is enabled. - * - * @param geoRedundantBackup the geoRedundantBackup value to set. - * @return the Backup object itself. - */ - public Backup withGeoRedundantBackup(EnableStatusEnum geoRedundantBackup) { - this.geoRedundantBackup = geoRedundantBackup; - return this; - } - - /** - * Get the earliestRestoreDate property: Earliest restore point creation time (ISO8601 format). - * - * @return the earliestRestoreDate value. - */ - public OffsetDateTime earliestRestoreDate() { - return this.earliestRestoreDate; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 e333e601153e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** BackupAndExport API Request. */ -@Fluent -public final class BackupAndExportRequest extends BackupRequestBase { - /* - * Backup Target Store Details - */ - @JsonProperty(value = "targetDetails", required = true) - 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() { - super.validate(); - if (targetDetails() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetDetails in model BackupAndExportRequest")); - } else { - targetDetails().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportRequest.class); -} 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 c07bb27739b4..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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.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 error property: Error Response - * - *

The BackupAndExport operation error response. - * - * @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/BackupFormat.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java deleted file mode 100644 index 187596ecf784..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). */ -public final class BackupFormat extends ExpandableStringEnum { - /** Static value None for BackupFormat. */ - public static final BackupFormat NONE = fromString("None"); - - /** Static value CollatedFormat for BackupFormat. */ - public static final BackupFormat COLLATED_FORMAT = fromString("CollatedFormat"); - - /** - * 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. - */ - @JsonCreator - 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 6449d602d0f8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** BackupRequestBase is the base for all backup request. */ -@Fluent -public class BackupRequestBase { - /* - * Backup Settings - */ - @JsonProperty(value = "backupSettings", required = true) - 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 - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property backupSettings in model BackupRequestBase")); - } else { - backupSettings().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupRequestBase.class); -} 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 42de6bf4329f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Backup Settings. */ -@Fluent -public final class BackupSettings { - /* - * The name of the backup. - */ - @JsonProperty(value = "backupName", required = true) - private String backupName; - - /* - * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE) - */ - @JsonProperty(value = "backupFormat") - 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 - .logExceptionAsError( - new IllegalArgumentException("Missing required property backupName in model BackupSettings")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class); -} 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 87e5313d32db..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Details about the target where the backup content will be stored. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "objectType", - defaultImpl = BackupStoreDetails.class) -@JsonTypeName("BackupStoreDetails") -@JsonSubTypes({@JsonSubTypes.Type(name = "FullBackupStoreDetails", value = FullBackupStoreDetails.class)}) -@Immutable -public class BackupStoreDetails { - /** Creates an instance of BackupStoreDetails class. */ - public BackupStoreDetails() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 360d5cd6031c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.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.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** 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. - * - * @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 getWithResponse( - String resourceGroupName, String serverName, String backupName, Context 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. - * @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 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 listByServer(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 listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitiesListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitiesListResult.java deleted file mode 100644 index 934165d61027..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitiesListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** location capability. */ -@Immutable -public final class CapabilitiesListResult { - /* - * A list of supported capabilities. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of CapabilitiesListResult class. */ - public CapabilitiesListResult() { - } - - /** - * Get the value property: A list of supported capabilities. - * - * @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()); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilityProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilityProperties.java deleted file mode 100644 index 5890e9596215..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilityProperties.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.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import java.util.List; - -/** An immutable client-side representation of CapabilityProperties. */ -public interface CapabilityProperties { - /** - * Gets the zone property: zone name. - * - * @return the zone value. - */ - String zone(); - - /** - * Gets the supportedHAMode property: Supported high availability mode. - * - * @return the supportedHAMode value. - */ - List supportedHAMode(); - - /** - * 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 inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner object. - * - * @return the inner object. - */ - CapabilityPropertiesInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilities.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilities.java deleted file mode 100644 index 65ac26b6caa8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilities.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.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CheckNameAvailabilities. */ -public interface CheckNameAvailabilities { - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response}. - */ - Response executeWithResponse( - String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context); - - /** - * Check the availability of name for server. - * - * @param locationName The name of the location. - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability. - */ - NameAvailability execute(String locationName, NameAvailabilityRequest nameAvailabilityRequest); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilityWithoutLocations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilityWithoutLocations.java deleted file mode 100644 index bb0784b07927..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilityWithoutLocations.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.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CheckNameAvailabilityWithoutLocations. */ -public interface CheckNameAvailabilityWithoutLocations { - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability along with {@link Response}. - */ - Response executeWithResponse(NameAvailabilityRequest nameAvailabilityRequest, Context context); - - /** - * Check the availability of name for server. - * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a resource name availability. - */ - NameAvailability execute(NameAvailabilityRequest nameAvailabilityRequest); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckVirtualNetworkSubnetUsages.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckVirtualNetworkSubnetUsages.java deleted file mode 100644 index cc1d6587d62d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckVirtualNetworkSubnetUsages.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.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CheckVirtualNetworkSubnetUsages. */ -public interface CheckVirtualNetworkSubnetUsages { - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id along with {@link Response}. - */ - Response executeWithResponse( - String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context); - - /** - * Get virtual network subnet usage for a given vNet resource id. - * - * @param locationName The name of the location. - * @param parameters The required parameters for creating or updating 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 virtual network subnet usage for a given vNet resource id. - */ - VirtualNetworkSubnetUsageResult execute(String locationName, VirtualNetworkSubnetUsageParameter parameters); -} 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 deleted file mode 100644 index 77190eb04a65..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java +++ /dev/null @@ -1,275 +0,0 @@ -// 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.ConfigurationInner; - -/** An immutable client-side representation of Configuration. */ -public interface Configuration { - /** - * 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: The system metadata relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the value property: Value of the configuration. - * - * @return the value value. - */ - 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. - * - * @return the description value. - */ - 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. - * - * @return the defaultValue value. - */ - String defaultValue(); - - /** - * Gets the dataType property: Data type of the configuration. - * - * @return the dataType value. - */ - String dataType(); - - /** - * Gets the allowedValues property: Allowed values of the configuration. - * - * @return the allowedValues value. - */ - String allowedValues(); - - /** - * Gets the source property: Source of the configuration. - * - * @return the source value. - */ - ConfigurationSource source(); - - /** - * Gets the isReadOnly property: If is the configuration read only. - * - * @return the isReadOnly value. - */ - IsReadOnly isReadOnly(); - - /** - * Gets the isConfigPendingRestart property: If is the configuration pending restart or not. - * - * @return the isConfigPendingRestart value. - */ - IsConfigPendingRestart isConfigPendingRestart(); - - /** - * Gets the isDynamicConfig property: If is the configuration dynamic. - * - * @return the isDynamicConfig value. - */ - 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/ConfigurationForBatchUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationForBatchUpdate.java deleted file mode 100644 index ee845fca62e6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationForBatchUpdate.java +++ /dev/null @@ -1,115 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationForBatchUpdateProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a Configuration. */ -@Fluent -public final class ConfigurationForBatchUpdate { - /* - * Name of the configuration. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The properties can be updated for a configuration. - */ - @JsonProperty(value = "properties") - private ConfigurationForBatchUpdateProperties innerProperties; - - /** Creates an instance of ConfigurationForBatchUpdate class. */ - public ConfigurationForBatchUpdate() { - } - - /** - * Get the name property: Name of the configuration. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the configuration. - * - * @param name the name value to set. - * @return the ConfigurationForBatchUpdate object itself. - */ - public ConfigurationForBatchUpdate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the innerProperties property: The properties can be updated for a configuration. - * - * @return the innerProperties value. - */ - private ConfigurationForBatchUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the value property: Value of the configuration. - * - * @return the value value. - */ - public String value() { - return this.innerProperties() == null ? null : this.innerProperties().value(); - } - - /** - * Set the value property: Value of the configuration. - * - * @param value the value value to set. - * @return the ConfigurationForBatchUpdate object itself. - */ - public ConfigurationForBatchUpdate withValue(String value) { - if (this.innerProperties() == null) { - this.innerProperties = new ConfigurationForBatchUpdateProperties(); - } - this.innerProperties().withValue(value); - return this; - } - - /** - * Get the source property: Source of the configuration. - * - * @return the source value. - */ - public String source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Source of the configuration. - * - * @param source the source value to set. - * @return the ConfigurationForBatchUpdate object itself. - */ - public ConfigurationForBatchUpdate withSource(String source) { - if (this.innerProperties() == null) { - this.innerProperties = new ConfigurationForBatchUpdateProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/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 deleted file mode 100644 index 2589e230de62..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of server configurations to update. */ -@Fluent -public final class ConfigurationListForBatchUpdate { - /* - * The list of server configurations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Whether to reset all server parameters to default. - */ - @JsonProperty(value = "resetAllToDefault") - private ResetAllToDefault resetAllToDefault; - - /** Creates an instance of ConfigurationListForBatchUpdate class. */ - public ConfigurationListForBatchUpdate() { - } - - /** - * Get the value property: The list of server configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of server configurations. - * - * @param value the value value to set. - * @return the ConfigurationListForBatchUpdate object itself. - */ - public ConfigurationListForBatchUpdate withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the resetAllToDefault property: Whether to reset all server parameters to default. - * - * @return the resetAllToDefault value. - */ - public ResetAllToDefault resetAllToDefault() { - return this.resetAllToDefault; - } - - /** - * Set the resetAllToDefault property: Whether to reset all server parameters to default. - * - * @param resetAllToDefault the resetAllToDefault value to set. - * @return the ConfigurationListForBatchUpdate object itself. - */ - public ConfigurationListForBatchUpdate withResetAllToDefault(ResetAllToDefault resetAllToDefault) { - this.resetAllToDefault = resetAllToDefault; - 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()); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListResult.java deleted file mode 100644 index b8a36ce4790e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListResult.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.models; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import java.util.List; - -/** An immutable client-side representation of ConfigurationListResult. */ -public interface ConfigurationListResult { - /** - * Gets the value property: The list of server configurations. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner object. - * - * @return the inner object. - */ - ConfigurationListResultInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationSource.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationSource.java deleted file mode 100644 index 391ad96bc591..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationSource.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Source of the configuration. */ -public final class ConfigurationSource extends ExpandableStringEnum { - /** Static value system-default for ConfigurationSource. */ - public static final ConfigurationSource SYSTEM_DEFAULT = fromString("system-default"); - - /** Static value user-override for ConfigurationSource. */ - public static final ConfigurationSource USER_OVERRIDE = fromString("user-override"); - - /** - * Creates a new instance of ConfigurationSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConfigurationSource() { - } - - /** - * Creates or finds a ConfigurationSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConfigurationSource. - */ - @JsonCreator - public static ConfigurationSource fromString(String name) { - return fromString(name, ConfigurationSource.class); - } - - /** - * Gets known ConfigurationSource values. - * - * @return known ConfigurationSource values. - */ - public static Collection values() { - return values(ConfigurationSource.class); - } -} 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 deleted file mode 100644 index cbd8114e46c0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.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.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 Configurations. */ -public interface Configurations { - /** - * Gets information about a configuration of 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 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 getWithResponse( - String resourceGroupName, String serverName, String configurationName, Context context); - - /** - * Gets information about a configuration of 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Configuration get(String resourceGroupName, String serverName, String configurationName); - - /** - * Update a list of 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 parameters The parameters for updating a list of 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 a list of server configurations. - */ - ConfigurationListResult batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters); - - /** - * Update a list of 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 parameters The parameters for updating a list of 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. - */ - ConfigurationListResult batchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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); - - /** - * 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. - * @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); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CreateMode.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CreateMode.java deleted file mode 100644 index 89f647c39ff0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CreateMode.java +++ /dev/null @@ -1,53 +0,0 @@ -// 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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The mode to create a new MySQL server. */ -public final class CreateMode extends ExpandableStringEnum { - /** Static value Default for CreateMode. */ - public static final CreateMode DEFAULT = fromString("Default"); - - /** Static value PointInTimeRestore for CreateMode. */ - public static final CreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); - - /** Static value Replica for CreateMode. */ - public static final CreateMode REPLICA = fromString("Replica"); - - /** Static value GeoRestore for CreateMode. */ - public static final CreateMode GEO_RESTORE = fromString("GeoRestore"); - - /** - * Creates a new instance of CreateMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CreateMode() { - } - - /** - * Creates or finds a CreateMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreateMode. - */ - @JsonCreator - public static CreateMode fromString(String name) { - return fromString(name, CreateMode.class); - } - - /** - * Gets known CreateMode values. - * - * @return known CreateMode values. - */ - public static Collection values() { - return values(CreateMode.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryption.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryption.java deleted file mode 100644 index d040f3a3393c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryption.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The date encryption for cmk. */ -@Fluent -public final class DataEncryption { - /* - * Primary user identity resource id - */ - @JsonProperty(value = "primaryUserAssignedIdentityId") - private String primaryUserAssignedIdentityId; - - /* - * Primary key uri - */ - @JsonProperty(value = "primaryKeyURI") - private String primaryKeyUri; - - /* - * Geo backup user identity resource id as identity can't cross region, need identity in same region as geo backup - */ - @JsonProperty(value = "geoBackupUserAssignedIdentityId") - private String geoBackupUserAssignedIdentityId; - - /* - * Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup - */ - @JsonProperty(value = "geoBackupKeyURI") - private String geoBackupKeyUri; - - /* - * The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. - */ - @JsonProperty(value = "type") - private DataEncryptionType type; - - /** Creates an instance of DataEncryption class. */ - public DataEncryption() { - } - - /** - * Get the primaryUserAssignedIdentityId property: Primary user identity resource id. - * - * @return the primaryUserAssignedIdentityId value. - */ - public String primaryUserAssignedIdentityId() { - return this.primaryUserAssignedIdentityId; - } - - /** - * Set the primaryUserAssignedIdentityId property: Primary user identity resource id. - * - * @param primaryUserAssignedIdentityId the primaryUserAssignedIdentityId value to set. - * @return the DataEncryption object itself. - */ - public DataEncryption withPrimaryUserAssignedIdentityId(String primaryUserAssignedIdentityId) { - this.primaryUserAssignedIdentityId = primaryUserAssignedIdentityId; - return this; - } - - /** - * Get the primaryKeyUri property: Primary key uri. - * - * @return the primaryKeyUri value. - */ - public String primaryKeyUri() { - return this.primaryKeyUri; - } - - /** - * Set the primaryKeyUri property: Primary key uri. - * - * @param primaryKeyUri the primaryKeyUri value to set. - * @return the DataEncryption object itself. - */ - public DataEncryption withPrimaryKeyUri(String primaryKeyUri) { - this.primaryKeyUri = primaryKeyUri; - return this; - } - - /** - * Get the geoBackupUserAssignedIdentityId property: Geo backup user identity resource id as identity can't cross - * region, need identity in same region as geo backup. - * - * @return the geoBackupUserAssignedIdentityId value. - */ - public String geoBackupUserAssignedIdentityId() { - return this.geoBackupUserAssignedIdentityId; - } - - /** - * Set the geoBackupUserAssignedIdentityId property: Geo backup user identity resource id as identity can't cross - * region, need identity in same region as geo backup. - * - * @param geoBackupUserAssignedIdentityId the geoBackupUserAssignedIdentityId value to set. - * @return the DataEncryption object itself. - */ - public DataEncryption withGeoBackupUserAssignedIdentityId(String geoBackupUserAssignedIdentityId) { - this.geoBackupUserAssignedIdentityId = geoBackupUserAssignedIdentityId; - return this; - } - - /** - * Get the geoBackupKeyUri property: Geo backup key uri as key vault can't cross region, need cmk in same region as - * geo backup. - * - * @return the geoBackupKeyUri value. - */ - public String geoBackupKeyUri() { - return this.geoBackupKeyUri; - } - - /** - * Set the geoBackupKeyUri property: Geo backup key uri as key vault can't cross region, need cmk in same region as - * geo backup. - * - * @param geoBackupKeyUri the geoBackupKeyUri value to set. - * @return the DataEncryption object itself. - */ - public DataEncryption withGeoBackupKeyUri(String geoBackupKeyUri) { - this.geoBackupKeyUri = geoBackupKeyUri; - return this; - } - - /** - * Get the type property: The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. - * - * @return the type value. - */ - public DataEncryptionType type() { - return this.type; - } - - /** - * Set the type property: The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. - * - * @param type the type value to set. - * @return the DataEncryption object itself. - */ - public DataEncryption withType(DataEncryptionType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryptionType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryptionType.java deleted file mode 100644 index 930c9ebce67a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryptionType.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.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. */ -public enum DataEncryptionType { - /** Enum value AzureKeyVault. */ - AZURE_KEY_VAULT("AzureKeyVault"), - - /** Enum value SystemManaged. */ - SYSTEM_MANAGED("SystemManaged"); - - /** The actual serialized value for a DataEncryptionType instance. */ - private final String value; - - DataEncryptionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DataEncryptionType instance. - * - * @param value the serialized value to parse. - * @return the parsed DataEncryptionType object, or null if unable to parse. - */ - @JsonCreator - public static DataEncryptionType fromString(String value) { - if (value == null) { - return null; - } - DataEncryptionType[] items = DataEncryptionType.values(); - for (DataEncryptionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} 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 deleted file mode 100644 index be335b0e9d1f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.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.DatabaseInner; - -/** An immutable client-side representation of Database. */ -public interface Database { - /** - * 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: The system metadata relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the charset property: The charset of the database. - * - * @return the charset value. - */ - String charset(); - - /** - * Gets the collation property: The collation of the database. - * - * @return the collation value. - */ - String collation(); - - /** - * 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.DatabaseInner object. - * - * @return the inner object. - */ - DatabaseInner innerModel(); - - /** The entirety of the Database definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The Database definition stages. */ - interface DefinitionStages { - /** The first stage of the Database definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the Database 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 Database 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.WithCharset, DefinitionStages.WithCollation { - /** - * Executes the create request. - * - * @return the created resource. - */ - Database create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Database create(Context context); - } - /** The stage of the Database definition allowing to specify charset. */ - interface WithCharset { - /** - * Specifies the charset property: The charset of the database.. - * - * @param charset The charset of the database. - * @return the next definition stage. - */ - WithCreate withCharset(String charset); - } - /** The stage of the Database definition allowing to specify collation. */ - interface WithCollation { - /** - * Specifies the collation property: The collation of the database.. - * - * @param collation The collation of the database. - * @return the next definition stage. - */ - WithCreate withCollation(String collation); - } - } - /** - * Begins update for the Database resource. - * - * @return the stage of resource update. - */ - Database.Update update(); - - /** The template for Database update. */ - interface Update extends UpdateStages.WithCharset, UpdateStages.WithCollation { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Database apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Database apply(Context context); - } - /** The Database update stages. */ - interface UpdateStages { - /** The stage of the Database update allowing to specify charset. */ - interface WithCharset { - /** - * Specifies the charset property: The charset of the database.. - * - * @param charset The charset of the database. - * @return the next definition stage. - */ - Update withCharset(String charset); - } - /** The stage of the Database update allowing to specify collation. */ - interface WithCollation { - /** - * Specifies the collation property: The collation of the database.. - * - * @param collation The collation of the database. - * @return the next definition stage. - */ - Update withCollation(String collation); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Database refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Database refresh(Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DatabaseListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DatabaseListResult.java deleted file mode 100644 index fc6aa87d45f5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DatabaseListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A List of databases. */ -@Fluent -public final class DatabaseListResult { - /* - * The list of databases housed in a server - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of DatabaseListResult class. */ - public DatabaseListResult() { - } - - /** - * Get the value property: The list of databases housed in a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of databases housed in a server. - * - * @param value the value value to set. - * @return the DatabaseListResult object itself. - */ - public DatabaseListResult 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 DatabaseListResult object itself. - */ - public DatabaseListResult 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()); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Databases.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Databases.java deleted file mode 100644 index 408307423a14..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Databases.java +++ /dev/null @@ -1,142 +0,0 @@ -// 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 Databases. */ -public interface Databases { - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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, String databaseName); - - /** - * Deletes a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @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, String databaseName, Context context); - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @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 database along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String serverName, String databaseName, Context context); - - /** - * Gets information about a database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param databaseName The name of the database. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 database. - */ - Database get(String resourceGroupName, String serverName, String databaseName); - - /** - * List all the databases 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 databases as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the databases 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 databases as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about a database. - * - * @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 database along with {@link Response}. - */ - Database getById(String id); - - /** - * Gets information about a database. - * - * @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 database along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a database. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a database. - * - * @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 Database resource. - * - * @param name resource name. - * @return the first stage of the new Database definition. - */ - Database.DefinitionStages.Blank define(String name); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DelegatedSubnetUsage.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DelegatedSubnetUsage.java deleted file mode 100644 index 39f126d892b2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DelegatedSubnetUsage.java +++ /dev/null @@ -1,54 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Delegated subnet usage data. */ -@Immutable -public final class DelegatedSubnetUsage { - /* - * name of the subnet - */ - @JsonProperty(value = "subnetName", access = JsonProperty.Access.WRITE_ONLY) - private String subnetName; - - /* - * Number of used delegated subnets - */ - @JsonProperty(value = "usage", access = JsonProperty.Access.WRITE_ONLY) - private Long usage; - - /** Creates an instance of DelegatedSubnetUsage class. */ - public DelegatedSubnetUsage() { - } - - /** - * Get the subnetName property: name of the subnet. - * - * @return the subnetName value. - */ - public String subnetName() { - return this.subnetName; - } - - /** - * Get the usage property: Number of used delegated subnets. - * - * @return the usage value. - */ - public Long usage() { - return this.usage; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/EnableStatusEnum.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/EnableStatusEnum.java deleted file mode 100644 index ddb28a1153af..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/EnableStatusEnum.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Enum to indicate whether value is 'Enabled' or 'Disabled'. */ -public final class EnableStatusEnum extends ExpandableStringEnum { - /** Static value Enabled for EnableStatusEnum. */ - public static final EnableStatusEnum ENABLED = fromString("Enabled"); - - /** Static value Disabled for EnableStatusEnum. */ - public static final EnableStatusEnum DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of EnableStatusEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnableStatusEnum() { - } - - /** - * Creates or finds a EnableStatusEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnableStatusEnum. - */ - @JsonCreator - public static EnableStatusEnum fromString(String name) { - return fromString(name, EnableStatusEnum.class); - } - - /** - * Gets known EnableStatusEnum values. - * - * @return known EnableStatusEnum values. - */ - public static Collection values() { - return values(EnableStatusEnum.class); - } -} 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 deleted file mode 100644 index 47a4966d1ca5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java +++ /dev/null @@ -1,199 +0,0 @@ -// 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.FirewallRuleInner; - -/** An immutable client-side representation of FirewallRule. */ -public interface FirewallRule { - /** - * 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: The system metadata relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. - * - * @return the startIpAddress value. - */ - String startIpAddress(); - - /** - * Gets the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 format. - * - * @return the endIpAddress value. - */ - String endIpAddress(); - - /** - * 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.FirewallRuleInner object. - * - * @return the inner object. - */ - FirewallRuleInner innerModel(); - - /** The entirety of the FirewallRule definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithStartIpAddress, - DefinitionStages.WithEndIpAddress, - DefinitionStages.WithCreate { - } - /** The FirewallRule definition stages. */ - interface DefinitionStages { - /** The first stage of the FirewallRule definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the FirewallRule 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. - */ - WithStartIpAddress withExistingFlexibleServer(String resourceGroupName, String serverName); - } - /** The stage of the FirewallRule definition allowing to specify startIpAddress. */ - interface WithStartIpAddress { - /** - * Specifies the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 - * format.. - * - * @param startIpAddress The start IP address of the server firewall rule. Must be IPv4 format. - * @return the next definition stage. - */ - WithEndIpAddress withStartIpAddress(String startIpAddress); - } - /** The stage of the FirewallRule definition allowing to specify endIpAddress. */ - interface WithEndIpAddress { - /** - * Specifies the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 - * format.. - * - * @param endIpAddress The end IP address of the server firewall rule. Must be IPv4 format. - * @return the next definition stage. - */ - WithCreate withEndIpAddress(String endIpAddress); - } - /** - * The stage of the FirewallRule 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - FirewallRule create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - FirewallRule create(Context context); - } - } - /** - * Begins update for the FirewallRule resource. - * - * @return the stage of resource update. - */ - FirewallRule.Update update(); - - /** The template for FirewallRule update. */ - interface Update extends UpdateStages.WithStartIpAddress, UpdateStages.WithEndIpAddress { - /** - * Executes the update request. - * - * @return the updated resource. - */ - FirewallRule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - FirewallRule apply(Context context); - } - /** The FirewallRule update stages. */ - interface UpdateStages { - /** The stage of the FirewallRule update allowing to specify startIpAddress. */ - interface WithStartIpAddress { - /** - * Specifies the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 - * format.. - * - * @param startIpAddress The start IP address of the server firewall rule. Must be IPv4 format. - * @return the next definition stage. - */ - Update withStartIpAddress(String startIpAddress); - } - /** The stage of the FirewallRule update allowing to specify endIpAddress. */ - interface WithEndIpAddress { - /** - * Specifies the endIpAddress property: The end IP address of the server firewall rule. Must be IPv4 - * format.. - * - * @param endIpAddress The end IP address of the server firewall rule. Must be IPv4 format. - * @return the next definition stage. - */ - Update withEndIpAddress(String endIpAddress); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - FirewallRule refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - FirewallRule refresh(Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRuleListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRuleListResult.java deleted file mode 100644 index 3fd5baa8c53d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRuleListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of firewall rules. */ -@Fluent -public final class FirewallRuleListResult { - /* - * The list of firewall rules in a server. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of FirewallRuleListResult class. */ - public FirewallRuleListResult() { - } - - /** - * Get the value property: The list of firewall rules in a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of firewall rules in a server. - * - * @param value the value value to set. - * @return the FirewallRuleListResult object itself. - */ - public FirewallRuleListResult 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 FirewallRuleListResult object itself. - */ - public FirewallRuleListResult 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()); - } - } -} 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 182a5e2e43db..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") -@JsonTypeName("FullBackupStoreDetails") -@Fluent -public final class FullBackupStoreDetails extends BackupStoreDetails { - /* - * SASUriList of storage containers where backup data is to be streamed/copied. - */ - @JsonProperty(value = "sasUriList", required = true) - private List sasUriList; - - /** Creates an instance of FullBackupStoreDetails class. */ - public FullBackupStoreDetails() { - } - - /** - * 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() { - super.validate(); - if (sasUriList() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sasUriList in model FullBackupStoreDetails")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FullBackupStoreDetails.class); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixResponse.java deleted file mode 100644 index d0826b59a6b4..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixResponse.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.models; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner; - -/** An immutable client-side representation of GetPrivateDnsZoneSuffixResponse. */ -public interface GetPrivateDnsZoneSuffixResponse { - /** - * Gets the privateDnsZoneSuffix property: Represents the private DNS zone suffix. - * - * @return the privateDnsZoneSuffix value. - */ - String privateDnsZoneSuffix(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner - * object. - * - * @return the inner object. - */ - GetPrivateDnsZoneSuffixResponseInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixes.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixes.java deleted file mode 100644 index 7fe91f4f1e83..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixes.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.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of GetPrivateDnsZoneSuffixes. */ -public interface GetPrivateDnsZoneSuffixes { - /** - * Get private DNS zone suffix in the cloud. - * - * @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 private DNS zone suffix in the cloud along with {@link Response}. - */ - Response executeWithResponse(Context context); - - /** - * Get private DNS zone suffix in the cloud. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private DNS zone suffix in the cloud. - */ - GetPrivateDnsZoneSuffixResponse execute(); -} 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 deleted file mode 100644 index 6b0dc5a39d2c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java +++ /dev/null @@ -1,91 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Network related properties of a server. */ -@Fluent -public final class HighAvailability { - /* - * High availability mode for a server. - */ - @JsonProperty(value = "mode") - private HighAvailabilityMode mode; - - /* - * The state of server high availability. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private HighAvailabilityState state; - - /* - * Availability zone of the standby server. - */ - @JsonProperty(value = "standbyAvailabilityZone") - private String standbyAvailabilityZone; - - /** Creates an instance of HighAvailability class. */ - public HighAvailability() { - } - - /** - * Get the mode property: High availability mode for a server. - * - * @return the mode value. - */ - public HighAvailabilityMode mode() { - return this.mode; - } - - /** - * Set the mode property: High availability mode for a server. - * - * @param mode the mode value to set. - * @return the HighAvailability object itself. - */ - public HighAvailability withMode(HighAvailabilityMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the state property: The state of server high availability. - * - * @return the state value. - */ - public HighAvailabilityState state() { - return this.state; - } - - /** - * Get the standbyAvailabilityZone property: Availability zone of the standby server. - * - * @return the standbyAvailabilityZone value. - */ - public String standbyAvailabilityZone() { - return this.standbyAvailabilityZone; - } - - /** - * Set the standbyAvailabilityZone property: Availability zone of the standby server. - * - * @param standbyAvailabilityZone the standbyAvailabilityZone value to set. - * @return the HighAvailability object itself. - */ - public HighAvailability withStandbyAvailabilityZone(String standbyAvailabilityZone) { - this.standbyAvailabilityZone = standbyAvailabilityZone; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityMode.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityMode.java deleted file mode 100644 index 74346579a80a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityMode.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** High availability mode for a server. */ -public final class HighAvailabilityMode extends ExpandableStringEnum { - /** Static value Disabled for HighAvailabilityMode. */ - public static final HighAvailabilityMode DISABLED = fromString("Disabled"); - - /** Static value ZoneRedundant for HighAvailabilityMode. */ - public static final HighAvailabilityMode ZONE_REDUNDANT = fromString("ZoneRedundant"); - - /** Static value SameZone for HighAvailabilityMode. */ - public static final HighAvailabilityMode SAME_ZONE = fromString("SameZone"); - - /** - * Creates a new instance of HighAvailabilityMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public HighAvailabilityMode() { - } - - /** - * Creates or finds a HighAvailabilityMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding HighAvailabilityMode. - */ - @JsonCreator - public static HighAvailabilityMode fromString(String name) { - return fromString(name, HighAvailabilityMode.class); - } - - /** - * Gets known HighAvailabilityMode values. - * - * @return known HighAvailabilityMode values. - */ - public static Collection values() { - return values(HighAvailabilityMode.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityState.java deleted file mode 100644 index 43925c3749e0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityState.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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The state of server high availability. */ -public final class HighAvailabilityState extends ExpandableStringEnum { - /** Static value NotEnabled for HighAvailabilityState. */ - public static final HighAvailabilityState NOT_ENABLED = fromString("NotEnabled"); - - /** Static value CreatingStandby for HighAvailabilityState. */ - public static final HighAvailabilityState CREATING_STANDBY = fromString("CreatingStandby"); - - /** Static value Healthy for HighAvailabilityState. */ - public static final HighAvailabilityState HEALTHY = fromString("Healthy"); - - /** Static value FailingOver for HighAvailabilityState. */ - public static final HighAvailabilityState FAILING_OVER = fromString("FailingOver"); - - /** Static value RemovingStandby for HighAvailabilityState. */ - public static final HighAvailabilityState REMOVING_STANDBY = fromString("RemovingStandby"); - - /** - * Creates a new instance of HighAvailabilityState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public HighAvailabilityState() { - } - - /** - * Creates or finds a HighAvailabilityState from its string representation. - * - * @param name a name to look for. - * @return the corresponding HighAvailabilityState. - */ - @JsonCreator - public static HighAvailabilityState fromString(String name) { - return fromString(name, HighAvailabilityState.class); - } - - /** - * Gets known HighAvailabilityState values. - * - * @return known HighAvailabilityState values. - */ - public static Collection values() { - return values(HighAvailabilityState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java deleted file mode 100644 index c46b12ed9533..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Properties to configure Identity for Bring your Own Keys. */ -@Fluent -public final class Identity { - /* - * ObjectId from the KeyVault - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * TenantId from the KeyVault - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * Type of managed service identity. - */ - @JsonProperty(value = "type") - private ManagedServiceIdentityType type; - - /* - * Metadata of user assigned identity. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /** Creates an instance of Identity class. */ - public Identity() { - } - - /** - * Get the principalId property: ObjectId from the KeyVault. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: TenantId from the KeyVault. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: Type of managed service identity. - * - * @return the type value. - */ - public ManagedServiceIdentityType type() { - return this.type; - } - - /** - * Set the type property: Type of managed service identity. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(ManagedServiceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: Metadata of user assigned identity. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: Metadata of user assigned identity. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the Identity object itself. - */ - public Identity withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsConfigPendingRestart.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsConfigPendingRestart.java deleted file mode 100644 index 4d20486144bb..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsConfigPendingRestart.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** If is the configuration pending restart or not. */ -public final class IsConfigPendingRestart extends ExpandableStringEnum { - /** Static value True for IsConfigPendingRestart. */ - public static final IsConfigPendingRestart TRUE = fromString("True"); - - /** Static value False for IsConfigPendingRestart. */ - public static final IsConfigPendingRestart FALSE = fromString("False"); - - /** - * Creates a new instance of IsConfigPendingRestart value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IsConfigPendingRestart() { - } - - /** - * Creates or finds a IsConfigPendingRestart from its string representation. - * - * @param name a name to look for. - * @return the corresponding IsConfigPendingRestart. - */ - @JsonCreator - public static IsConfigPendingRestart fromString(String name) { - return fromString(name, IsConfigPendingRestart.class); - } - - /** - * Gets known IsConfigPendingRestart values. - * - * @return known IsConfigPendingRestart values. - */ - public static Collection values() { - return values(IsConfigPendingRestart.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsDynamicConfig.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsDynamicConfig.java deleted file mode 100644 index 7779fe7f7246..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsDynamicConfig.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** If is the configuration dynamic. */ -public final class IsDynamicConfig extends ExpandableStringEnum { - /** Static value True for IsDynamicConfig. */ - public static final IsDynamicConfig TRUE = fromString("True"); - - /** Static value False for IsDynamicConfig. */ - public static final IsDynamicConfig FALSE = fromString("False"); - - /** - * Creates a new instance of IsDynamicConfig value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IsDynamicConfig() { - } - - /** - * Creates or finds a IsDynamicConfig from its string representation. - * - * @param name a name to look for. - * @return the corresponding IsDynamicConfig. - */ - @JsonCreator - public static IsDynamicConfig fromString(String name) { - return fromString(name, IsDynamicConfig.class); - } - - /** - * Gets known IsDynamicConfig values. - * - * @return known IsDynamicConfig values. - */ - public static Collection values() { - return values(IsDynamicConfig.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsReadOnly.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsReadOnly.java deleted file mode 100644 index 8e3ba85d07d1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsReadOnly.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** If is the configuration read only. */ -public final class IsReadOnly extends ExpandableStringEnum { - /** Static value True for IsReadOnly. */ - public static final IsReadOnly TRUE = fromString("True"); - - /** Static value False for IsReadOnly. */ - public static final IsReadOnly FALSE = fromString("False"); - - /** - * Creates a new instance of IsReadOnly value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IsReadOnly() { - } - - /** - * Creates or finds a IsReadOnly from its string representation. - * - * @param name a name to look for. - * @return the corresponding IsReadOnly. - */ - @JsonCreator - public static IsReadOnly fromString(String name) { - return fromString(name, IsReadOnly.class); - } - - /** - * Gets known IsReadOnly values. - * - * @return known IsReadOnly values. - */ - public static Collection values() { - return values(IsReadOnly.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilities.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilities.java deleted file mode 100644 index 2d66fa1b2f11..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilities.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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of LocationBasedCapabilities. */ -public interface LocationBasedCapabilities { - /** - * 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); -} 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 c76a9d25a7c1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java +++ /dev/null @@ -1,82 +0,0 @@ -// 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: The system metadata relating to this resource. - * - * @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 4eb1f8470ea3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A List of logFiles. */ -@Fluent -public final class LogFileListResult { - /* - * The list of logFiles in a server - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - 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()); - } - } -} 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 fe6b05b9d559..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.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.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/MaintenanceWindow.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceWindow.java deleted file mode 100644 index 5d61bdbf44c9..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceWindow.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.fasterxml.jackson.annotation.JsonProperty; - -/** Maintenance window of a server. */ -@Fluent -public final class MaintenanceWindow { - /* - * indicates whether custom window is enabled or disabled - */ - @JsonProperty(value = "customWindow") - private String customWindow; - - /* - * start hour for maintenance window - */ - @JsonProperty(value = "startHour") - private Integer startHour; - - /* - * start minute for maintenance window - */ - @JsonProperty(value = "startMinute") - private Integer startMinute; - - /* - * day of week for maintenance window - */ - @JsonProperty(value = "dayOfWeek") - private Integer dayOfWeek; - - /** Creates an instance of MaintenanceWindow class. */ - public MaintenanceWindow() { - } - - /** - * Get the customWindow property: indicates whether custom window is enabled or disabled. - * - * @return the customWindow value. - */ - public String customWindow() { - return this.customWindow; - } - - /** - * Set the customWindow property: indicates whether custom window is enabled or disabled. - * - * @param customWindow the customWindow value to set. - * @return the MaintenanceWindow object itself. - */ - public MaintenanceWindow withCustomWindow(String customWindow) { - this.customWindow = customWindow; - return this; - } - - /** - * Get the startHour property: start hour for maintenance window. - * - * @return the startHour value. - */ - public Integer startHour() { - return this.startHour; - } - - /** - * Set the startHour property: start hour for maintenance window. - * - * @param startHour the startHour value to set. - * @return the MaintenanceWindow object itself. - */ - public MaintenanceWindow withStartHour(Integer startHour) { - this.startHour = startHour; - return this; - } - - /** - * Get the startMinute property: start minute for maintenance window. - * - * @return the startMinute value. - */ - public Integer startMinute() { - return this.startMinute; - } - - /** - * Set the startMinute property: start minute for maintenance window. - * - * @param startMinute the startMinute value to set. - * @return the MaintenanceWindow object itself. - */ - public MaintenanceWindow withStartMinute(Integer startMinute) { - this.startMinute = startMinute; - return this; - } - - /** - * Get the dayOfWeek property: day of week for maintenance window. - * - * @return the dayOfWeek value. - */ - public Integer dayOfWeek() { - return this.dayOfWeek; - } - - /** - * Set the dayOfWeek property: day of week for maintenance window. - * - * @param dayOfWeek the dayOfWeek value to set. - * @return the MaintenanceWindow object itself. - */ - public MaintenanceWindow withDayOfWeek(Integer dayOfWeek) { - this.dayOfWeek = dayOfWeek; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index e380c8ad335b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Type of managed service identity. */ -public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** Static value UserAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** - * Creates a new instance of ManagedServiceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedServiceIdentityType() { - } - - /** - * Creates or finds a ManagedServiceIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedServiceIdentityType. - */ - @JsonCreator - public static ManagedServiceIdentityType fromString(String name) { - return fromString(name, ManagedServiceIdentityType.class); - } - - /** - * Gets known ManagedServiceIdentityType values. - * - * @return known ManagedServiceIdentityType values. - */ - public static Collection values() { - return values(ManagedServiceIdentityType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailability.java deleted file mode 100644 index f8b57c22afd8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailability.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.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; - -/** An immutable client-side representation of NameAvailability. */ -public interface NameAvailability { - /** - * Gets the message property: Error Message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the nameAvailable property: Indicates whether the resource name is available. - * - * @return the nameAvailable value. - */ - Boolean nameAvailable(); - - /** - * Gets the reason property: Reason for name being unavailable. - * - * @return the reason value. - */ - String reason(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner object. - * - * @return the inner object. - */ - NameAvailabilityInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailabilityRequest.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailabilityRequest.java deleted file mode 100644 index 35efddd04f4c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailabilityRequest.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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request from client to check resource name availability. */ -@Fluent -public final class NameAvailabilityRequest { - /* - * Resource name to verify. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Resource type used for verification. - */ - @JsonProperty(value = "type") - private String type; - - /** Creates an instance of NameAvailabilityRequest class. */ - public NameAvailabilityRequest() { - } - - /** - * Get the name property: Resource name to verify. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Resource name to verify. - * - * @param name the name value to set. - * @return the NameAvailabilityRequest object itself. - */ - public NameAvailabilityRequest withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Resource type used for verification. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Resource type used for verification. - * - * @param type the type value to set. - * @return the NameAvailabilityRequest object itself. - */ - public NameAvailabilityRequest withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model NameAvailabilityRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NameAvailabilityRequest.class); -} 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 deleted file mode 100644 index c74292906286..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network related properties of a server. */ -@Fluent -public final class Network { - /* - * Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet - * integration. - */ - @JsonProperty(value = "publicNetworkAccess") - private EnableStatusEnum publicNetworkAccess; - - /* - * Delegated subnet resource id used to setup vnet for a server. - */ - @JsonProperty(value = "delegatedSubnetResourceId") - private String delegatedSubnetResourceId; - - /* - * Private DNS zone resource id. - */ - @JsonProperty(value = "privateDnsZoneResourceId") - private String privateDnsZoneResourceId; - - /** Creates an instance of Network class. */ - public Network() { - } - - /** - * Get the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * 'Disabled' when server has VNet integration. - * - * @return the publicNetworkAccess value. - */ - 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. - * - * @return the delegatedSubnetResourceId value. - */ - public String delegatedSubnetResourceId() { - return this.delegatedSubnetResourceId; - } - - /** - * Set the delegatedSubnetResourceId property: Delegated subnet resource id used to setup vnet for a server. - * - * @param delegatedSubnetResourceId the delegatedSubnetResourceId value to set. - * @return the Network object itself. - */ - public Network withDelegatedSubnetResourceId(String delegatedSubnetResourceId) { - this.delegatedSubnetResourceId = delegatedSubnetResourceId; - return this; - } - - /** - * Get the privateDnsZoneResourceId property: Private DNS zone resource id. - * - * @return the privateDnsZoneResourceId value. - */ - public String privateDnsZoneResourceId() { - return this.privateDnsZoneResourceId; - } - - /** - * Set the privateDnsZoneResourceId property: Private DNS zone resource id. - * - * @param privateDnsZoneResourceId the privateDnsZoneResourceId value to set. - * @return the Network object itself. - */ - public Network withPrivateDnsZoneResourceId(String privateDnsZoneResourceId) { - this.privateDnsZoneResourceId = privateDnsZoneResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operation.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operation.java deleted file mode 100644 index 06bc0c4ec40e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operation.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.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import java.util.Map; - -/** An immutable client-side representation of Operation. */ -public interface Operation { - /** - * Gets the name property: The name of the operation being performed on this particular object. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The localized display information for this particular operation or action. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation. - * - * @return the origin value. - */ - String origin(); - - /** - * Gets the properties property: Additional descriptions for the operation. - * - * @return the properties value. - */ - Map properties(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationDisplay.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationDisplay.java deleted file mode 100644 index 273b31323fea..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationDisplay.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.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ -@Fluent -public final class OperationDisplay { - /* - * Operation resource provider name. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Localized friendly name for the operation. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Operation description. - */ - @JsonProperty(value = "description") - private String description; - - /** Creates an instance of OperationDisplay class. */ - public OperationDisplay() { - } - - /** - * Get the provider property: Operation resource provider name. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Operation resource provider name. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Localized friendly name for the operation. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Localized friendly name for the operation. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Operation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Operation description. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationListResult.java deleted file mode 100644 index 03f6360aa4d8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of resource provider operations. */ -@Fluent -public final class OperationListResult { - /* - * Collection of available operation details - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL client should use to fetch the next page (per server side paging). - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of OperationListResult class. */ - public OperationListResult() { - } - - /** - * Get the value property: Collection of available operation details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of available operation details. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL client should use to fetch the next page (per server side paging). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL client should use to fetch the next page (per server side paging). - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult 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()); - } - } -} 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 1132804a454c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** 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. - */ - @JsonCreator - 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} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operations.java deleted file mode 100644 index af2d516e57cb..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operations.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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * Lists all of the available REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all of the available REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); -} 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 new file mode 100644 index 000000000000..92d493cc1bb6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The private endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for private endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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 new file mode 100644 index 000000000000..2b99b61e17a7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java @@ -0,0 +1,225 @@ +// 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.PrivateEndpointConnectionInner; +import java.util.List; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * 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.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the PrivateEndpointConnection 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 PrivateEndpointConnection 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.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..1a1ee0bc329e --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,26 @@ +// 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.PrivateEndpointConnectionListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateEndpointConnectionListResult. */ +public interface PrivateEndpointConnectionListResult { + /** + * Gets the value property: Array of private endpoint connections. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionListResultInner innerModel(); +} 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 new file mode 100644 index 000000000000..743ffdfa3198 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,54 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/FirewallRules.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java similarity index 68% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRules.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java index a070f75237f6..792d3e37910d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRules.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java @@ -4,115 +4,115 @@ 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 FirewallRules. */ -public interface FirewallRules { +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { /** - * Deletes a firewall rule. + * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. */ - void delete(String resourceGroupName, String serverName, String firewallRuleName); + Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); /** - * Deletes a firewall rule. + * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. */ - void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String serverName, String privateEndpointConnectionName); /** - * Gets information about a server firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String serverName, String firewallRuleName, Context context); + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName); /** - * Gets information about a server firewall rule. + * Deletes a private endpoint connection with a given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param firewallRuleName The name of the server firewall rule. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. */ - FirewallRule get(String resourceGroupName, String serverName, String firewallRuleName); + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a 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 firewall rules as paginated response with {@link PagedIterable}. + * @return all private endpoint connections on a server along with {@link Response}. */ - PagedIterable listByServer(String resourceGroupName, String serverName); + Response listByServerWithResponse( + String resourceGroupName, String serverName, Context context); /** - * List all the firewall rules in a given server. + * Gets all private endpoint connections on a 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 firewall rules as paginated response with {@link PagedIterable}. + * @return all private endpoint connections on a server. */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + PrivateEndpointConnectionListResult listByServer(String resourceGroupName, String serverName); /** - * Gets information about a server firewall rule. + * Gets a private endpoint connection. * * @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 server firewall rule along with {@link Response}. + * @return a private endpoint connection along with {@link Response}. */ - FirewallRule getById(String id); + PrivateEndpointConnection getById(String id); /** - * Gets information about a server firewall rule. + * Gets a private endpoint connection. * * @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 server firewall rule along with {@link Response}. + * @return a private endpoint connection along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +122,7 @@ Response getWithResponse( void deleteById(String id); /** - * Deletes a firewall rule. + * Deletes a private endpoint connection with a given name. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -133,10 +133,10 @@ Response getWithResponse( void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new FirewallRule resource. + * Begins definition for a new PrivateEndpointConnection resource. * * @param name resource name. - * @return the first stage of the new FirewallRule definition. + * @return the first stage of the new PrivateEndpointConnection definition. */ - FirewallRule.DefinitionStages.Blank define(String name); + PrivateEndpointConnection.DefinitionStages.Blank define(String name); } 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 new file mode 100644 index 000000000000..5da0888a86a0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,51 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/ServerBackup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResource.java similarity index 54% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResource.java index 60f3877a3447..e7e8ebda26d5 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/PrivateLinkResource.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import java.util.List; -/** An immutable client-side representation of ServerBackup. */ -public interface ServerBackup { +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -32,37 +32,37 @@ public interface ServerBackup { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); /** - * Gets the backupType property: Backup type. + * Gets the groupId property: The private link resource group id. * - * @return the backupType value. + * @return the groupId value. */ - String backupType(); + String groupId(); /** - * Gets the completedTime property: Backup completed time (ISO8601 format). + * Gets the requiredMembers property: The private link resource required member names. * - * @return the completedTime value. + * @return the requiredMembers value. */ - OffsetDateTime completedTime(); + List requiredMembers(); /** - * Gets the source property: Backup source. + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. * - * @return the source value. + * @return the requiredZoneNames value. */ - String source(); + List requiredZoneNames(); /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner object. + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner object. * * @return the inner object. */ - ServerBackupInner innerModel(); + PrivateLinkResourceInner innerModel(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..2e512fd7809f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceListResult.java @@ -0,0 +1,26 @@ +// 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.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} 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/PrivateLinkResources.java similarity index 65% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResources.java index 12f58ea42bbe..212782e76c4d 100644 --- 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/PrivateLinkResources.java @@ -7,59 +7,59 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BackupAndExports. */ -public interface BackupAndExports { +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { /** - * Exports the backup of the given server by creating a backup if not existing. + * Lists the private link resources for MySQL 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 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. + * @return a list of private link resources along with {@link Response}. */ - BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); + Response listByServerWithResponse( + String resourceGroupName, String serverName, Context context); /** - * Exports the backup of the given server by creating a backup if not existing. + * Lists the private link resources for MySQL 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 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. + * @return a list of private link resources. */ - BackupAndExportResponse create( - String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context); + PrivateLinkResourceListResult listByServer(String resourceGroupName, String serverName); /** - * Validates if backup can be performed for given server. + * Gets a private link resource for MySQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param groupName The name of the private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response along with {@link Response}. + * @return a private link resource for MySQL server along with {@link Response}. */ - Response validateBackupWithResponse( - String resourceGroupName, String serverName, Context context); + Response getWithResponse( + String resourceGroupName, String serverName, String groupName, Context context); /** - * Validates if backup can be performed for given server. + * Gets a private link resource for MySQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response. + * @return a private link resource for MySQL server. */ - ValidateBackupResponse validateBackup(String resourceGroupName, String serverName); + PrivateLinkResource get(String resourceGroupName, String serverName, String groupName); } 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 new file mode 100644 index 000000000000..14cf8b7a05b5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + 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() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Replicas.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Replicas.java deleted file mode 100644 index 506765d41704..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Replicas.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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Replicas. */ -public interface Replicas { - /** - * List all the replicas 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 servers as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the replicas 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 servers 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/ReplicationRole.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ReplicationRole.java deleted file mode 100644 index ef14fa5b8a2c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ReplicationRole.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The replication role. */ -public final class ReplicationRole extends ExpandableStringEnum { - /** Static value None for ReplicationRole. */ - public static final ReplicationRole NONE = fromString("None"); - - /** Static value Source for ReplicationRole. */ - public static final ReplicationRole SOURCE = fromString("Source"); - - /** Static value Replica for ReplicationRole. */ - public static final ReplicationRole REPLICA = fromString("Replica"); - - /** - * Creates a new instance of ReplicationRole value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ReplicationRole() { - } - - /** - * Creates or finds a ReplicationRole from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReplicationRole. - */ - @JsonCreator - public static ReplicationRole fromString(String name) { - return fromString(name, ReplicationRole.class); - } - - /** - * Gets known ReplicationRole values. - * - * @return known ReplicationRole values. - */ - public static Collection values() { - return values(ReplicationRole.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 979723e1b573..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -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. - */ - @JsonCreator - 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 deleted file mode 100644 index 0defb712482f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java +++ /dev/null @@ -1,733 +0,0 @@ -// 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.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of Server. */ -public interface Server { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the identity property: The cmk identity for the server. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the sku property: The SKU (pricing tier) of the server. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the systemData property: The system metadata relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the administratorLogin property: The administrator's login name of a server. Can only be specified when the - * server is being created (and is required for creation). - * - * @return the administratorLogin value. - */ - String administratorLogin(); - - /** - * Gets the administratorLoginPassword property: The password of the administrator login (required for server - * creation). - * - * @return the administratorLoginPassword value. - */ - String administratorLoginPassword(); - - /** - * Gets the version property: Server version. - * - * @return the version value. - */ - ServerVersion version(); - - /** - * Gets the availabilityZone property: availability Zone information of the server. - * - * @return the availabilityZone value. - */ - String availabilityZone(); - - /** - * Gets the createMode property: The mode to create a new MySQL server. - * - * @return the createMode value. - */ - CreateMode createMode(); - - /** - * Gets the sourceServerResourceId property: The source MySQL server id. - * - * @return the sourceServerResourceId value. - */ - String sourceServerResourceId(); - - /** - * Gets the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the time to - * restore from. - * - * @return the restorePointInTime value. - */ - OffsetDateTime restorePointInTime(); - - /** - * Gets the replicationRole property: The replication role. - * - * @return the replicationRole value. - */ - ReplicationRole replicationRole(); - - /** - * Gets the replicaCapacity property: The maximum number of replicas that a primary server can have. - * - * @return the replicaCapacity value. - */ - Integer replicaCapacity(); - - /** - * Gets the dataEncryption property: The Data Encryption for CMK. - * - * @return the dataEncryption value. - */ - DataEncryption dataEncryption(); - - /** - * Gets the state property: The state of a server. - * - * @return the state value. - */ - ServerState state(); - - /** - * Gets the fullyQualifiedDomainName property: The fully qualified domain name of a server. - * - * @return the fullyQualifiedDomainName value. - */ - String fullyQualifiedDomainName(); - - /** - * Gets the storage property: Storage related properties of a server. - * - * @return the storage value. - */ - Storage storage(); - - /** - * Gets the backup property: Backup related properties of a server. - * - * @return the backup value. - */ - Backup backup(); - - /** - * Gets the highAvailability property: High availability related properties of a server. - * - * @return the highAvailability value. - */ - HighAvailability highAvailability(); - - /** - * Gets the network property: Network related properties of a server. - * - * @return the network value. - */ - Network network(); - - /** - * Gets the maintenanceWindow property: Maintenance window of a server. - * - * @return the maintenanceWindow value. - */ - MaintenanceWindow maintenanceWindow(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner object. - * - * @return the inner object. - */ - ServerInner innerModel(); - - /** The entirety of the Server definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The Server definition stages. */ - interface DefinitionStages { - /** The first stage of the Server definition. */ - interface Blank extends WithLocation { - } - /** The stage of the Server definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the Server definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the Server definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithAdministratorLogin, - DefinitionStages.WithAdministratorLoginPassword, - DefinitionStages.WithVersion, - DefinitionStages.WithAvailabilityZone, - DefinitionStages.WithCreateMode, - DefinitionStages.WithSourceServerResourceId, - DefinitionStages.WithRestorePointInTime, - DefinitionStages.WithReplicationRole, - DefinitionStages.WithDataEncryption, - DefinitionStages.WithStorage, - DefinitionStages.WithBackup, - DefinitionStages.WithHighAvailability, - DefinitionStages.WithNetwork { - /** - * Executes the create request. - * - * @return the created resource. - */ - Server create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Server create(Context context); - } - /** The stage of the Server definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the Server definition allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The cmk identity for the server.. - * - * @param identity The cmk identity for the server. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - /** The stage of the Server definition allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku property: The SKU (pricing tier) of the server.. - * - * @param sku The SKU (pricing tier) of the server. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - /** The stage of the Server definition allowing to specify administratorLogin. */ - interface WithAdministratorLogin { - /** - * Specifies the administratorLogin property: The administrator's login name of a server. Can only be - * specified when the server is being created (and is required for creation).. - * - * @param administratorLogin The administrator's login name of a server. Can only be specified when the - * server is being created (and is required for creation). - * @return the next definition stage. - */ - WithCreate withAdministratorLogin(String administratorLogin); - } - /** The stage of the Server definition allowing to specify administratorLoginPassword. */ - interface WithAdministratorLoginPassword { - /** - * Specifies the administratorLoginPassword property: The password of the administrator login (required for - * server creation).. - * - * @param administratorLoginPassword The password of the administrator login (required for server creation). - * @return the next definition stage. - */ - WithCreate withAdministratorLoginPassword(String administratorLoginPassword); - } - /** The stage of the Server definition allowing to specify version. */ - interface WithVersion { - /** - * Specifies the version property: Server version.. - * - * @param version Server version. - * @return the next definition stage. - */ - WithCreate withVersion(ServerVersion version); - } - /** The stage of the Server definition allowing to specify availabilityZone. */ - interface WithAvailabilityZone { - /** - * Specifies the availabilityZone property: availability Zone information of the server.. - * - * @param availabilityZone availability Zone information of the server. - * @return the next definition stage. - */ - WithCreate withAvailabilityZone(String availabilityZone); - } - /** The stage of the Server definition allowing to specify createMode. */ - interface WithCreateMode { - /** - * Specifies the createMode property: The mode to create a new MySQL server.. - * - * @param createMode The mode to create a new MySQL server. - * @return the next definition stage. - */ - WithCreate withCreateMode(CreateMode createMode); - } - /** The stage of the Server definition allowing to specify sourceServerResourceId. */ - interface WithSourceServerResourceId { - /** - * Specifies the sourceServerResourceId property: The source MySQL server id.. - * - * @param sourceServerResourceId The source MySQL server id. - * @return the next definition stage. - */ - WithCreate withSourceServerResourceId(String sourceServerResourceId); - } - /** The stage of the Server definition allowing to specify restorePointInTime. */ - interface WithRestorePointInTime { - /** - * Specifies the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the - * time to restore from.. - * - * @param restorePointInTime Restore point creation time (ISO8601 format), specifying the time to restore - * from. - * @return the next definition stage. - */ - WithCreate withRestorePointInTime(OffsetDateTime restorePointInTime); - } - /** The stage of the Server definition allowing to specify replicationRole. */ - interface WithReplicationRole { - /** - * Specifies the replicationRole property: The replication role.. - * - * @param replicationRole The replication role. - * @return the next definition stage. - */ - WithCreate withReplicationRole(ReplicationRole replicationRole); - } - /** The stage of the Server definition allowing to specify dataEncryption. */ - interface WithDataEncryption { - /** - * Specifies the dataEncryption property: The Data Encryption for CMK.. - * - * @param dataEncryption The Data Encryption for CMK. - * @return the next definition stage. - */ - WithCreate withDataEncryption(DataEncryption dataEncryption); - } - /** The stage of the Server definition allowing to specify storage. */ - interface WithStorage { - /** - * Specifies the storage property: Storage related properties of a server.. - * - * @param storage Storage related properties of a server. - * @return the next definition stage. - */ - WithCreate withStorage(Storage storage); - } - /** The stage of the Server definition allowing to specify backup. */ - interface WithBackup { - /** - * Specifies the backup property: Backup related properties of a server.. - * - * @param backup Backup related properties of a server. - * @return the next definition stage. - */ - WithCreate withBackup(Backup backup); - } - /** The stage of the Server definition allowing to specify highAvailability. */ - interface WithHighAvailability { - /** - * Specifies the highAvailability property: High availability related properties of a server.. - * - * @param highAvailability High availability related properties of a server. - * @return the next definition stage. - */ - WithCreate withHighAvailability(HighAvailability highAvailability); - } - /** The stage of the Server definition 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. - */ - WithCreate withNetwork(Network network); - } - } - /** - * Begins update for the Server resource. - * - * @return the stage of resource update. - */ - Server.Update update(); - - /** 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 { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Server apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Server apply(Context context); - } - /** The Server update stages. */ - interface UpdateStages { - /** The stage of the Server update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. - * - * @param tags Application-specific metadata in the form of key-value pairs. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the Server update allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The cmk identity for the server.. - * - * @param identity The cmk identity for the server. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - /** The stage of the Server update allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku property: The SKU (pricing tier) of the server.. - * - * @param sku The SKU (pricing tier) of the server. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - /** The stage of the Server update allowing to specify administratorLoginPassword. */ - interface WithAdministratorLoginPassword { - /** - * Specifies the administratorLoginPassword property: The password of the administrator login.. - * - * @param administratorLoginPassword The password of the administrator login. - * @return the next definition stage. - */ - 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. */ - interface WithStorage { - /** - * Specifies the storage property: Storage related properties of a server.. - * - * @param storage Storage related properties of a server. - * @return the next definition stage. - */ - Update withStorage(Storage storage); - } - /** The stage of the Server update allowing to specify backup. */ - interface WithBackup { - /** - * Specifies the backup property: Backup related properties of a server.. - * - * @param backup Backup related properties of a server. - * @return the next definition stage. - */ - Update withBackup(Backup backup); - } - /** The stage of the Server update allowing to specify highAvailability. */ - interface WithHighAvailability { - /** - * Specifies the highAvailability property: High availability related properties of a server.. - * - * @param highAvailability High availability related properties of a server. - * @return the next definition stage. - */ - Update withHighAvailability(HighAvailability highAvailability); - } - /** The stage of the Server update allowing to specify maintenanceWindow. */ - interface WithMaintenanceWindow { - /** - * Specifies the maintenanceWindow property: Maintenance window of a server.. - * - * @param maintenanceWindow Maintenance window of a server. - * @return the next definition stage. - */ - Update withMaintenanceWindow(MaintenanceWindow maintenanceWindow); - } - /** The stage of the Server update allowing to specify replicationRole. */ - interface WithReplicationRole { - /** - * Specifies the replicationRole property: The replication role of the server.. - * - * @param replicationRole The replication role of the server. - * @return the next definition stage. - */ - Update withReplicationRole(ReplicationRole replicationRole); - } - /** The stage of the Server update allowing to specify dataEncryption. */ - interface WithDataEncryption { - /** - * Specifies the dataEncryption property: The Data Encryption for CMK.. - * - * @param dataEncryption The Data Encryption for CMK. - * @return the next definition stage. - */ - 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); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Server refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Server refresh(Context context); - - /** - * Manual failover a server. - * - * @throws com.azure.core.management.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 failover(); - - /** - * Manual failover 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 failover(Context context); - - /** - * Restarts a server. - * - * @param parameters The required parameters for restarting 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 restart(ServerRestartParameter parameters); - - /** - * Restarts a server. - * - * @param parameters The required parameters for restarting 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 restart(ServerRestartParameter parameters, Context context); - - /** - * Starts a server. - * - * @throws com.azure.core.management.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 start(); - - /** - * Starts 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 start(Context context); - - /** - * Stops a server. - * - * @throws com.azure.core.management.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 stop(); - - /** - * Stops 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 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/ServerBackupListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupListResult.java deleted file mode 100644 index fc309852954b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of server backups. */ -@Fluent -public final class ServerBackupListResult { - /* - * The list of backups of a server. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of ServerBackupListResult class. */ - public ServerBackupListResult() { - } - - /** - * 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 ServerBackupListResult object itself. - */ - public ServerBackupListResult 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 ServerBackupListResult object itself. - */ - public ServerBackupListResult 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()); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapability.java deleted file mode 100644 index 589e676505c5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapability.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; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server edition capabilities. */ -@Immutable -public final class ServerEditionCapability { - /* - * Server edition name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * A list of supported storage editions - */ - @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedStorageEditions; - - /* - * A list of supported server versions. - */ - @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedServerVersions; - - /** Creates an instance of ServerEditionCapability class. */ - public ServerEditionCapability() { - } - - /** - * Get the name property: Server edition name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the supportedStorageEditions property: A list of supported storage editions. - * - * @return the supportedStorageEditions value. - */ - public List supportedStorageEditions() { - return this.supportedStorageEditions; - } - - /** - * 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 (supportedStorageEditions() != null) { - supportedStorageEditions().forEach(e -> e.validate()); - } - if (supportedServerVersions() != null) { - supportedServerVersions().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index a1a61efddc3e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java +++ /dev/null @@ -1,337 +0,0 @@ -// 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.resourcemanager.mysqlflexibleserver.fluent.models.ServerPropertiesForUpdate; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Parameters allowed to update for a server. */ -@Fluent -public final class ServerForUpdate { - /* - * The cmk identity for the server. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /* - * The SKU (pricing tier) of the server. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * The properties that can be updated for a server. - */ - @JsonProperty(value = "properties") - private ServerPropertiesForUpdate innerProperties; - - /* - * Application-specific metadata in the form of key-value pairs. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** Creates an instance of ServerForUpdate class. */ - public ServerForUpdate() { - } - - /** - * Get the identity property: The cmk identity for the server. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The cmk identity for the server. - * - * @param identity the identity value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the sku property: The SKU (pricing tier) of the server. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU (pricing tier) of the server. - * - * @param sku the sku value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: The properties that can be updated for a server. - * - * @return the innerProperties value. - */ - private ServerPropertiesForUpdate innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Application-specific metadata in the form of key-value pairs. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Application-specific metadata in the form of key-value pairs. - * - * @param tags the tags value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the administratorLoginPassword property: The password of the administrator login. - * - * @return the administratorLoginPassword value. - */ - public String administratorLoginPassword() { - return this.innerProperties() == null ? null : this.innerProperties().administratorLoginPassword(); - } - - /** - * Set the administratorLoginPassword property: The password of the administrator login. - * - * @param administratorLoginPassword the administratorLoginPassword value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withAdministratorLoginPassword(String administratorLoginPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withAdministratorLoginPassword(administratorLoginPassword); - 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. - * - * @return the storage value. - */ - public Storage storage() { - return this.innerProperties() == null ? null : this.innerProperties().storage(); - } - - /** - * Set the storage property: Storage related properties of a server. - * - * @param storage the storage value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withStorage(Storage storage) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withStorage(storage); - return this; - } - - /** - * Get the backup property: Backup related properties of a server. - * - * @return the backup value. - */ - public Backup backup() { - return this.innerProperties() == null ? null : this.innerProperties().backup(); - } - - /** - * Set the backup property: Backup related properties of a server. - * - * @param backup the backup value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withBackup(Backup backup) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withBackup(backup); - return this; - } - - /** - * Get the highAvailability property: High availability related properties of a server. - * - * @return the highAvailability value. - */ - public HighAvailability highAvailability() { - return this.innerProperties() == null ? null : this.innerProperties().highAvailability(); - } - - /** - * Set the highAvailability property: High availability related properties of a server. - * - * @param highAvailability the highAvailability value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withHighAvailability(HighAvailability highAvailability) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withHighAvailability(highAvailability); - return this; - } - - /** - * Get the maintenanceWindow property: Maintenance window of a server. - * - * @return the maintenanceWindow value. - */ - public MaintenanceWindow maintenanceWindow() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceWindow(); - } - - /** - * Set the maintenanceWindow property: Maintenance window of a server. - * - * @param maintenanceWindow the maintenanceWindow value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withMaintenanceWindow(maintenanceWindow); - return this; - } - - /** - * Get the replicationRole property: The replication role of the server. - * - * @return the replicationRole value. - */ - public ReplicationRole replicationRole() { - return this.innerProperties() == null ? null : this.innerProperties().replicationRole(); - } - - /** - * Set the replicationRole property: The replication role of the server. - * - * @param replicationRole the replicationRole value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withReplicationRole(ReplicationRole replicationRole) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withReplicationRole(replicationRole); - return this; - } - - /** - * Get the dataEncryption property: The Data Encryption for CMK. - * - * @return the dataEncryption value. - */ - public DataEncryption dataEncryption() { - return this.innerProperties() == null ? null : this.innerProperties().dataEncryption(); - } - - /** - * Set the dataEncryption property: The Data Encryption for CMK. - * - * @param dataEncryption the dataEncryption value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withDataEncryption(DataEncryption dataEncryption) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withDataEncryption(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. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} 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 43a2f4535117..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Server gtid set parameters. */ -@Fluent -public final class ServerGtidSetParameter { - /* - * The gtid set of server. - */ - @JsonProperty(value = "gtidSet") - 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() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerListResult.java deleted file mode 100644 index 10334ae00ec2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerListResult.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.Fluent; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of servers. */ -@Fluent -public final class ServerListResult { - /* - * The list of servers - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of ServerListResult class. */ - public ServerListResult() { - } - - /** - * Get the value property: The list of servers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of servers. - * - * @param value the value value to set. - * @return the ServerListResult object itself. - */ - public ServerListResult 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 ServerListResult object itself. - */ - public ServerListResult 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()); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerRestartParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerRestartParameter.java deleted file mode 100644 index f5b58a3ef5ea..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerRestartParameter.java +++ /dev/null @@ -1,78 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Server restart parameters. */ -@Fluent -public final class ServerRestartParameter { - /* - * Whether or not failover to standby server when restarting a server with high availability enabled. - */ - @JsonProperty(value = "restartWithFailover") - private EnableStatusEnum restartWithFailover; - - /* - * The maximum allowed failover time in seconds. - */ - @JsonProperty(value = "maxFailoverSeconds") - private Integer maxFailoverSeconds; - - /** Creates an instance of ServerRestartParameter class. */ - public ServerRestartParameter() { - } - - /** - * Get the restartWithFailover property: Whether or not failover to standby server when restarting a server with - * high availability enabled. - * - * @return the restartWithFailover value. - */ - public EnableStatusEnum restartWithFailover() { - return this.restartWithFailover; - } - - /** - * Set the restartWithFailover property: Whether or not failover to standby server when restarting a server with - * high availability enabled. - * - * @param restartWithFailover the restartWithFailover value to set. - * @return the ServerRestartParameter object itself. - */ - public ServerRestartParameter withRestartWithFailover(EnableStatusEnum restartWithFailover) { - this.restartWithFailover = restartWithFailover; - return this; - } - - /** - * Get the maxFailoverSeconds property: The maximum allowed failover time in seconds. - * - * @return the maxFailoverSeconds value. - */ - public Integer maxFailoverSeconds() { - return this.maxFailoverSeconds; - } - - /** - * Set the maxFailoverSeconds property: The maximum allowed failover time in seconds. - * - * @param maxFailoverSeconds the maxFailoverSeconds value to set. - * @return the ServerRestartParameter object itself. - */ - public ServerRestartParameter withMaxFailoverSeconds(Integer maxFailoverSeconds) { - this.maxFailoverSeconds = maxFailoverSeconds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerState.java deleted file mode 100644 index 4776f873d1db..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerState.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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The state of a server. */ -public final class ServerState extends ExpandableStringEnum { - /** Static value Ready for ServerState. */ - public static final ServerState READY = fromString("Ready"); - - /** Static value Dropping for ServerState. */ - public static final ServerState DROPPING = fromString("Dropping"); - - /** Static value Disabled for ServerState. */ - public static final ServerState DISABLED = fromString("Disabled"); - - /** Static value Starting for ServerState. */ - public static final ServerState STARTING = fromString("Starting"); - - /** Static value Stopping for ServerState. */ - public static final ServerState STOPPING = fromString("Stopping"); - - /** Static value Stopped for ServerState. */ - public static final ServerState STOPPED = fromString("Stopped"); - - /** Static value Updating for ServerState. */ - public static final ServerState UPDATING = fromString("Updating"); - - /** - * Creates a new instance of ServerState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ServerState() { - } - - /** - * Creates or finds a ServerState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServerState. - */ - @JsonCreator - public static ServerState fromString(String name) { - return fromString(name, ServerState.class); - } - - /** - * Gets known ServerState values. - * - * @return known ServerState values. - */ - public static Collection values() { - return values(ServerState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersion.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersion.java deleted file mode 100644 index 5fa679e089d8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersion.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The version of a server. */ -public final class ServerVersion extends ExpandableStringEnum { - /** Static value 5.7 for ServerVersion. */ - public static final ServerVersion FIVE_SEVEN = fromString("5.7"); - - /** Static value 8.0.21 for ServerVersion. */ - public static final ServerVersion EIGHT_ZERO_TWO_ONE = fromString("8.0.21"); - - /** - * Creates a new instance of ServerVersion value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ServerVersion() { - } - - /** - * Creates or finds a ServerVersion from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServerVersion. - */ - @JsonCreator - public static ServerVersion fromString(String name) { - return fromString(name, ServerVersion.class); - } - - /** - * Gets known ServerVersion values. - * - * @return known ServerVersion values. - */ - public static Collection values() { - return values(ServerVersion.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapability.java deleted file mode 100644 index 24180cc23180..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapability.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Server version capabilities. */ -@Immutable -public final class ServerVersionCapability { - /* - * server version - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * A list of supported Skus - */ - @JsonProperty(value = "supportedSkus", access = JsonProperty.Access.WRITE_ONLY) - private List supportedSkus; - - /** Creates an instance of ServerVersionCapability class. */ - public ServerVersionCapability() { - } - - /** - * Get the name property: server version. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * 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 (supportedSkus() != null) { - supportedSkus().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index c7d65da81a6b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java +++ /dev/null @@ -1,274 +0,0 @@ -// 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 Servers. */ -public interface Servers { - /** - * Deletes a 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. - */ - void deleteByResourceGroup(String resourceGroupName, String serverName); - - /** - * Deletes a 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. - */ - void delete(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about a 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 information about a server along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about a 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 information about a server. - */ - Server getByResourceGroup(String resourceGroupName, String serverName); - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the servers in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List all the servers in a given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List all the servers in a given subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Manual failover a 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. - */ - void failover(String resourceGroupName, String serverName); - - /** - * Manual failover a 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. - */ - void failover(String resourceGroupName, String serverName, Context context); - - /** - * Restarts 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 restarting 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 restart(String resourceGroupName, String serverName, ServerRestartParameter parameters); - - /** - * Restarts 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 restarting 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 restart(String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context); - - /** - * Starts a 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. - */ - void start(String resourceGroupName, String serverName); - - /** - * Starts a 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. - */ - void start(String resourceGroupName, String serverName, Context context); - - /** - * Stops a 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. - */ - void stop(String resourceGroupName, String serverName); - - /** - * Stops a 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. - */ - 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. - * - * @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 server along with {@link Response}. - */ - Server getById(String id); - - /** - * Gets information about a 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 server along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a 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. - */ - void deleteById(String id); - - /** - * Deletes a 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. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Server resource. - * - * @param name resource name. - * @return the first stage of the new Server definition. - */ - Server.DefinitionStages.Blank define(String name); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java deleted file mode 100644 index cfab9ff4e5e2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java +++ /dev/null @@ -1,87 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Billing information related properties of a server. */ -@Fluent -public final class Sku { - /* - * The name of the sku, e.g. Standard_D32s_v3. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The tier of the particular SKU, e.g. GeneralPurpose. - */ - @JsonProperty(value = "tier", required = true) - private SkuTier tier; - - /** Creates an instance of Sku class. */ - public Sku() { - } - - /** - * Get the name property: The name of the sku, e.g. Standard_D32s_v3. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the sku, e.g. Standard_D32s_v3. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The tier of the particular SKU, e.g. GeneralPurpose. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: The tier of the particular SKU, e.g. GeneralPurpose. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(SkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); - } - if (tier() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property tier in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapability.java deleted file mode 100644 index 9c90ac463efd..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapability.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.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Sku capability. */ -@Immutable -public final class SkuCapability { - /* - * vCore name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * supported vCores - */ - @JsonProperty(value = "vCores", access = JsonProperty.Access.WRITE_ONLY) - private Long vCores; - - /* - * supported IOPS - */ - @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) - private Long supportedIops; - - /* - * supported memory per vCore in MB - */ - @JsonProperty(value = "supportedMemoryPerVCoreMB", access = JsonProperty.Access.WRITE_ONLY) - private Long supportedMemoryPerVCoreMB; - - /** Creates an instance of SkuCapability class. */ - public SkuCapability() { - } - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 2774f9ff1cc2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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 com.fasterxml.jackson.annotation.JsonCreator; -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. - */ - @JsonCreator - 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 deleted file mode 100644 index 8567c348df70..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Storage Profile properties of a server. */ -@Fluent -public final class Storage { - /* - * Max storage size allowed for a server. - */ - @JsonProperty(value = "storageSizeGB") - private Integer storageSizeGB; - - /* - * Storage IOPS for a server. - */ - @JsonProperty(value = "iops") - private Integer iops; - - /* - * Enable Storage Auto Grow or not. - */ - @JsonProperty(value = "autoGrow") - private EnableStatusEnum autoGrow; - - /* - * Enable Log On Disk or not. - */ - @JsonProperty(value = "logOnDisk") - private EnableStatusEnum logOnDisk; - - /* - * The sku name of the server storage. - */ - @JsonProperty(value = "storageSku", access = JsonProperty.Access.WRITE_ONLY) - private String storageSku; - - /* - * Enable IO Auto Scaling or not. - */ - @JsonProperty(value = "autoIoScaling") - private EnableStatusEnum autoIoScaling; - - /** Creates an instance of Storage class. */ - public Storage() { - } - - /** - * Get the storageSizeGB property: Max storage size allowed for a server. - * - * @return the storageSizeGB value. - */ - public Integer storageSizeGB() { - return this.storageSizeGB; - } - - /** - * Set the storageSizeGB property: Max storage size allowed for a server. - * - * @param storageSizeGB the storageSizeGB value to set. - * @return the Storage object itself. - */ - public Storage withStorageSizeGB(Integer storageSizeGB) { - this.storageSizeGB = storageSizeGB; - return this; - } - - /** - * Get the iops property: Storage IOPS for a server. - * - * @return the iops value. - */ - public Integer iops() { - return this.iops; - } - - /** - * Set the iops property: Storage IOPS for a server. - * - * @param iops the iops value to set. - * @return the Storage object itself. - */ - public Storage withIops(Integer iops) { - this.iops = iops; - return this; - } - - /** - * Get the autoGrow property: Enable Storage Auto Grow or not. - * - * @return the autoGrow value. - */ - public EnableStatusEnum autoGrow() { - return this.autoGrow; - } - - /** - * Set the autoGrow property: Enable Storage Auto Grow or not. - * - * @param autoGrow the autoGrow value to set. - * @return the Storage object itself. - */ - public Storage withAutoGrow(EnableStatusEnum autoGrow) { - this.autoGrow = 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. - * - * @return the storageSku value. - */ - 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. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 158ee581052c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** storage edition capability. */ -@Immutable -public final class StorageEditionCapability { - /* - * storage edition name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The minimal supported storage size. - */ - @JsonProperty(value = "minStorageSize", access = JsonProperty.Access.WRITE_ONLY) - private Long minStorageSize; - - /* - * The maximum supported storage size. - */ - @JsonProperty(value = "maxStorageSize", access = JsonProperty.Access.WRITE_ONLY) - private Long maxStorageSize; - - /* - * Minimal backup retention days - */ - @JsonProperty(value = "minBackupRetentionDays", access = JsonProperty.Access.WRITE_ONLY) - private Long minBackupRetentionDays; - - /* - * Maximum backup retention days - */ - @JsonProperty(value = "maxBackupRetentionDays", access = JsonProperty.Access.WRITE_ONLY) - private Long maxBackupRetentionDays; - - /** Creates an instance of StorageEditionCapability class. */ - public StorageEditionCapability() { - } - - /** - * Get the name property: storage edition name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the minStorageSize property: The minimal supported storage size. - * - * @return the minStorageSize value. - */ - public Long minStorageSize() { - return this.minStorageSize; - } - - /** - * Get the maxStorageSize property: The maximum supported storage size. - * - * @return the maxStorageSize value. - */ - public Long maxStorageSize() { - return this.maxStorageSize; - } - - /** - * Get the minBackupRetentionDays property: Minimal backup retention days. - * - * @return the minBackupRetentionDays value. - */ - public Long minBackupRetentionDays() { - return this.minBackupRetentionDays; - } - - /** - * Get the maxBackupRetentionDays property: Maximum backup retention days. - * - * @return the maxBackupRetentionDays value. - */ - public Long maxBackupRetentionDays() { - return this.maxBackupRetentionDays; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.java deleted file mode 100644 index f88803502a0b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.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.models; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; - -/** An immutable client-side representation of ValidateBackupResponse. */ -public interface ValidateBackupResponse { - /** - * Gets the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @return the numberOfContainers value. - */ - Integer numberOfContainers(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner object. - * - * @return the inner object. - */ - ValidateBackupResponseInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java deleted file mode 100644 index b95a87c19696..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual network subnet usage parameter. */ -@Fluent -public final class VirtualNetworkSubnetUsageParameter { - /* - * Virtual network resource id. - */ - @JsonProperty(value = "virtualNetworkResourceId") - private String virtualNetworkResourceId; - - /** Creates an instance of VirtualNetworkSubnetUsageParameter class. */ - public VirtualNetworkSubnetUsageParameter() { - } - - /** - * Get the virtualNetworkResourceId property: Virtual network resource id. - * - * @return the virtualNetworkResourceId value. - */ - public String virtualNetworkResourceId() { - return this.virtualNetworkResourceId; - } - - /** - * Set the virtualNetworkResourceId property: Virtual network resource id. - * - * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. - * @return the VirtualNetworkSubnetUsageParameter object itself. - */ - public VirtualNetworkSubnetUsageParameter withVirtualNetworkResourceId(String virtualNetworkResourceId) { - this.virtualNetworkResourceId = virtualNetworkResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageResult.java deleted file mode 100644 index 778dbba5d832..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageResult.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.models; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; -import java.util.List; - -/** An immutable client-side representation of VirtualNetworkSubnetUsageResult. */ -public interface VirtualNetworkSubnetUsageResult { - /** - * Gets the location property: The location name. - * - * @return the location value. - */ - String location(); - - /** - * Gets the subscriptionId property: The subscription id. - * - * @return the subscriptionId value. - */ - String subscriptionId(); - - /** - * Gets the delegatedSubnetsUsage property: A list of delegated subnet usage. - * - * @return the delegatedSubnetsUsage value. - */ - List delegatedSubnetsUsage(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner - * object. - * - * @return the inner object. - */ - VirtualNetworkSubnetUsageResultInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateSamples.java deleted file mode 100644 index 60d686e6cba1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateSamples.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.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/2021-12-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(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteSamples.java deleted file mode 100644 index abb971dbfb54..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteSamples.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.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** Samples for AzureADAdministrators Delete. */ -public final class AzureADAdministratorsDeleteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetSamples.java deleted file mode 100644 index d4fb98587e0d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetSamples.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.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** Samples for AzureADAdministrators Get. */ -public final class AzureADAdministratorsGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerSamples.java deleted file mode 100644 index 956453d8bda3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerSamples.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; - -/** Samples for AzureADAdministrators ListByServer. */ -public final class AzureADAdministratorsListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportCreateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportCreateSamples.java deleted file mode 100644 index fbb01d91eb1d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportCreateSamples.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.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/2022-09-30-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java deleted file mode 100644 index 4f4c7cee72ad..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.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; - -/** Samples for BackupAndExport ValidateBackup. */ -public final class BackupAndExportValidateBackupSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetSamples.java deleted file mode 100644 index 5108efd68a11..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetSamples.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; - -/** Samples for Backups Get. */ -public final class BackupsGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupGet.json - */ - /** - * Sample code: Get a backup for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void getABackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .backups() - .getWithResponse("TestGroup", "mysqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerSamples.java deleted file mode 100644 index e3246d23dfb7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Backups ListByServer. */ -public final class BackupsListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json - */ - /** - * Sample code: List backups for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void listBackupsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backups().listByServer("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutSamples.java deleted file mode 100644 index b2e49f72cf08..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Backups Put. */ -public final class BackupsPutSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java deleted file mode 100644 index 1b4d85575b47..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.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.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** Samples for CheckNameAvailability Execute. */ -public final class CheckNameAvailabilityExecuteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/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 - .checkNameAvailabilities() - .executeWithResponse( - "SouthEastAsia", - new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationExecuteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationExecuteSamples.java deleted file mode 100644 index a6c68f9eed14..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationExecuteSamples.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.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** Samples for CheckNameAvailabilityWithoutLocation Execute. */ -public final class CheckNameAvailabilityWithoutLocationExecuteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsageExecuteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsageExecuteSamples.java deleted file mode 100644 index aceed539d542..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsageExecuteSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -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/preview/2021-12-01-preview/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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateSamples.java deleted file mode 100644 index 159cdf8e709a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateSamples.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.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/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateSamples.java deleted file mode 100644 index 224db98d8953..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateSamples.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.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; - -/** Samples for Configurations CreateOrUpdate. */ -public final class ConfigurationsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-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(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetSamples.java deleted file mode 100644 index 2b2cbe872d5b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetSamples.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; - -/** Samples for Configurations Get. */ -public final class ConfigurationsGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateSamples.java deleted file mode 100644 index a5900438681b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateSamples.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.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/2021-12-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(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateSamples.java deleted file mode 100644 index 90661cded560..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateSamples.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; - -/** Samples for Databases CreateOrUpdate. */ -public final class DatabasesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-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(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteSamples.java deleted file mode 100644 index f01b8aa2696d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Databases Delete. */ -public final class DatabasesDeleteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetSamples.java deleted file mode 100644 index 4d3c65bca5ae..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Databases Get. */ -public final class DatabasesGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerSamples.java deleted file mode 100644 index bb91f676dc8f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Databases ListByServer. */ -public final class DatabasesListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java deleted file mode 100644 index 84ecda3c4495..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.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; - -/** Samples for FirewallRules CreateOrUpdate. */ -public final class FirewallRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-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(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteSamples.java deleted file mode 100644 index 77e5e69ca4a3..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for FirewallRules Delete. */ -public final class FirewallRulesDeleteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetSamples.java deleted file mode 100644 index 853bfe5a56f9..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for FirewallRules Get. */ -public final class FirewallRulesGetSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json - */ - /** - * Sample code: Get a firewall rule. - * - * @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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerSamples.java deleted file mode 100644 index fd00664fab19..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerSamples.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; - -/** Samples for FirewallRules ListByServer. */ -public final class FirewallRulesListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json - */ - /** - * Sample code: List all firewall rules in a server. - * - * @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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java deleted file mode 100644 index d38883b66073..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for GetPrivateDnsZoneSuffix Execute. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json - */ - /** - * Sample code: GetPrivateDnsZoneSuffix. - * - * @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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListSamples.java deleted file mode 100644 index a71984ac15fe..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for LocationBasedCapabilities List. */ -public final class LocationBasedCapabilitiesListSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json - */ - /** - * Sample code: CapabilitiesList. - * - * @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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListSamples.java deleted file mode 100644 index 6c9412e34166..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json - */ - /** - * Sample code: OperationList. - * - * @param manager Entry point to MySqlManager. - */ - public static void operationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6ea9d84ee866 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// 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.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to MySqlManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingFlexibleServer("Default", "test-svr") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")) + .create(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..d8769bb3f6ca --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to MySqlManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .privateEndpointConnections() + .delete("Default", "test-svr", "private-endpoint-connection-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..da03abb10958 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,24 @@ +// 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; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to MySqlManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "Default", "test-svr", "private-endpoint-connection-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java new file mode 100644 index 000000000000..3873e18fe64a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java @@ -0,0 +1,23 @@ +// 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; + +/** Samples for PrivateEndpointConnections ListByServer. */ +public final class PrivateEndpointConnectionsListByServerSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAServer( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .privateEndpointConnections() + .listByServerWithResponse("Default", "test-svr", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java similarity index 52% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java index ba4d000715f4..1ac793c547aa 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java @@ -4,18 +4,18 @@ package com.azure.resourcemanager.mysqlflexibleserver.generated; -/** Samples for LogFiles ListByServer. */ -public final class LogFilesListByServerSamples { +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateLinkResourcesGet.json */ /** - * Sample code: List all server log files for a server. + * Sample code: Gets a private link resource for MySQL. * * @param manager Entry point to MySqlManager. */ - public static void listAllServerLogFilesForAServer( + public static void getsAPrivateLinkResourceForMySQL( com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.logFiles().listByServer("testrg", "mysqltestsvc1", com.azure.core.util.Context.NONE); + manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java similarity index 51% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerSamples.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java index 00b9fc9391a0..667008b74174 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerSamples.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java @@ -4,20 +4,20 @@ package com.azure.resourcemanager.mysqlflexibleserver.generated; -/** Samples for Configurations ListByServer. */ -public final class ConfigurationsListByServerSamples { +/** Samples for PrivateLinkResources ListByServer. */ +public final class PrivateLinkResourcesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/PrivateLink/stable/2023-06-30/examples/PrivateLinkResourcesList.json */ /** - * Sample code: List all configurations for a server. + * Sample code: Gets private link resources for MySQL. * * @param manager Entry point to MySqlManager. */ - public static void listAllConfigurationsForAServer( + public static void getsPrivateLinkResourcesForMySQL( com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager - .configurations() - .listByServer("testrg", "mysqltestserver", null, null, 1, 8, com.azure.core.util.Context.NONE); + .privateLinkResources() + .listByServerWithResponse("Default", "test-svr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ReplicasListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ReplicasListByServerSamples.java deleted file mode 100644 index ae11afaf78b6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ReplicasListByServerSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Replicas ListByServer. */ -public final class ReplicasListByServerSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json - */ - /** - * Sample code: List replicas for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void listReplicasForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.replicas().listByServer("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersCreateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersCreateSamples.java deleted file mode 100644 index 3cbba0731a77..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersCreateSamples.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -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.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.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; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Servers Create. */ -public final class ServersCreateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json - */ - /** - * Sample code: Create a replica server. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAReplicaServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .define("replica-server") - .withRegion("SoutheastAsia") - .withExistingResourceGroup("testgr") - .withCreateMode(CreateMode.REPLICA) - .withSourceServerResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server") - .create(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json - */ - /** - * Sample code: Create a new server. - * - * @param manager Entry point to MySqlManager. - */ - public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .define("mysqltestserver") - .withRegion("southeastasia") - .withExistingResourceGroup("testrg") - .withTags(mapOf("num", "1")) - .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).withGeoRedundantBackup(EnableStatusEnum.DISABLED)) - .withHighAvailability( - new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) - .create(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json - */ - /** - * Sample code: Create a server with byok. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) - throws IOException { - manager - .servers() - .define("mysqltestserver") - .withRegion("southeastasia") - .withExistingResourceGroup("testrg") - .withTags(mapOf("num", "1")) - .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 Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) - .withAdministratorLogin("cloudsa") - .withAdministratorLoginPassword("your_password") - .withVersion(ServerVersion.FIVE_SEVEN) - .withAvailabilityZone("1") - .withCreateMode(CreateMode.DEFAULT) - .withDataEncryption( - new DataEncryption() - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity") - .withPrimaryKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withType(DataEncryptionType.AZURE_KEY_VAULT)) - .withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(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/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json - */ - /** - * Sample code: Create a server as a point in time restore. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAServerAsAPointInTimeRestore( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .define("targetserver") - .withRegion("SoutheastAsia") - .withExistingResourceGroup("TargetResourceGroup") - .withTags(mapOf("num", "1")) - .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") - .withRestorePointInTime(OffsetDateTime.parse("2021-06-24T00:00:37.467Z")) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteSamples.java deleted file mode 100644 index 8b1976e48c45..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Servers Delete. */ -public final class ServersDeleteSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json - */ - /** - * Sample code: Delete a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void deleteAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().delete("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverSamples.java deleted file mode 100644 index e88d37df85c6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Servers Failover. */ -public final class ServersFailoverSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json - */ - /** - * Sample code: Restart a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void restartAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().failover("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersGetByResourceGroupSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersGetByResourceGroupSamples.java deleted file mode 100644 index 077beb7a1c2a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersGetByResourceGroupSamples.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.generated; - -/** Samples for Servers GetByResourceGroup. */ -public final class ServersGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json - */ - /** - * Sample code: Get a server with vnet. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAServerWithVnet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGet.json - */ - /** - * Sample code: Get a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersListByResourceGroupSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersListByResourceGroupSamples.java deleted file mode 100644 index e7681a57173f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersListByResourceGroupSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Servers ListByResourceGroup. */ -public final class ServersListByResourceGroupSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json - */ - /** - * Sample code: List servers in a resource group. - * - * @param manager Entry point to MySqlManager. - */ - public static void listServersInAResourceGroup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().listByResourceGroup("TestGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersListSamples.java deleted file mode 100644 index 26654ceac75f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Servers List. */ -public final class ServersListSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json - */ - /** - * Sample code: List servers in a subscription. - * - * @param manager Entry point to MySqlManager. - */ - public static void listServersInASubscription(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidSamples.java deleted file mode 100644 index b9c14cb05698..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidSamples.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.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; - -/** Samples for Servers ResetGtid. */ -public final class ServersResetGtidSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/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); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartSamples.java deleted file mode 100644 index f2a73a6fd27f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartSamples.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.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; - -/** Samples for Servers Restart. */ -public final class ServersRestartSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerRestart.json - */ - /** - * Sample code: Restart a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void restartAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager - .servers() - .restart( - "TestGroup", - "testserver", - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(60), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartSamples.java deleted file mode 100644 index 96d9bbee285f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Servers Start. */ -public final class ServersStartSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStart.json - */ - /** - * Sample code: Start a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void startAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().start("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopSamples.java deleted file mode 100644 index 5ae806233380..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -/** Samples for Servers Stop. */ -public final class ServersStopSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStop.json - */ - /** - * Sample code: Stop a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void stopAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers().stop("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersUpdateSamples.java deleted file mode 100644 index 1bcbeeccb91b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersUpdateSamples.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.generated; - -import com.azure.core.management.serializer.SerializerFactory; -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.Server; -import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Servers Update. */ -public final class ServersUpdateSamples { - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json - */ - /** - * Sample code: Update server customer maintenance window. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateServerCustomerMaintenanceWindow( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - Server resource = - manager - .servers() - .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withMaintenanceWindow( - new MaintenanceWindow() - .withCustomWindow("Enabled") - .withStartHour(8) - .withStartMinute(0) - .withDayOfWeek(1)) - .apply(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json - */ - /** - * Sample code: Update server with byok. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) - throws IOException { - Server resource = - manager - .servers() - .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .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)))) - .withDataEncryption( - new DataEncryption() - .withPrimaryUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity") - .withPrimaryKeyUri("fakeTokenPlaceholder") - .withGeoBackupUserAssignedIdentityId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity") - .withGeoBackupKeyUri("fakeTokenPlaceholder") - .withType(DataEncryptionType.AZURE_KEY_VAULT)) - .apply(); - } - - /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json - */ - /** - * Sample code: Update a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - Server resource = - manager - .servers() - .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)) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java deleted file mode 100644 index 088aed1629bf..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"dznrbtcqq\",\"sid\":\"qglhq\",\"tenantId\":\"ufo\",\"identityResourceId\":\"jywif\"},\"id\":\"esaagdfm\",\"name\":\"lzl\",\"type\":\"j\"}],\"nextLink\":\"ifkwmrvktsizntoc\"}") - .toObject(AdministratorListResult.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); - Assertions.assertEquals("dznrbtcqq", model.value().get(0).login()); - Assertions.assertEquals("qglhq", model.value().get(0).sid()); - Assertions.assertEquals("ufo", model.value().get(0).tenantId()); - Assertions.assertEquals("jywif", model.value().get(0).identityResourceId()); - Assertions.assertEquals("ifkwmrvktsizntoc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorListResult model = - new AdministratorListResult() - .withValue( - Arrays - .asList( - new AzureADAdministratorInner() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("dznrbtcqq") - .withSid("qglhq") - .withTenantId("ufo") - .withIdentityResourceId("jywif"))) - .withNextLink("ifkwmrvktsizntoc"); - model = BinaryData.fromObject(model).toObject(AdministratorListResult.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); - Assertions.assertEquals("dznrbtcqq", model.value().get(0).login()); - Assertions.assertEquals("qglhq", model.value().get(0).sid()); - Assertions.assertEquals("ufo", model.value().get(0).tenantId()); - Assertions.assertEquals("jywif", model.value().get(0).identityResourceId()); - Assertions.assertEquals("ifkwmrvktsizntoc", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java deleted file mode 100644 index 8f3b2a85142c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.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.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdministratorProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorProperties model = - BinaryData - .fromString( - "{\"administratorType\":\"ActiveDirectory\",\"login\":\"muf\",\"sid\":\"wnoi\",\"tenantId\":\"wlrxyb\",\"identityResourceId\":\"oqijgkdmbpaz\"}") - .toObject(AdministratorProperties.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("muf", model.login()); - Assertions.assertEquals("wnoi", model.sid()); - Assertions.assertEquals("wlrxyb", model.tenantId()); - Assertions.assertEquals("oqijgkdmbpaz", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorProperties model = - new AdministratorProperties() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("muf") - .withSid("wnoi") - .withTenantId("wlrxyb") - .withIdentityResourceId("oqijgkdmbpaz"); - model = BinaryData.fromObject(model).toObject(AdministratorProperties.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("muf", model.login()); - Assertions.assertEquals("wnoi", model.sid()); - Assertions.assertEquals("wlrxyb", model.tenantId()); - Assertions.assertEquals("oqijgkdmbpaz", model.identityResourceId()); - } -} 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 c8d38d73a0ad..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.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.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 a39b4423e33f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"n\",\"sid\":\"bpzkafkuwbc\",\"tenantId\":\"wbme\",\"identityResourceId\":\"seyvj\"},\"id\":\"rts\",\"name\":\"hspkdeemao\",\"type\":\"mx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("azqugxywpmueefj", "wfqkquj") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("nobglaocq") - .withSid("ccm") - .withTenantId("udxytlmoyrx") - .withIdentityResourceId("fudwpznt") - .create(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("n", response.login()); - Assertions.assertEquals("bpzkafkuwbc", response.sid()); - Assertions.assertEquals("wbme", response.tenantId()); - Assertions.assertEquals("seyvj", 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 0abb99561fb4..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "vlopwiyighx", - "kdwzbaiuebbaumny", - 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 a986bf6c2462..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"esap\",\"sid\":\"rdqmhjjdhtldwkyz\",\"tenantId\":\"utknc\",\"identityResourceId\":\"cwsvlxotog\"},\"id\":\"rupqsxvnmicy\",\"name\":\"vce\",\"type\":\"vei\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "ped", "ojnabckhsmtxpsie", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("esap", response.login()); - Assertions.assertEquals("rdqmhjjdhtldwkyz", response.sid()); - Assertions.assertEquals("utknc", response.tenantId()); - Assertions.assertEquals("cwsvlxotog", 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 f61a8acf8b86..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"wpn\",\"sid\":\"t\",\"tenantId\":\"nermcl\",\"identityResourceId\":\"lphox\"},\"id\":\"crpab\",\"name\":\"ye\",\"type\":\"sbj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("ovnotyfjfcnjbkcn", "dhbt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.iterator().next().administratorType()); - Assertions.assertEquals("wpn", response.iterator().next().login()); - Assertions.assertEquals("t", response.iterator().next().sid()); - Assertions.assertEquals("nermcl", response.iterator().next().tenantId()); - Assertions.assertEquals("lphox", 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 80663d6b1251..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.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.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\":\"CollatedFormat\"}}") - .toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportRequest model = - new BackupAndExportRequest() - .withBackupSettings( - new BackupSettings() - .withBackupName("ixjsprozvcputeg") - .withBackupFormat(BackupFormat.COLLATED_FORMAT)) - .withTargetDetails(new BackupStoreDetails()); - model = BinaryData.fromObject(model).toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java deleted file mode 100644 index e0b534adfa36..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseInner model = - BinaryData - .fromString( - "{\"status\":\"CancelInProgress\",\"startTime\":\"2021-01-15T00:39:28Z\",\"endTime\":\"2021-04-04T07:45:50Z\",\"percentComplete\":13.198921536177277,\"properties\":{\"datasourceSizeInBytes\":8699509419424523906,\"dataTransferredInBytes\":7670793912698215607,\"backupMetadata\":\"jdpvwryo\"},\"id\":\"soacctazakl\",\"name\":\"lahbcryff\",\"type\":\"fdosyg\"}") - .toObject(BackupAndExportResponseInner.class); - Assertions.assertEquals(OperationStatus.CANCEL_IN_PROGRESS, model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T00:39:28Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T07:45:50Z"), model.endTime()); - Assertions.assertEquals(13.198921536177277D, model.percentComplete()); - Assertions.assertEquals(8699509419424523906L, model.datasourceSizeInBytes()); - Assertions.assertEquals(7670793912698215607L, model.dataTransferredInBytes()); - Assertions.assertEquals("jdpvwryo", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseInner model = - new BackupAndExportResponseInner() - .withStatus(OperationStatus.CANCEL_IN_PROGRESS) - .withStartTime(OffsetDateTime.parse("2021-01-15T00:39:28Z")) - .withEndTime(OffsetDateTime.parse("2021-04-04T07:45:50Z")) - .withPercentComplete(13.198921536177277D) - .withDatasourceSizeInBytes(8699509419424523906L) - .withDataTransferredInBytes(7670793912698215607L) - .withBackupMetadata("jdpvwryo"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseInner.class); - Assertions.assertEquals(OperationStatus.CANCEL_IN_PROGRESS, model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T00:39:28Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T07:45:50Z"), model.endTime()); - Assertions.assertEquals(13.198921536177277D, model.percentComplete()); - Assertions.assertEquals(8699509419424523906L, model.datasourceSizeInBytes()); - Assertions.assertEquals(7670793912698215607L, model.dataTransferredInBytes()); - Assertions.assertEquals("jdpvwryo", model.backupMetadata()); - } -} 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 ebbcadca8757..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.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.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\":4700894301237220319,\"dataTransferredInBytes\":1611067142281819203,\"backupMetadata\":\"hmsbzjhcrzevdp\"}") - .toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(4700894301237220319L, model.datasourceSizeInBytes()); - Assertions.assertEquals(1611067142281819203L, model.dataTransferredInBytes()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseProperties model = - new BackupAndExportResponseProperties() - .withDatasourceSizeInBytes(4700894301237220319L) - .withDataTransferredInBytes(1611067142281819203L) - .withBackupMetadata("hmsbzjhcrzevdp"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(4700894301237220319L, model.datasourceSizeInBytes()); - Assertions.assertEquals(1611067142281819203L, model.dataTransferredInBytes()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java deleted file mode 100644 index aa66ee2d20f2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupAndExportsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"status\":\"Failed\",\"startTime\":\"2021-05-12T14:09:32Z\",\"endTime\":\"2021-06-10T19:37:21Z\",\"percentComplete\":85.74714071493332,\"properties\":{\"datasourceSizeInBytes\":6987699562222584934,\"dataTransferredInBytes\":4063358469478582470,\"backupMetadata\":\"bpbewtghfgb\"},\"id\":\"gw\",\"name\":\"zvlvqhjkbegib\",\"type\":\"nmxiebwwaloayqc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BackupAndExportResponse response = - manager - .backupAndExports() - .create( - "xujznbmpowu", - "przqlveu", - new BackupAndExportRequest() - .withBackupSettings( - new BackupSettings().withBackupName("lupj").withBackupFormat(BackupFormat.COLLATED_FORMAT)) - .withTargetDetails(new BackupStoreDetails()), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OperationStatus.FAILED, response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-12T14:09:32Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T19:37:21Z"), response.endTime()); - Assertions.assertEquals(85.74714071493332D, response.percentComplete()); - Assertions.assertEquals(6987699562222584934L, response.datasourceSizeInBytes()); - Assertions.assertEquals(4063358469478582470L, response.dataTransferredInBytes()); - Assertions.assertEquals("bpbewtghfgb", response.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 570f099b4122..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupAndExportsValidateBackupWithResponseMockTests { - @Test - public void testValidateBackupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"properties\":{\"numberOfContainers\":1242740761}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("wrtz", "uzgwyzmhtx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1242740761, 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 7937d0199305..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.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.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\":\"CollatedFormat\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model = - new BackupRequestBase() - .withBackupSettings( - new BackupSettings().withBackupName("mfdatscmdvpj").withBackupFormat(BackupFormat.COLLATED_FORMAT)); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, 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 4bede4e9d10a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.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.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\":\"CollatedFormat\"}") - .toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = - new BackupSettings().withBackupName("suuv").withBackupFormat(BackupFormat.COLLATED_FORMAT); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, 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 5df0c431be49..000000000000 --- 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 deleted file mode 100644 index c2641e8df5e8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Backup; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import org.junit.jupiter.api.Assertions; - -public final class BackupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Backup model = - BinaryData - .fromString( - "{\"backupRetentionDays\":227486860,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-01-07T23:05:24Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(227486860, model.backupRetentionDays()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model = - new Backup().withBackupRetentionDays(227486860).withGeoRedundantBackup(EnableStatusEnum.DISABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(227486860, 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 deleted file mode 100644 index cc8bf8daf5c1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"backupType\":\"ooxdjebwpuc\",\"completedTime\":\"2021-03-31T11:05:30Z\",\"source\":\"ovbvmeueciv\"},\"id\":\"zceuojgjrw\",\"name\":\"ueiotwmcdyt\",\"type\":\"x\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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() - .getWithResponse("urqhaka", "hashsfwxosow", "xcug", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ooxdjebwpuc", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T11:05:30Z"), response.completedTime()); - Assertions.assertEquals("ovbvmeueciv", 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 deleted file mode 100644 index dd719234c2a2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"backupType\":\"isk\",\"completedTime\":\"2021-05-28T01:48:43Z\",\"source\":\"py\"},\"id\":\"klwndnhjdauwhv\",\"name\":\"l\",\"type\":\"zbtd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.backups().listByServer("it", "nrjawgqwg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("isk", response.iterator().next().backupType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-28T01:48:43Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("py", 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 ca4d6c5e4f7c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"backupType\":\"pvfadmwsrcr\",\"completedTime\":\"2021-06-09T13:42:27Z\",\"source\":\"vgomz\"},\"id\":\"misgwbnb\",\"name\":\"e\",\"type\":\"dawkzbali\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("gkvtmelmqkrhah", "ljuahaquhcdh", "duala", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pvfadmwsrcr", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T13:42:27Z"), response.completedTime()); - Assertions.assertEquals("vgomz", 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 deleted file mode 100644 index c3e9c99e5e1a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.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.CapabilitiesListResult; - -public final class CapabilitiesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitiesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"zone\":\"jcrcczsqpjhvmda\",\"supportedHAMode\":[\"ysou\",\"q\"],\"supportedGeoBackupRegions\":[\"noae\"],\"supportedFlexibleServerEditions\":[]}],\"nextLink\":\"yhltrpmopjmcm\"}") - .toObject(CapabilitiesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesListResult model = new CapabilitiesListResult(); - model = BinaryData.fromObject(model).toObject(CapabilitiesListResult.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 deleted file mode 100644 index 431b825bd161..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.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.fluent.models.CapabilityPropertiesInner; - -public final class CapabilityPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityPropertiesInner model = - BinaryData - .fromString( - "{\"zone\":\"u\",\"supportedHAMode\":[\"hfuiuaodsfc\",\"kvxod\",\"uozmyzydagfua\",\"bezy\"],\"supportedGeoBackupRegions\":[\"kktwhrdxw\",\"ywqsmbsurexim\",\"ryocfsfksymdd\"],\"supportedFlexibleServerEditions\":[{\"name\":\"i\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]}]}") - .toObject(CapabilityPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesInner model = new CapabilityPropertiesInner(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesInner.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 deleted file mode 100644 index 6a60ca5ef57e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"message\":\"eptra\",\"nameAvailable\":false,\"reason\":\"zwl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilities() - .executeWithResponse( - "xiilivpdtiirqt", - new NameAvailabilityRequest().withName("qoaxoruzfgs").withType("yfxrx"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eptra", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("zwl", 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 deleted file mode 100644 index ef6277d6f759..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"message\":\"bw\",\"nameAvailable\":false,\"reason\":\"emmsbvdkc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilityWithoutLocations() - .executeWithResponse( - new NameAvailabilityRequest().withName("nwxuqlcvydyp").withType("dooaojkniodko"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bw", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("emmsbvdkc", 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 deleted file mode 100644 index 777d65361216..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"dfnbyxbaaabjyv\",\"subscriptionId\":\"ffimrzrtuzqogsex\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"dnw\",\"usage\":8846945468622284044},{\"subnetName\":\"zsyyceuzso\",\"usage\":8701091086223812338},{\"subnetName\":\"pfrxtrthzvay\",\"usage\":7184151913556268269},{\"subnetName\":\"brqubp\",\"usage\":134576264669262403}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualNetworkSubnetUsageResult response = - manager - .checkVirtualNetworkSubnetUsages() - .executeWithResponse( - "qmzqalkrmnjijpx", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("q"), - 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 deleted file mode 100644 index 31e0105b4412..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationForBatchUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForBatchUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForBatchUpdateProperties model = - BinaryData - .fromString("{\"value\":\"ftyxolniw\",\"source\":\"cukjf\"}") - .toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("ftyxolniw", model.value()); - Assertions.assertEquals("cukjf", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForBatchUpdateProperties model = - new ConfigurationForBatchUpdateProperties().withValue("ftyxolniw").withSource("cukjf"); - model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("ftyxolniw", model.value()); - Assertions.assertEquals("cukjf", 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 deleted file mode 100644 index 86f0f887d506..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.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.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForBatchUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForBatchUpdate model = - BinaryData - .fromString( - "{\"name\":\"ldhugjzzdatqxh\",\"properties\":{\"value\":\"geablgphuticndvk\",\"source\":\"zwyiftyhxhur\"}}") - .toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.name()); - Assertions.assertEquals("geablgphuticndvk", model.value()); - Assertions.assertEquals("zwyiftyhxhur", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForBatchUpdate model = - new ConfigurationForBatchUpdate() - .withName("ldhugjzzdatqxh") - .withValue("geablgphuticndvk") - .withSource("zwyiftyhxhur"); - model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.name()); - Assertions.assertEquals("geablgphuticndvk", model.value()); - Assertions.assertEquals("zwyiftyhxhur", 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 deleted file mode 100644 index 9380677896c7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.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.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationInner model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"qtrgqjbpfzfsinzg\",\"currentValue\":\"cjrwzoxxjtfellu\",\"description\":\"zitonpeqfpjkjl\",\"documentationLink\":\"fpdvhpfxxypi\",\"defaultValue\":\"nmayhuybb\",\"dataType\":\"odepoogin\",\"allowedValues\":\"amiheognarxz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"yevc\",\"name\":\"iqihn\",\"type\":\"un\"}") - .toObject(ConfigurationInner.class); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.value()); - Assertions.assertEquals("cjrwzoxxjtfellu", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationInner model = - new ConfigurationInner() - .withValue("qtrgqjbpfzfsinzg") - .withCurrentValue("cjrwzoxxjtfellu") - .withSource(ConfigurationSource.SYSTEM_DEFAULT); - model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.value()); - Assertions.assertEquals("cjrwzoxxjtfellu", model.currentValue()); - 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 deleted file mode 100644 index fc5d91649ff2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// 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.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; - -public final class ConfigurationListForBatchUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListForBatchUpdate model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"skcqvkocrcjd\",\"properties\":{\"value\":\"nh\",\"source\":\"njbiksqrglssain\"}},{\"name\":\"jwnzlljfmp\",\"properties\":{\"value\":\"bvmgxsabkyqduuji\",\"source\":\"jczdzevndh\"}},{\"name\":\"wpdappdsbdkv\",\"properties\":{\"value\":\"jfeusnh\",\"source\":\"je\"}}],\"resetAllToDefault\":\"True\"}") - .toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("skcqvkocrcjd", model.value().get(0).name()); - Assertions.assertEquals("nh", model.value().get(0).value()); - Assertions.assertEquals("njbiksqrglssain", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.TRUE, model.resetAllToDefault()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListForBatchUpdate model = - new ConfigurationListForBatchUpdate() - .withValue( - Arrays - .asList( - new ConfigurationForBatchUpdate() - .withName("skcqvkocrcjd") - .withValue("nh") - .withSource("njbiksqrglssain"), - new ConfigurationForBatchUpdate() - .withName("jwnzlljfmp") - .withValue("bvmgxsabkyqduuji") - .withSource("jczdzevndh"), - new ConfigurationForBatchUpdate() - .withName("wpdappdsbdkv") - .withValue("jfeusnh") - .withSource("je"))) - .withResetAllToDefault(ResetAllToDefault.TRUE); - model = BinaryData.fromObject(model).toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("skcqvkocrcjd", model.value().get(0).name()); - Assertions.assertEquals("nh", model.value().get(0).value()); - Assertions.assertEquals("njbiksqrglssain", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.TRUE, model.resetAllToDefault()); - } -} 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 deleted file mode 100644 index 2b06e5700905..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"value\":\"xklrypl\",\"currentValue\":\"kbasyypn\",\"description\":\"hsgcbacphejkot\",\"documentationLink\":\"qgoulznd\",\"defaultValue\":\"kwy\",\"dataType\":\"gfgibm\",\"allowedValues\":\"gakeqsr\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"tbciqfouflmm\",\"name\":\"kzsmodm\",\"type\":\"lougpbkw\"},{\"properties\":{\"value\":\"tduqktapspwgcuer\",\"currentValue\":\"mkdo\",\"description\":\"qw\",\"documentationLink\":\"mdgbbjfdd\",\"defaultValue\":\"bmbexppbhtqqro\",\"dataType\":\"p\",\"allowedValues\":\"s\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"yjgzjaoyfhrtxiln\",\"name\":\"rkujy\",\"type\":\"vlejuvfqa\"}],\"nextLink\":\"lyxwjkcprbnwbx\"}") - .toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("xklrypl", model.value().get(0).value()); - Assertions.assertEquals("kbasyypn", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("lyxwjkcprbnwbx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResultInner model = - new ConfigurationListResultInner() - .withValue( - Arrays - .asList( - new ConfigurationInner() - .withValue("xklrypl") - .withCurrentValue("kbasyypn") - .withSource(ConfigurationSource.USER_OVERRIDE), - new ConfigurationInner() - .withValue("tduqktapspwgcuer") - .withCurrentValue("mkdo") - .withSource(ConfigurationSource.SYSTEM_DEFAULT))) - .withNextLink("lyxwjkcprbnwbx"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("xklrypl", model.value().get(0).value()); - Assertions.assertEquals("kbasyypn", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("lyxwjkcprbnwbx", 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 deleted file mode 100644 index 9a4bbb46998a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.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.ConfigurationProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationProperties model = - BinaryData - .fromString( - "{\"value\":\"wjzrnfygxgisp\",\"currentValue\":\"vtz\",\"description\":\"ufubl\",\"documentationLink\":\"fxqeof\",\"defaultValue\":\"e\",\"dataType\":\"hqjbasvmsmj\",\"allowedValues\":\"lngsntnbybkzgcwr\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}") - .toObject(ConfigurationProperties.class); - Assertions.assertEquals("wjzrnfygxgisp", model.value()); - Assertions.assertEquals("vtz", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationProperties model = - new ConfigurationProperties() - .withValue("wjzrnfygxgisp") - .withCurrentValue("vtz") - .withSource(ConfigurationSource.USER_OVERRIDE); - model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("wjzrnfygxgisp", model.value()); - Assertions.assertEquals("vtz", model.currentValue()); - 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 deleted file mode 100644 index 50c77450d1f0..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsBatchUpdateMockTests { - @Test - public void testBatchUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"luu\",\"name\":\"dttouwaboekqvkel\",\"type\":\"smv\"}],\"nextLink\":\"wyjsflhhcaalnjix\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationListResult response = - manager - .configurations() - .batchUpdate( - "pjzu", - "e", - new ConfigurationListForBatchUpdate() - .withValue( - Arrays - .asList( - new ConfigurationForBatchUpdate().withName("ltskzbbtd"), - new ConfigurationForBatchUpdate().withName("veekgpwozuhkfp"))) - .withResetAllToDefault(ResetAllToDefault.TRUE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wyjsflhhcaalnjix", response.nextLink()); - } -} 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/ConfigurationsCreateOrUpdateMockTests.java deleted file mode 100644 index 8b43de778fc7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"crsbfovasr\",\"currentValue\":\"v\",\"description\":\"hsqfsubcgjbirxbp\",\"documentationLink\":\"srfbjfdtwss\",\"defaultValue\":\"ftpvjzbexil\",\"dataType\":\"nfqqnvwp\",\"allowedValues\":\"taruoujmkcj\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"wj\",\"name\":\"wgdrjervnaenqp\",\"type\":\"hin\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .define("bpvjymjhx") - .withExistingFlexibleServer("grcfb", "nrmfqjhhk") - .withValue("n") - .withCurrentValue("divkrt") - .withSource(ConfigurationSource.SYSTEM_DEFAULT) - .create(); - - Assertions.assertEquals("crsbfovasr", response.value()); - Assertions.assertEquals("v", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); - } -} 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 deleted file mode 100644 index e16d7c4eb0a7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"qtayri\",\"currentValue\":\"ro\",\"description\":\"bexrmcq\",\"documentationLink\":\"ycnojvknmefqsg\",\"defaultValue\":\"ah\",\"dataType\":\"jyzhpvgq\",\"allowedValues\":\"j\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"xkvugfhzov\",\"name\":\"wjvzunluthnn\",\"type\":\"rnxipei\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .getWithResponse("ts", "vjcbpwxqpsrknf", "guvriuhprwmd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qtayri", response.value()); - Assertions.assertEquals("ro", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, 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 deleted file mode 100644 index 119a7b9b1852..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"value\":\"nalaulppg\",\"currentValue\":\"tpnapnyiropuhpig\",\"description\":\"gylgqgitxmedjvcs\",\"documentationLink\":\"n\",\"defaultValue\":\"wncwzzhxgktrmg\",\"dataType\":\"napkteoellw\",\"allowedValues\":\"fdygpfqbuaceopz\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"pcqeqx\",\"name\":\"lzdahzxctobgbkdm\",\"type\":\"izpost\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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 - .configurations() - .listByServer( - "sxyawjoyaqcs", - "yjpkiidzyexz", - "eli", - "hnrztfol", - 1201064167, - 315550434, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nalaulppg", response.iterator().next().value()); - Assertions.assertEquals("tpnapnyiropuhpig", response.iterator().next().currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.iterator().next().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 deleted file mode 100644 index 3cf991801521..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"charset\":\"tbvpysszdnru\",\"collation\":\"guhmuouqfpr\"},\"id\":\"wbnguitnwui\",\"name\":\"gazxuf\",\"type\":\"zuckyfi\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("tbvpysszdnru", model.charset()); - Assertions.assertEquals("guhmuouqfpr", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("tbvpysszdnru").withCollation("guhmuouqfpr"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("tbvpysszdnru", model.charset()); - Assertions.assertEquals("guhmuouqfpr", 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 deleted file mode 100644 index d6785f02af91..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.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.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.DatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"charset\":\"dkfthwxmnt\",\"collation\":\"waopvkmijcmmxd\"},\"id\":\"fufsrpymzi\",\"name\":\"nsez\",\"type\":\"xtbzsgfyccsne\"},{\"properties\":{\"charset\":\"wzjeiach\",\"collation\":\"osfln\"},\"id\":\"sfqpteehz\",\"name\":\"vypyqrimzinpv\",\"type\":\"wjdk\"}],\"nextLink\":\"soodqxhcrmnoh\"}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("dkfthwxmnt", model.value().get(0).charset()); - Assertions.assertEquals("waopvkmijcmmxd", model.value().get(0).collation()); - Assertions.assertEquals("soodqxhcrmnoh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = - new DatabaseListResult() - .withValue( - Arrays - .asList( - new DatabaseInner().withCharset("dkfthwxmnt").withCollation("waopvkmijcmmxd"), - new DatabaseInner().withCharset("wzjeiach").withCollation("osfln"))) - .withNextLink("soodqxhcrmnoh"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("dkfthwxmnt", model.value().get(0).charset()); - Assertions.assertEquals("waopvkmijcmmxd", model.value().get(0).collation()); - Assertions.assertEquals("soodqxhcrmnoh", 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 deleted file mode 100644 index 77a0b2d32d0b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.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.DatabaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseProperties model = - BinaryData.fromString("{\"charset\":\"fidfvzw\",\"collation\":\"uht\"}").toObject(DatabaseProperties.class); - Assertions.assertEquals("fidfvzw", model.charset()); - Assertions.assertEquals("uht", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("fidfvzw").withCollation("uht"); - model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("fidfvzw", model.charset()); - Assertions.assertEquals("uht", 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 deleted file mode 100644 index 8388fbdd42c6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"r\",\"collation\":\"dkwobdagx\"},\"id\":\"bqdxbx\",\"name\":\"akbogqxndlkzgxh\",\"type\":\"ripl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .define("nkww") - .withExistingFlexibleServer("d", "lvwiwubmwmbesl") - .withCharset("jflcxog") - .withCollation("konzmnsik") - .create(); - - Assertions.assertEquals("r", response.charset()); - Assertions.assertEquals("dkwobdagx", 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 deleted file mode 100644 index 2f8dba8931b5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.databases().delete("oygmift", "nzdndslgna", "qig", 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 deleted file mode 100644 index e1be42ac7352..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"ccymvaolpsslql\",\"collation\":\"mdnbbglzpswiy\"},\"id\":\"cwyhzdxssa\",\"name\":\"bzmnvdfznud\",\"type\":\"od\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .getWithResponse("nduhavhqlkthum", "qolbgyc", "uie", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ccymvaolpsslql", response.charset()); - Assertions.assertEquals("mdnbbglzpswiy", 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 deleted file mode 100644 index b167cfc09163..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"charset\":\"ucerscdntnevfi\",\"collation\":\"mygtdssls\"},\"id\":\"mweriofzpy\",\"name\":\"semwabnet\",\"type\":\"hhszh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.databases().listByServer("xzb", "cblylpstdbhhxsr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ucerscdntnevfi", response.iterator().next().charset()); - Assertions.assertEquals("mygtdssls", 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 deleted file mode 100644 index 3c525ee6c43b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// 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.DelegatedSubnetUsage; - -public final class DelegatedSubnetUsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelegatedSubnetUsage model = - BinaryData - .fromString("{\"subnetName\":\"tko\",\"usage\":3980056682158656120}") - .toObject(DelegatedSubnetUsage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelegatedSubnetUsage model = new DelegatedSubnetUsage(); - model = BinaryData.fromObject(model).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 deleted file mode 100644 index ffc8b1ccd708..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"startIpAddress\":\"t\",\"endIpAddress\":\"kwh\"},\"id\":\"oifiyipjxsqwpgr\",\"name\":\"bznorcjxvsnby\",\"type\":\"qabnmoc\"}") - .toObject(FirewallRuleInner.class); - Assertions.assertEquals("t", model.startIpAddress()); - Assertions.assertEquals("kwh", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleInner model = new FirewallRuleInner().withStartIpAddress("t").withEndIpAddress("kwh"); - model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("t", model.startIpAddress()); - Assertions.assertEquals("kwh", 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 deleted file mode 100644 index fdef3651c42b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// 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.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRuleListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"idtqajzyu\",\"endIpAddress\":\"pku\"},\"id\":\"krlkhbzhfepg\",\"name\":\"gqexzlocxs\",\"type\":\"paierh\"},{\"properties\":{\"startIpAddress\":\"bcsglumma\",\"endIpAddress\":\"tjaodxobnb\"},\"id\":\"k\",\"name\":\"pxokajionp\",\"type\":\"mexgstxgcp\"},{\"properties\":{\"startIpAddress\":\"dg\",\"endIpAddress\":\"aajrm\"},\"id\":\"jwzrl\",\"name\":\"vmclw\",\"type\":\"ijcoejctb\"}],\"nextLink\":\"qsqsy\"}") - .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("idtqajzyu", model.value().get(0).startIpAddress()); - Assertions.assertEquals("pku", model.value().get(0).endIpAddress()); - Assertions.assertEquals("qsqsy", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = - new FirewallRuleListResult() - .withValue( - Arrays - .asList( - new FirewallRuleInner().withStartIpAddress("idtqajzyu").withEndIpAddress("pku"), - new FirewallRuleInner().withStartIpAddress("bcsglumma").withEndIpAddress("tjaodxobnb"), - new FirewallRuleInner().withStartIpAddress("dg").withEndIpAddress("aajrm"))) - .withNextLink("qsqsy"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("idtqajzyu", model.value().get(0).startIpAddress()); - Assertions.assertEquals("pku", model.value().get(0).endIpAddress()); - Assertions.assertEquals("qsqsy", 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 deleted file mode 100644 index 9f429a2a233e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleProperties; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleProperties model = - BinaryData - .fromString("{\"startIpAddress\":\"cyshurzafbljjgp\",\"endIpAddress\":\"toqcjmklja\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("cyshurzafbljjgp", model.startIpAddress()); - Assertions.assertEquals("toqcjmklja", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleProperties model = - new FirewallRuleProperties().withStartIpAddress("cyshurzafbljjgp").withEndIpAddress("toqcjmklja"); - model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("cyshurzafbljjgp", model.startIpAddress()); - Assertions.assertEquals("toqcjmklja", 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 deleted file mode 100644 index 0e069a2df562..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"startIpAddress\":\"sotbob\",\"endIpAddress\":\"dopcjwvnh\"},\"id\":\"d\",\"name\":\"mgxcxrslpm\",\"type\":\"twuoegrpkhjwni\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .define("pfuflrw") - .withExistingFlexibleServer("iiswacffgdkzze", "kfvhqcrailvpn") - .withStartIpAddress("mh") - .withEndIpAddress("lxyjr") - .create(); - - Assertions.assertEquals("sotbob", response.startIpAddress()); - Assertions.assertEquals("dopcjwvnh", 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 deleted file mode 100644 index 0c6d516b6d1a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.firewallRules().delete("podxunkb", "bxmubyynt", "lrb", 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 deleted file mode 100644 index 1d493a48d042..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"startIpAddress\":\"xbmp\",\"endIpAddress\":\"cjefuzmu\"},\"id\":\"bttdumorppxe\",\"name\":\"mnzb\",\"type\":\"bhjpglkfgohdne\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .getWithResponse("tkoievseotgq", "l", "tmuwlauwzi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xbmp", response.startIpAddress()); - Assertions.assertEquals("cjefuzmu", 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 deleted file mode 100644 index 40644a5e5414..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"startIpAddress\":\"fikdowwqu\",\"endIpAddress\":\"v\"},\"id\":\"xclvit\",\"name\":\"hqzonosggbhcoh\",\"type\":\"wdsjnkalju\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.firewallRules().listByServer("el", "phsdyhto", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fikdowwqu", response.iterator().next().startIpAddress()); - Assertions.assertEquals("v", 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 12dfe3403df6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":[\"fpl\",\"mg\",\"xnkjzkdesl\"]}") - .toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("fpl", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FullBackupStoreDetails model = - new FullBackupStoreDetails().withSasUriList(Arrays.asList("fpl", "mg", "xnkjzkdesl")); - model = BinaryData.fromObject(model).toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("fpl", 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 deleted file mode 100644 index b8fee4bec6c8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.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.GetPrivateDnsZoneSuffixResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class GetPrivateDnsZoneSuffixResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = - BinaryData - .fromString("{\"privateDnsZoneSuffix\":\"yp\"}") - .toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("yp", model.privateDnsZoneSuffix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = - new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("yp"); - model = BinaryData.fromObject(model).toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("yp", 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 deleted file mode 100644 index eb721b56b334..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"privateDnsZoneSuffix\":\"dtjinfw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GetPrivateDnsZoneSuffixResponse response = - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("dtjinfw", 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 deleted file mode 100644 index 2754e3f344f2..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailability model = - BinaryData - .fromString( - "{\"mode\":\"Disabled\",\"state\":\"Healthy\",\"standbyAvailabilityZone\":\"vynhzgpphrcg\"}") - .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("vynhzgpphrcg", model.standbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailability model = - new HighAvailability().withMode(HighAvailabilityMode.DISABLED).withStandbyAvailabilityZone("vynhzgpphrcg"); - model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("vynhzgpphrcg", model.standbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java deleted file mode 100644 index 424fe9937c3a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.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.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; -import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"icxm\",\"tenantId\":\"iwqvhkh\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"og\":\"datadtopbob\",\"w\":\"datam\",\"a\":\"dataa\"}}") - .toObject(Identity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = - new Identity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("og", "datadtopbob", "w", "datam", "a", "dataa")); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/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 deleted file mode 100644 index 9b796604d251..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilityProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitiesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"zone\":\"jwosytxitcskfck\",\"supportedHAMode\":[\"miekkezzikhlyfjh\",\"gqggebdunygae\",\"idb\"],\"supportedGeoBackupRegions\":[\"t\",\"xllrxcyjm\"],\"supportedFlexibleServerEditions\":[{\"name\":\"uvarmywdmjsjq\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"xrwlyc\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"xkgymareqnajxqu\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"ubeddg\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]}]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.locationBasedCapabilities().list("jrvxaglrv", 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 49711026fbb5..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.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.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\":4120497332139202867,\"createdTime\":\"2021-11-07T06:02Z\",\"type\":\"ynnaam\",\"lastModifiedTime\":\"2021-01-19T03:02:26Z\",\"url\":\"eh\"},\"id\":\"qsc\",\"name\":\"eypvhezrkg\",\"type\":\"hcjrefovgmk\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(4120497332139202867L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T06:02Z"), model.createdTime()); - Assertions.assertEquals("ynnaam", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T03:02:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("eh", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = - new LogFileInner() - .withSizeInKB(4120497332139202867L) - .withCreatedTime(OffsetDateTime.parse("2021-11-07T06:02Z")) - .withTypePropertiesType("ynnaam") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-19T03:02:26Z")) - .withUrl("eh"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(4120497332139202867L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T06:02Z"), model.createdTime()); - Assertions.assertEquals("ynnaam", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T03:02:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("eh", 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 dcf3be0f4c4a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.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.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\":8576241637170958939,\"createdTime\":\"2021-04-30T01:01:25Z\",\"type\":\"ohctbqvudwx\",\"lastModifiedTime\":\"2021-03-23T22:55:01Z\",\"url\":\"vo\"},\"id\":\"ujjugwdkcglh\",\"name\":\"lazjdyggdtjixhbk\",\"type\":\"ofqweykhmenevfye\"}],\"nextLink\":\"whybcib\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(8576241637170958939L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T01:01:25Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("ohctbqvudwx", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T22:55:01Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("vo", model.value().get(0).url()); - Assertions.assertEquals("whybcib", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = - new LogFileListResult() - .withValue( - Arrays - .asList( - new LogFileInner() - .withSizeInKB(8576241637170958939L) - .withCreatedTime(OffsetDateTime.parse("2021-04-30T01:01:25Z")) - .withTypePropertiesType("ohctbqvudwx") - .withLastModifiedTime(OffsetDateTime.parse("2021-03-23T22:55:01Z")) - .withUrl("vo"))) - .withNextLink("whybcib"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(8576241637170958939L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T01:01:25Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("ohctbqvudwx", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T22:55:01Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("vo", model.value().get(0).url()); - Assertions.assertEquals("whybcib", 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 d33018466d0a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.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.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\":6110578012532965907,\"createdTime\":\"2021-08-20T18:32:02Z\",\"type\":\"xyqj\",\"lastModifiedTime\":\"2021-03-22T06:48:14Z\",\"url\":\"t\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(6110578012532965907L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T18:32:02Z"), model.createdTime()); - Assertions.assertEquals("xyqj", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T06:48:14Z"), model.lastModifiedTime()); - Assertions.assertEquals("t", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = - new LogFileProperties() - .withSizeInKB(6110578012532965907L) - .withCreatedTime(OffsetDateTime.parse("2021-08-20T18:32:02Z")) - .withType("xyqj") - .withLastModifiedTime(OffsetDateTime.parse("2021-03-22T06:48:14Z")) - .withUrl("t"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(6110578012532965907L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T18:32:02Z"), model.createdTime()); - Assertions.assertEquals("xyqj", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T06:48:14Z"), model.lastModifiedTime()); - Assertions.assertEquals("t", 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 3909ae1b9dcf..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// 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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LogFilesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"sizeInKB\":2787297702458911120,\"createdTime\":\"2021-01-04T11:20:29Z\",\"type\":\"wneaiv\",\"lastModifiedTime\":\"2021-02-14T15:05:44Z\",\"url\":\"elpcirelsfeaenwa\"},\"id\":\"atklddxbjhwuaa\",\"name\":\"oz\",\"type\":\"osphyoul\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("mszkkfo", "rey", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(2787297702458911120L, response.iterator().next().sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T11:20:29Z"), response.iterator().next().createdTime()); - Assertions.assertEquals("wneaiv", response.iterator().next().typePropertiesType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-14T15:05:44Z"), response.iterator().next().lastModifiedTime()); - Assertions.assertEquals("elpcirelsfeaenwa", response.iterator().next().url()); - } -} 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 deleted file mode 100644 index 318924cd151b..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.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.MaintenanceWindow; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindow model = - BinaryData - .fromString( - "{\"customWindow\":\"jqabcypmivkwlzuv\",\"startHour\":1436675141,\"startMinute\":1704525857,\"dayOfWeek\":1351999022}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("jqabcypmivkwlzuv", model.customWindow()); - Assertions.assertEquals(1436675141, model.startHour()); - Assertions.assertEquals(1704525857, model.startMinute()); - Assertions.assertEquals(1351999022, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = - new MaintenanceWindow() - .withCustomWindow("jqabcypmivkwlzuv") - .withStartHour(1436675141) - .withStartMinute(1704525857) - .withDayOfWeek(1351999022); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("jqabcypmivkwlzuv", model.customWindow()); - Assertions.assertEquals(1436675141, model.startHour()); - Assertions.assertEquals(1704525857, model.startMinute()); - Assertions.assertEquals(1351999022, model.dayOfWeek()); - } -} 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 deleted file mode 100644 index 30e4a72af992..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityInner model = - BinaryData - .fromString("{\"message\":\"azyxoegukg\",\"nameAvailable\":false,\"reason\":\"ucgygevqz\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals("azyxoegukg", model.message()); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("ucgygevqz", model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = - new NameAvailabilityInner().withMessage("azyxoegukg").withNameAvailable(false).withReason("ucgygevqz"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals("azyxoegukg", model.message()); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("ucgygevqz", 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 deleted file mode 100644 index 05d780a465c7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.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.NameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"uknvudwti\",\"type\":\"bldngkpoc\"}") - .toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("uknvudwti", model.name()); - Assertions.assertEquals("bldngkpoc", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityRequest model = new NameAvailabilityRequest().withName("uknvudwti").withType("bldngkpoc"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("uknvudwti", model.name()); - Assertions.assertEquals("bldngkpoc", 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 deleted file mode 100644 index 15f70b1ae7b8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.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.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Network model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Disabled\",\"delegatedSubnetResourceId\":\"cpecfvmmcoofs\",\"privateDnsZoneResourceId\":\"zevgb\"}") - .toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("cpecfvmmcoofs", model.delegatedSubnetResourceId()); - Assertions.assertEquals("zevgb", model.privateDnsZoneResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Network model = - new Network() - .withPublicNetworkAccess(EnableStatusEnum.DISABLED) - .withDelegatedSubnetResourceId("cpecfvmmcoofs") - .withPrivateDnsZoneResourceId("zevgb"); - model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("cpecfvmmcoofs", model.delegatedSubnetResourceId()); - Assertions.assertEquals("zevgb", 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 deleted file mode 100644 index d8c88cd362af..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.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.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"vplwzbhv\",\"resource\":\"u\",\"operation\":\"osvmk\",\"description\":\"sxqu\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("vplwzbhv", model.provider()); - Assertions.assertEquals("u", model.resource()); - Assertions.assertEquals("osvmk", model.operation()); - Assertions.assertEquals("sxqu", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("vplwzbhv") - .withResource("u") - .withOperation("osvmk") - .withDescription("sxqu"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("vplwzbhv", model.provider()); - Assertions.assertEquals("u", model.resource()); - Assertions.assertEquals("osvmk", model.operation()); - Assertions.assertEquals("sxqu", 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 deleted file mode 100644 index 0ec343fed873..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"nrs\",\"display\":{\"provider\":\"qidybyx\",\"resource\":\"fclhaaxdbabphlwr\",\"operation\":\"fkts\",\"description\":\"sucocmnyyazttbtw\"},\"origin\":\"qpuedckzywbiex\",\"properties\":{\"qwalmuzyoxaepd\":\"datayueaxibxujwb\",\"d\":\"datazjancuxr\",\"dbpgnxytxhp\":\"databavxbniwdjswzt\",\"lcuhxwtctyqiklb\":\"dataxbzpfzab\"}}") - .toObject(OperationInner.class); - Assertions.assertEquals("nrs", model.name()); - Assertions.assertEquals("qidybyx", model.display().provider()); - Assertions.assertEquals("fclhaaxdbabphlwr", model.display().resource()); - Assertions.assertEquals("fkts", model.display().operation()); - Assertions.assertEquals("sucocmnyyazttbtw", model.display().description()); - Assertions.assertEquals("qpuedckzywbiex", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = - new OperationInner() - .withName("nrs") - .withDisplay( - new OperationDisplay() - .withProvider("qidybyx") - .withResource("fclhaaxdbabphlwr") - .withOperation("fkts") - .withDescription("sucocmnyyazttbtw")) - .withOrigin("qpuedckzywbiex") - .withProperties( - mapOf( - "qwalmuzyoxaepd", - "datayueaxibxujwb", - "d", - "datazjancuxr", - "dbpgnxytxhp", - "databavxbniwdjswzt", - "lcuhxwtctyqiklb", - "dataxbzpfzab")); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("nrs", model.name()); - Assertions.assertEquals("qidybyx", model.display().provider()); - Assertions.assertEquals("fclhaaxdbabphlwr", model.display().resource()); - Assertions.assertEquals("fkts", model.display().operation()); - Assertions.assertEquals("sucocmnyyazttbtw", model.display().description()); - Assertions.assertEquals("qpuedckzywbiex", model.origin()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/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 deleted file mode 100644 index 8874fc9a19c1..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"izcdrqjsd\",\"display\":{\"provider\":\"nfyhx\",\"resource\":\"oejzi\",\"operation\":\"ifsjttgzfbishcb\",\"description\":\"ajdeyeamdphaga\"},\"origin\":\"buxwgip\",\"properties\":{\"nkixzbinj\":\"datanowkgshw\",\"tmryw\":\"datapu\"}},{\"name\":\"zoqftiyqzrnkcqvy\",\"display\":{\"provider\":\"hzls\",\"resource\":\"ohoqqnwvlryav\",\"operation\":\"heun\",\"description\":\"qhgyxzkonocukok\"},\"origin\":\"axuconuq\",\"properties\":{\"rmjmwvvjektc\":\"datakbeype\",\"frzpwvlqdqgb\":\"datasenhwlrs\"}},{\"name\":\"ylihkaetckt\",\"display\":{\"provider\":\"ivfsnk\",\"resource\":\"uctqhjfbe\",\"operation\":\"jcxerfuwu\",\"description\":\"txfvjrbirph\"},\"origin\":\"pcyvahfnljkyqx\",\"properties\":{\"jljyoxgv\":\"dataujqgidok\",\"szzhbijhtxfvgxbf\":\"dataltbgsncghkj\",\"ec\":\"datamxnehmp\",\"gr\":\"datagodebfqkkrbmpu\"}},{\"name\":\"flz\",\"display\":{\"provider\":\"xzpuzycisp\",\"resource\":\"zahmgkbrpyydhibn\",\"operation\":\"qkpikadrgvtqagnb\",\"description\":\"nhijggmebfsi\"},\"origin\":\"butr\",\"properties\":{\"zmhjrunmp\":\"datana\",\"nkxmyskpbhenbtk\":\"datattdbhrbnl\"}}],\"nextLink\":\"ywn\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("izcdrqjsd", model.value().get(0).name()); - Assertions.assertEquals("nfyhx", model.value().get(0).display().provider()); - Assertions.assertEquals("oejzi", model.value().get(0).display().resource()); - Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).display().operation()); - Assertions.assertEquals("ajdeyeamdphaga", model.value().get(0).display().description()); - Assertions.assertEquals("buxwgip", model.value().get(0).origin()); - Assertions.assertEquals("ywn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = - new OperationListResult() - .withValue( - Arrays - .asList( - new OperationInner() - .withName("izcdrqjsd") - .withDisplay( - new OperationDisplay() - .withProvider("nfyhx") - .withResource("oejzi") - .withOperation("ifsjttgzfbishcb") - .withDescription("ajdeyeamdphaga")) - .withOrigin("buxwgip") - .withProperties(mapOf("nkixzbinj", "datanowkgshw", "tmryw", "datapu")), - new OperationInner() - .withName("zoqftiyqzrnkcqvy") - .withDisplay( - new OperationDisplay() - .withProvider("hzls") - .withResource("ohoqqnwvlryav") - .withOperation("heun") - .withDescription("qhgyxzkonocukok")) - .withOrigin("axuconuq") - .withProperties(mapOf("rmjmwvvjektc", "datakbeype", "frzpwvlqdqgb", "datasenhwlrs")), - new OperationInner() - .withName("ylihkaetckt") - .withDisplay( - new OperationDisplay() - .withProvider("ivfsnk") - .withResource("uctqhjfbe") - .withOperation("jcxerfuwu") - .withDescription("txfvjrbirph")) - .withOrigin("pcyvahfnljkyqx") - .withProperties( - mapOf( - "jljyoxgv", - "dataujqgidok", - "szzhbijhtxfvgxbf", - "dataltbgsncghkj", - "ec", - "datamxnehmp", - "gr", - "datagodebfqkkrbmpu")), - new OperationInner() - .withName("flz") - .withDisplay( - new OperationDisplay() - .withProvider("xzpuzycisp") - .withResource("zahmgkbrpyydhibn") - .withOperation("qkpikadrgvtqagnb") - .withDescription("nhijggmebfsi")) - .withOrigin("butr") - .withProperties(mapOf("zmhjrunmp", "datana", "nkxmyskpbhenbtk", "datattdbhrbnl")))) - .withNextLink("ywn"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("izcdrqjsd", model.value().get(0).name()); - Assertions.assertEquals("nfyhx", model.value().get(0).display().provider()); - Assertions.assertEquals("oejzi", model.value().get(0).display().resource()); - Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).display().operation()); - Assertions.assertEquals("ajdeyeamdphaga", model.value().get(0).display().description()); - Assertions.assertEquals("buxwgip", model.value().get(0).origin()); - Assertions.assertEquals("ywn", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/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 deleted file mode 100644 index 25adadc91f09..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"fltkacjv\",\"display\":{\"provider\":\"dlfoakggkfp\",\"resource\":\"ao\",\"operation\":\"ulpqblylsyxkqjn\",\"description\":\"ervtiagxs\"},\"origin\":\"zuempsbzkf\",\"properties\":{\"dxrbuukzcle\":\"datayvpnqicvinvkjj\",\"fn\":\"datayhmlwpaztzp\",\"fz\":\"datackw\",\"feqztppriol\":\"datawhxxbuyqax\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fltkacjv", response.iterator().next().name()); - Assertions.assertEquals("dlfoakggkfp", response.iterator().next().display().provider()); - Assertions.assertEquals("ao", response.iterator().next().display().resource()); - Assertions.assertEquals("ulpqblylsyxkqjn", response.iterator().next().display().operation()); - Assertions.assertEquals("ervtiagxs", response.iterator().next().display().description()); - Assertions.assertEquals("zuempsbzkf", response.iterator().next().origin()); - } -} 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 deleted file mode 100644 index b08a84759d5a..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.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.ServerBackupInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -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\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", 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"); - 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()); - } -} 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 deleted file mode 100644 index 2a912fbd6c1e..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.ServerBackupInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -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\"}") - .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()); - } - - @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"); - 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()); - } -} 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 deleted file mode 100644 index 437ee3b16beb..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.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.ServerBackupProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -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\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", 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"); - 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()); - } -} 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 deleted file mode 100644 index baf7e0704117..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.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.ServerEditionCapability; - -public final class ServerEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"udxorrqn\",\"supportedStorageEditions\":[{\"name\":\"zvyifqrvkdvj\",\"minStorageSize\":3602114313463571295,\"maxStorageSize\":5675151701558960603,\"minBackupRetentionDays\":628578749185712506,\"maxBackupRetentionDays\":524078729547921435},{\"name\":\"n\",\"minStorageSize\":2611651142530368234,\"maxStorageSize\":3827252947498209847,\"minBackupRetentionDays\":9207665581714486982,\"maxBackupRetentionDays\":5624751011195276042}],\"supportedServerVersions\":[{\"name\":\"zb\",\"supportedSkus\":[]},{\"name\":\"ovm\",\"supportedSkus\":[]}]}") - .toObject(ServerEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerEditionCapability model = new ServerEditionCapability(); - model = BinaryData.fromObject(model).toObject(ServerEditionCapability.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 51be22043872..000000000000 --- 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\":\"esnzwde\"}").toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("esnzwde", model.gtidSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerGtidSetParameter model = new ServerGtidSetParameter().withGtidSet("esnzwde"); - model = BinaryData.fromObject(model).toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("esnzwde", 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 deleted file mode 100644 index 93d2ff7db729..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.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.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; -import org.junit.jupiter.api.Assertions; - -public final class ServerRestartParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerRestartParameter model = - BinaryData - .fromString("{\"restartWithFailover\":\"Enabled\",\"maxFailoverSeconds\":1752385169}") - .toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); - Assertions.assertEquals(1752385169, model.maxFailoverSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerRestartParameter model = - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(1752385169); - model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); - Assertions.assertEquals(1752385169, 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 deleted file mode 100644 index db65042c447c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.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.ServerVersionCapability; - -public final class ServerVersionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVersionCapability model = - BinaryData - .fromString( - "{\"name\":\"zjuqkhrsaj\",\"supportedSkus\":[{\"name\":\"ofoskghs\",\"vCores\":7334574875693973004,\"supportedIops\":6549860277400431394,\"supportedMemoryPerVCoreMB\":5129594388409222078}]}") - .toObject(ServerVersionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapability model = new ServerVersionCapability(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapability.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 deleted file mode 100644 index 3b296668c3d6..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().delete("qsluicp", "ggkzzlvmbmpa", 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 deleted file mode 100644 index 617d3370a27c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersFailoverMockTests { - @Test - public void testFailover() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().failover("plsaknynfsynljph", "op", 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 fd8d8099a8f7..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersResetGtidMockTests { - @Test - public void testResetGtid() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "cdpu", - "nzgmwznmabik", - new ServerGtidSetParameter().withGtidSet("orgjhxbldt"), - 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 deleted file mode 100644 index ffe2344ca81f..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersRestartMockTests { - @Test - public void testRestart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .servers() - .restart( - "odlqiyntor", - "ihleos", - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(2014449644), - 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 deleted file mode 100644 index 1e0f887af4d4..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().start("mslyzrpzbchckqqz", "ioxiysuiizyn", 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 deleted file mode 100644 index 68335a94dd40..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().stop("edyatrwyhqmibzyh", "itsmypyyn", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 02c0a3e6c4dc..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.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.SkuCapability; - -public final class SkuCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapability model = - BinaryData - .fromString( - "{\"name\":\"duugidyjr\",\"vCores\":3682891038702940178,\"supportedIops\":7621842593771814376,\"supportedMemoryPerVCoreMB\":122532505466115624}") - .toObject(SkuCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability(); - model = BinaryData.fromObject(model).toObject(SkuCapability.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 deleted file mode 100644 index a8255ad4d5c9..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.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.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\":\"hrzayvvtpgvdf\",\"tier\":\"Burstable\"}").toObject(Sku.class); - Assertions.assertEquals("hrzayvvtpgvdf", model.name()); - Assertions.assertEquals(SkuTier.BURSTABLE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("hrzayvvtpgvdf").withTier(SkuTier.BURSTABLE); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("hrzayvvtpgvdf", model.name()); - Assertions.assertEquals(SkuTier.BURSTABLE, 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 deleted file mode 100644 index f17266284eab..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.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.StorageEditionCapability; - -public final class StorageEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"cspkwlhzdobpxjmf\",\"minStorageSize\":885653517533476770,\"maxStorageSize\":6115186458339394637,\"minBackupRetentionDays\":5158769929678256713,\"maxBackupRetentionDays\":8269509488732598965}") - .toObject(StorageEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageEditionCapability model = new StorageEditionCapability(); - model = BinaryData.fromObject(model).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 deleted file mode 100644 index e57eb6c8e246..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.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.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import org.junit.jupiter.api.Assertions; - -public final class StorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Storage model = - BinaryData - .fromString( - "{\"storageSizeGB\":1338183758,\"iops\":837766841,\"autoGrow\":\"Disabled\",\"logOnDisk\":\"Disabled\",\"storageSku\":\"owskanyktz\",\"autoIoScaling\":\"Enabled\"}") - .toObject(Storage.class); - Assertions.assertEquals(1338183758, model.storageSizeGB()); - Assertions.assertEquals(837766841, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = - new Storage() - .withStorageSizeGB(1338183758) - .withIops(837766841) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withLogOnDisk(EnableStatusEnum.DISABLED) - .withAutoIoScaling(EnableStatusEnum.ENABLED); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(1338183758, model.storageSizeGB()); - Assertions.assertEquals(837766841, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, 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 5393e709416d..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.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.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\":148902907}}") - .toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(148902907, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseInner model = new ValidateBackupResponseInner().withNumberOfContainers(148902907); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(148902907, 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 912134480d1c..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.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.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\":757345112}") - .toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(757345112, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseProperties model = - new ValidateBackupResponseProperties().withNumberOfContainers(757345112); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(757345112, 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 deleted file mode 100644 index ecb2818a5cf8..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.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.VirtualNetworkSubnetUsageParameter; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkSubnetUsageParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - BinaryData - .fromString("{\"virtualNetworkResourceId\":\"sonpclhocohs\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("sonpclhocohs", model.virtualNetworkResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("sonpclhocohs"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("sonpclhocohs", 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 deleted file mode 100644 index 673e18f9e1cd..000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.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.fluent.models.VirtualNetworkSubnetUsageResultInner; - -public final class VirtualNetworkSubnetUsageResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = - BinaryData - .fromString( - "{\"location\":\"ev\",\"subscriptionId\":\"ggzfbu\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"faxkffeii\",\"usage\":8222423909788566095},{\"subnetName\":\"ez\",\"usage\":9115490458846755949},{\"subnetName\":\"mzsb\",\"usage\":3522178877698458456},{\"subnetName\":\"igrxwburvjxxjn\",\"usage\":8439639335334985317}]}") - .toObject(VirtualNetworkSubnetUsageResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } -}