diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 0cd0416d1ceb..869ad5c0b9b3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -385,7 +385,7 @@ com.azure.resourcemanager:azure-resourcemanager-security;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purview;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0;1.1.0 com.azure.resourcemanager:azure-resourcemanager-baremetalinfrastructure;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-quota;2.0.0;2.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0;1.1.0-beta.1 diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md index 6f93fb1ba75c..a62519ad268d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md @@ -1,14 +1,408 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0 (2025-10-13) -### Features Added +- 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 api-version 2024-12-30. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.CapabilitiesListResult` was removed -### Other Changes +#### `models.FirewallRuleListResult` was removed + +#### `models.OperationListResult` was removed + +#### `models.DatabaseListResult` was removed + +#### `models.ServerBackupListResult` was removed + +#### `models.ServerListResult` was removed + +#### `models.OperationDisplay` was modified + +* `withProvider(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `validate()` was removed +* `withResource(java.lang.String)` was removed + +#### `models.VirtualNetworkSubnetUsageParameter` was modified + +* `validate()` was removed + +#### `models.SkuCapability` was modified + +* `validate()` was removed + +#### `models.ConfigurationListForBatchUpdate` was modified + +* `validate()` was removed + +#### `models.NameAvailabilityRequest` was modified + +* `validate()` was removed + +#### `models.ManagedServiceIdentityType` was modified + +* `valueOf(java.lang.String)` was removed +* `models.ManagedServiceIdentityType[] values()` -> `java.util.Collection values()` +* `toString()` was removed + +#### `models.ServerRestartParameter` was modified + +* `validate()` was removed + +#### `models.Identity` was modified + +* `validate()` was removed + +#### `models.HighAvailability` was modified + +* `validate()` was removed + +#### `models.ServerVersionCapability` was modified + +* `validate()` was removed + +#### `models.ServerForUpdate` was modified + +* `validate()` was removed + +#### `models.MaintenanceWindow` was modified + +* `validate()` was removed + +#### `models.Network` was modified + +* `validate()` was removed + +#### `models.StorageEditionCapability` was modified + +* `validate()` was removed + +#### `models.Storage` was modified + +* `validate()` was removed + +#### `models.Configurations` was modified + +* `update(java.lang.String,java.lang.String,java.lang.String,fluent.models.ConfigurationInner)` was removed +* `update(java.lang.String,java.lang.String,java.lang.String,fluent.models.ConfigurationInner,com.azure.core.util.Context)` was removed +* `listByServer(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.DelegatedSubnetUsage` was modified + +* `validate()` was removed + +#### `models.ServerEditionCapability` was modified + +* `validate()` was removed + +#### `models.Operation` was modified + +* `java.lang.String origin()` -> `models.Origin origin()` + +#### `models.DataEncryption` was modified + +* `validate()` was removed + +#### `models.Sku` was modified + +* `validate()` was removed + +#### `models.ConfigurationForBatchUpdate` was modified + +* `validate()` was removed + +#### `models.Backup` was modified + +* `validate()` was removed + +### Features Added + +* `models.Configuration$Update` was added + +* `models.BackupAndExportResponseType` was added + +* `models.ServerEditionCapabilityV2` was added + +* `models.AdvancedThreatProtectionState` was added + +* `models.SkuCapabilityV2` was added + +* `models.BackupRequestBase` was added + +* `models.PrivateEndpointConnection$Update` was added + +* `models.AdvancedThreatProtectionProvisioningState` was added + +* `models.FullBackupStoreDetails` was added + +* `models.ImportFromStorageResponseType` was added + +* `models.AzureADAdministrator` was added + +* `models.HighAvailabilityValidationEstimation` was added + +* `models.ValidateBackupResponse` was added + +* `models.AdministratorType` was added + +* `models.OperationProgressResponseType` was added + +* `models.ServerDetachVNetParameter` was added + +* `models.Configuration$Definition` was added + +* `models.PrivateEndpoint` was added + +* `models.BackupStoreDetails` was added + +* `models.AzureADAdministrator$UpdateStages` was added + +* `models.ResetAllToDefault` was added + +* `models.LogFiles` was added + +* `models.PrivateEndpointConnection$Definition` was added + +* `models.OperationResults` was added + +* `models.ServerBackupV2$DefinitionStages` was added + +* `models.BackupAndExportResponse` was added + +* `models.ServerBackupV2$Definition` was added + +* `models.BatchOfMaintenance` was added + +* `models.PrivateEndpointConnection$UpdateStages` was added + +* `models.OperationStatusResult` was added + +* `models.MaintenanceUpdate` was added + +* `models.OperationStatusExtendedResult` was added + +* `models.PrivateLinkResources` was added + +* `models.PrivateEndpointConnectionListResult` was added + +* `models.ServersMigrations` was added + +* `models.AzureADAdministrator$Update` was added + +* `models.AdvancedThreatProtectionSettings` was added + +* `models.UserAssignedIdentity` was added + +* `models.LocationBasedCapabilitySets` was added + +* `models.ProvisioningState` was added + +* `models.MaintenancePolicy` was added + +* `models.BackupAndExports` was added + +* `models.PrivateEndpointConnections` was added + +* `models.ImportSourceStorageType` was added + +* `models.ServerGtidSetParameter` was added + +* `models.FeatureProperty` was added + +* `models.PrivateLinkResource` was added + +* `models.BackupAndExportRequest` was added + +* `models.MaintenanceProvisioningState` was added + +* `models.ServerVersionCapabilityV2` was added + +* `models.OperationStatus` was added + +* `models.Configuration$UpdateStages` was added + +* `models.Configuration$DefinitionStages` was added + +* `models.PrivateLinkResourceProperties` was added + +* `models.AdvancedThreatProtectionName` was added + +* `models.PatchStrategy` was added + +* `models.ImportSourceProperties` was added + +* `models.BackupSettings` was added + +* `models.StorageRedundancyEnum` was added + +* `models.OperationProgressResult` was added + +* `models.PrivateEndpointConnection` was added + +* `models.Origin` was added + +* `models.PrivateLinkServiceConnectionState` was added + +* `models.ServerBackupV2` was added + +* `models.LongRunningBackupOperations` was added + +* `models.LongRunningBackups` was added + +* `models.ObjectType` was added + +* `models.Maintenances` was added + +* `models.MaintenanceType` was added + +* `models.BackupFormat` was added + +* `models.AzureADAdministrators` was added + +* `models.AzureADAdministrator$Definition` was added + +* `models.AdvancedThreatProtection` was added + +* `models.PrivateEndpointServiceConnectionStatus` was added + +* `models.AzureADAdministrator$DefinitionStages` was added + +* `models.AdvancedThreatProtectionForUpdate` was added + +* `models.MaintenanceState` was added + +* `models.AdministratorName` was added + +* `models.PrivateEndpointConnection$DefinitionStages` was added + +* `models.Capability` was added + +* `models.PrivateEndpointConnectionProvisioningState` was added + +* `models.Maintenance` was added + +* `models.BackupType` was added + +* `models.LogFile` was added + +* `models.OperationProgress` was added + +#### `models.ConfigurationListForBatchUpdate` was modified + +* `resetAllToDefault()` was added +* `withResetAllToDefault(models.ResetAllToDefault)` was added + +#### `models.Server` was modified + +* `fullVersion()` was added +* `validateEstimateHighAvailabilityWithResponse(fluent.models.HighAvailabilityValidationEstimationInner,com.azure.core.util.Context)` was added +* `maintenancePolicy()` was added +* `resetGtid(models.ServerGtidSetParameter)` was added +* `detachVNet(models.ServerDetachVNetParameter,com.azure.core.util.Context)` was added +* `privateEndpointConnections()` was added +* `databasePort()` was added +* `importSourceProperties()` was added +* `resetGtid(models.ServerGtidSetParameter,com.azure.core.util.Context)` was added +* `validateEstimateHighAvailability(fluent.models.HighAvailabilityValidationEstimationInner)` was added +* `detachVNet(models.ServerDetachVNetParameter)` was added + +#### `models.ServerForUpdate` was modified + +* `withNetwork(models.Network)` was added +* `withVersion(models.ServerVersion)` was added +* `withMaintenancePolicy(models.MaintenancePolicy)` was added +* `maintenancePolicy()` was added +* `version()` was added +* `network()` was added + +#### `models.MaintenanceWindow` was modified + +* `batchOfMaintenance()` was added +* `withBatchOfMaintenance(models.BatchOfMaintenance)` was added + +#### `models.Network` was modified + +* `withPublicNetworkAccess(models.EnableStatusEnum)` was added + +#### `models.StorageEditionCapability` was modified + +* `maxBackupIntervalHours()` was added +* `minBackupIntervalHours()` was added + +#### `MySqlManager` was modified + +* `operationProgress()` was added +* `backupAndExports()` was added +* `azureADAdministrators()` was added +* `serversMigrations()` was added +* `longRunningBackups()` was added +* `maintenances()` was added +* `privateLinkResources()` was added +* `operationResults()` was added +* `logFiles()` was added +* `longRunningBackupOperations()` was added +* `advancedThreatProtectionSettings()` was added +* `locationBasedCapabilitySets()` was added +* `privateEndpointConnections()` was added + +#### `models.Storage` was modified + +* `storageRedundancy()` was added +* `withAutoIoScaling(models.EnableStatusEnum)` was added +* `withLogOnDisk(models.EnableStatusEnum)` was added +* `withStorageRedundancy(models.StorageRedundancyEnum)` was added +* `autoIoScaling()` was added +* `logOnDisk()` was added + +#### `models.Backups` was modified + +* `put(java.lang.String,java.lang.String,java.lang.String)` was added +* `putWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.Server$Definition` was modified + +* `withDatabasePort(java.lang.Integer)` was added +* `withMaintenancePolicy(models.MaintenancePolicy)` was added +* `withImportSourceProperties(models.ImportSourceProperties)` was added + +#### `models.Configurations` was modified + +* `listByServer(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.lang.Integer,com.azure.core.util.Context)` was added +* `getById(java.lang.String)` was added +* `define(java.lang.String)` was added +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added + +#### `models.Servers` was modified + +* `resetGtid(java.lang.String,java.lang.String,models.ServerGtidSetParameter)` was added +* `detachVNet(java.lang.String,java.lang.String,models.ServerDetachVNetParameter)` was added +* `detachVNet(java.lang.String,java.lang.String,models.ServerDetachVNetParameter,com.azure.core.util.Context)` was added +* `resetGtid(java.lang.String,java.lang.String,models.ServerGtidSetParameter,com.azure.core.util.Context)` was added +* `validateEstimateHighAvailability(java.lang.String,java.lang.String,fluent.models.HighAvailabilityValidationEstimationInner)` was added +* `validateEstimateHighAvailabilityWithResponse(java.lang.String,java.lang.String,fluent.models.HighAvailabilityValidationEstimationInner,com.azure.core.util.Context)` was added + +#### `models.Server$Update` was modified + +* `withNetwork(models.Network)` was added +* `withVersion(models.ServerVersion)` was added +* `withMaintenancePolicy(models.MaintenancePolicy)` was added + +#### `models.Backup` was modified + +* `backupIntervalHours()` was added +* `withBackupIntervalHours(java.lang.Integer)` was added + +#### `models.Configuration` was modified + +* `update()` was added +* `currentValue()` was added +* `refresh()` was added +* `resourceGroupName()` was added +* `refresh(com.azure.core.util.Context)` was added +* `documentationLink()` was added ## 1.0.0 (2024-12-20) diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md index 7a84c8f37c98..654759981854 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-2021-05-01. 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 api-version 2024-12-30. 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.1.0-beta.1 + 1.1.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ MySqlManager manager = MySqlManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -109,5 +109,3 @@ 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/ - - diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md index 560c855ac071..213885568a78 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md @@ -1,10 +1,30 @@ # Code snippets and samples +## AdvancedThreatProtectionSettings + +- [Get](#advancedthreatprotectionsettings_get) +- [List](#advancedthreatprotectionsettings_list) +- [Update](#advancedthreatprotectionsettings_update) +- [UpdatePut](#advancedthreatprotectionsettings_updateput) + +## AzureADAdministrators + +- [CreateOrUpdate](#azureadadministrators_createorupdate) +- [Delete](#azureadadministrators_delete) +- [Get](#azureadadministrators_get) +- [ListByServer](#azureadadministrators_listbyserver) + +## BackupAndExport + +- [Create](#backupandexport_create) +- [ValidateBackup](#backupandexport_validatebackup) + ## Backups - [Get](#backups_get) - [ListByServer](#backups_listbyserver) +- [Put](#backups_put) ## CheckNameAvailability @@ -21,6 +41,7 @@ ## Configurations - [BatchUpdate](#configurations_batchupdate) +- [CreateOrUpdate](#configurations_createorupdate) - [Get](#configurations_get) - [ListByServer](#configurations_listbyserver) - [Update](#configurations_update) @@ -47,10 +68,54 @@ - [List](#locationbasedcapabilities_list) +## LocationBasedCapabilitySet + +- [Get](#locationbasedcapabilityset_get) +- [List](#locationbasedcapabilityset_list) + +## LogFiles + +- [ListByServer](#logfiles_listbyserver) + +## LongRunningBackupOperation + +- [Create](#longrunningbackupoperation_create) + +## LongRunningBackups + +- [Get](#longrunningbackups_get) +- [List](#longrunningbackups_list) + +## Maintenances + +- [List](#maintenances_list) +- [Read](#maintenances_read) +- [Update](#maintenances_update) + +## OperationProgress + +- [Get](#operationprogress_get) + +## OperationResults + +- [Get](#operationresults_get) + ## Operations - [List](#operations_list) +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByServer](#privateendpointconnections_listbyserver) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByServer](#privatelinkresources_listbyserver) + ## Replicas - [ListByServer](#replicas_listbyserver) @@ -59,14 +124,318 @@ - [Create](#servers_create) - [Delete](#servers_delete) +- [DetachVNet](#servers_detachvnet) - [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) +- [ValidateEstimateHighAvailability](#servers_validateestimatehighavailability) + +## ServersMigration + +- [CutoverMigration](#serversmigration_cutovermigration) +### AdvancedThreatProtectionSettings_Get + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; + +/** + * Samples for AdvancedThreatProtectionSettings Get. + */ +public final class AdvancedThreatProtectionSettingsGetSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsGet.json + */ + /** + * Sample code: Get a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .getWithResponse("threatprotection-6852", "threatprotection-2080", AdvancedThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} +``` + +### AdvancedThreatProtectionSettings_List + +```java +/** + * Samples for AdvancedThreatProtectionSettings List. + */ +public final class AdvancedThreatProtectionSettingsListSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsList.json + */ + /** + * Sample code: Get list of server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getListOfServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .list("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); + } +} +``` + +### AdvancedThreatProtectionSettings_Update + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; + +/** + * Samples for AdvancedThreatProtectionSettings Update. + */ +public final class AdvancedThreatProtectionSettingsUpdateSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPatchDisabled.json + */ + /** + * Sample code: Disable a server's Advanced Threat Protection settings with all parameters. + * + * @param manager Entry point to MySqlManager. + */ + public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParameters( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPatchEnabled.json + */ + /** + * Sample code: Enable a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void enableAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), + com.azure.core.util.Context.NONE); + } +} +``` + +### AdvancedThreatProtectionSettings_UpdatePut + +```java +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; + +/** + * Samples for AdvancedThreatProtectionSettings UpdatePut. + */ +public final class AdvancedThreatProtectionSettingsUpdatePutSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPutDisabled.json + */ + /** + * Sample code: Disable a server's Advanced Threat Protection settings with all parameters using PUT. + * + * @param manager Entry point to MySqlManager. + */ + public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParametersUsingPUT( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPutEnabled.json + */ + /** + * Sample code: Enable a server's Advanced Threat Protection settings using PUT. + * + * @param manager Entry point to MySqlManager. + */ + public static void enableAServerSAdvancedThreatProtectionSettingsUsingPUT( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.ENABLED), + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureADAdministrators_CreateOrUpdate + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; + +/** + * Samples for AzureADAdministrators CreateOrUpdate. + */ +public final class AzureADAdministratorsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-12-30/AzureADAdministratorCreate.json + */ + /** + * Sample code: Create an azure ad administrator. + * + * @param manager Entry point to MySqlManager. + */ + public static void + createAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.azureADAdministrators() + .define(AdministratorName.ACTIVE_DIRECTORY) + .withExistingFlexibleServer("testrg", "mysqltestsvc4") + .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) + .withLogin("bob@contoso.com") + .withSid("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c") + .withTenantId("c12b7025-bfe2-46c1-b463-993b5e4cd467") + .withIdentityResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi") + .create(); + } +} +``` + +### AzureADAdministrators_Delete + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; + +/** + * Samples for AzureADAdministrators Delete. + */ +public final class AzureADAdministratorsDeleteSamples { + /* + * x-ms-original-file: 2024-12-30/AzureADAdministratorDelete.json + */ + /** + * Sample code: Delete an azure ad administrator. + * + * @param manager Entry point to MySqlManager. + */ + public static void + deleteAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.azureADAdministrators() + .delete("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE); + } +} +``` + +### AzureADAdministrators_Get + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; + +/** + * Samples for AzureADAdministrators Get. + */ +public final class AzureADAdministratorsGetSamples { + /* + * x-ms-original-file: 2024-12-30/AzureADAdministratorGet.json + */ + /** + * Sample code: Get an azure ad administrator. + * + * @param manager Entry point to MySqlManager. + */ + public static void getAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.azureADAdministrators() + .getWithResponse("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureADAdministrators_ListByServer + +```java +/** + * Samples for AzureADAdministrators ListByServer. + */ +public final class AzureADAdministratorsListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/AzureADAdministratorsListByServer.json + */ + /** + * Sample code: List Azure AD administrators in a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void + listAzureADAdministratorsInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.azureADAdministrators().listByServer("testrg", "mysqltestsvc4", com.azure.core.util.Context.NONE); + } +} +``` + +### BackupAndExport_Create + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; +import java.util.Arrays; + +/** + * Samples for BackupAndExport Create. + */ +public final class BackupAndExportCreateSamples { + /* + * x-ms-original-file: 2024-12-30/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: 2024-12-30/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 @@ -75,8 +444,7 @@ */ public final class BackupsGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupGet.json + * x-ms-original-file: 2024-12-30/BackupGet.json */ /** * Sample code: Get a backup for a server. @@ -98,9 +466,7 @@ public final class BackupsGetSamples { */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupsListByServer. - * json + * x-ms-original-file: 2024-12-30/BackupsListByServer.json */ /** * Sample code: List backups for a server. @@ -113,6 +479,27 @@ public final class BackupsListByServerSamples { } ``` +### Backups_Put + +```java +/** + * Samples for Backups Put. + */ +public final class BackupsPutSamples { + /* + * x-ms-original-file: 2024-12-30/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 @@ -123,9 +510,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequ */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability - * .json + * x-ms-original-file: 2024-12-30/CheckNameAvailability.json */ /** * Sample code: Check name availability. @@ -151,9 +536,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequ */ public final class CheckNameAvailabilityWithoutLocationExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability - * .json + * x-ms-original-file: 2024-12-30/CheckNameAvailabilityWithoutLocation.json */ /** * Sample code: Check name availability. @@ -179,8 +562,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnet */ public final class CheckVirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: 2024-12-30/CheckVirtualNetworkSubnetUsage.json */ /** * Sample code: CheckVirtualNetworkSubnetUsage. @@ -200,361 +582,776 @@ public final class CheckVirtualNetworkSubnetUsageExecuteSamples { ### Configurations_BatchUpdate ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import java.util.Arrays; - +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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/ConfigurationGet.json + */ + /** + * Sample code: Get a configuration. + * + * @param manager Entry point to MySqlManager. + */ + public static void getAConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .getWithResponse("TestGroup", "testserver", "event_scheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### Configurations_ListByServer + +```java +/** + * Samples for Configurations ListByServer. + */ +public final class ConfigurationsListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/ConfigurationsListByServer.json + */ + /** + * Sample code: List all configurations for a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void + listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .listByServer("testrg", "mysqltestserver", null, null, 1, 8, com.azure.core.util.Context.NONE); + } +} +``` + +### Configurations_Update + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; + +/** + * Samples for Configurations Update. + */ +public final class ConfigurationsUpdateSamples { + /* + * x-ms-original-file: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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: 2024-12-30/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); + } +} +``` + +### LocationBasedCapabilitySet_Get + +```java +/** + * Samples for LocationBasedCapabilitySet Get. + */ +public final class LocationBasedCapabilitySetGetSamples { + /* + * x-ms-original-file: 2024-12-30/CapabilitySetByLocation.json + */ + /** + * Sample code: CapabilityResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilityResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().getWithResponse("WestUS", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### LocationBasedCapabilitySet_List + +```java +/** + * Samples for LocationBasedCapabilitySet List. + */ +public final class LocationBasedCapabilitySetListSamples { + /* + * x-ms-original-file: 2024-12-30/CapabilitySetListByLocation.json + */ + /** + * Sample code: CapabilitySetsResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilitySetsResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().list("WestUS", com.azure.core.util.Context.NONE); + } +} +``` + +### LogFiles_ListByServer + +```java +/** + * Samples for LogFiles ListByServer. + */ +public final class LogFilesListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/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); + } +} +``` + +### LongRunningBackupOperation_Create + +```java /** - * Samples for Configurations BatchUpdate. + * Samples for LongRunningBackupOperation Create. */ -public final class ConfigurationsBatchUpdateSamples { +public final class LongRunningBackupOperationCreateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ConfigurationsBatchUpdate.json + * x-ms-original-file: 2024-12-30/LongRunningBackup.json */ /** - * Sample code: ConfigurationList. + * Sample code: Create backup for a server. * * @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"))), - com.azure.core.util.Context.NONE); + public static void createBackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.longRunningBackupOperations() + .define("testback") + .withExistingFlexibleServer("TestGroup", "mysqltestserver") + .create(); } } ``` -### Configurations_Get +### LongRunningBackups_Get ```java /** - * Samples for Configurations Get. + * Samples for LongRunningBackups Get. */ -public final class ConfigurationsGetSamples { +public final class LongRunningBackupsGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationGet.json + * x-ms-original-file: 2024-12-30/LongRunningBackupGet.json */ /** - * Sample code: Get a configuration. + * Sample code: Get a backup for a server. * * @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); + public static void getABackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.longRunningBackups() + .getWithResponse("TestGroup", "mysqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); } } ``` -### Configurations_ListByServer +### LongRunningBackups_List ```java /** - * Samples for Configurations ListByServer. + * Samples for LongRunningBackups List. */ -public final class ConfigurationsListByServerSamples { +public final class LongRunningBackupsListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ConfigurationsListByServer.json + * x-ms-original-file: 2024-12-30/LongRunningBackupsListByServer.json */ /** - * Sample code: List all configurations for a server. + * Sample code: List backups for a server. * * @param manager Entry point to MySqlManager. */ - public static void - listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations().listByServer("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); + public static void listBackupsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.longRunningBackups().list("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); } } ``` -### Configurations_Update +### Maintenances_List ```java -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; - /** - * Samples for Configurations Update. + * Samples for Maintenances List. */ -public final class ConfigurationsUpdateSamples { +public final class MaintenancesListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationUpdate. - * json + * x-ms-original-file: 2024-12-30/MaintenancesListByServer.json */ /** - * Sample code: Update a user configuration. + * Sample code: List maintenances on a server. * * @param manager Entry point to MySqlManager. */ - public static void updateAUserConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .update("testrg", "testserver", "event_scheduler", - new ConfigurationInner().withValue("on").withSource(ConfigurationSource.USER_OVERRIDE), - com.azure.core.util.Context.NONE); + public static void listMaintenancesOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.maintenances().list("TestGroup", "testserver", com.azure.core.util.Context.NONE); } } ``` -### Databases_CreateOrUpdate +### Maintenances_Read ```java /** - * Samples for Databases CreateOrUpdate. + * Samples for Maintenances Read. */ -public final class DatabasesCreateOrUpdateSamples { +public final class MaintenancesReadSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseCreate.json + * x-ms-original-file: 2024-12-30/MaintenanceRead.json */ /** - * Sample code: Create a database. + * Sample code: Read a maintenance. * * @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(); + public static void readAMaintenance(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.maintenances() + .readWithResponse("TestGroup", "testserver", "_T9Q-TS8", com.azure.core.util.Context.NONE); } } ``` -### Databases_Delete +### Maintenances_Update ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; +import java.time.OffsetDateTime; + /** - * Samples for Databases Delete. + * Samples for Maintenances Update. */ -public final class DatabasesDeleteSamples { +public final class MaintenancesUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseDelete.json + * x-ms-original-file: 2024-12-30/MaintenanceUpdate.json */ /** - * Sample code: Delete a database. + * Sample code: Update maintenance on a server. * * @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); + public static void updateMaintenanceOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.maintenances() + .update("TestGroup", "testserver", "_T9Q-TS8", + new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2024-01-20T00:00:00")), + com.azure.core.util.Context.NONE); } } ``` -### Databases_Get +### OperationProgress_Get ```java /** - * Samples for Databases Get. + * Samples for OperationProgress Get. */ -public final class DatabasesGetSamples { +public final class OperationProgressGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseGet.json + * x-ms-original-file: 2024-12-30/OperationProgress_Get_BackupAndExport.json */ /** - * Sample code: Get a database. + * Sample code: OperationProgress_Get BackupAndExport. * * @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); + public static void + operationProgressGetBackupAndExport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operationProgress() + .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-12-30/OperationProgress_Get_ImportFromStorage.json + */ + /** + * Sample code: OperationProgress_Get ImportFromStorage. + * + * @param manager Entry point to MySqlManager. + */ + public static void + operationProgressGetImportFromStorage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operationProgress() + .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); } } ``` -### Databases_ListByServer +### OperationResults_Get ```java /** - * Samples for Databases ListByServer. + * Samples for OperationResults Get. */ -public final class DatabasesListByServerSamples { +public final class OperationResultsGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabasesListByServer - * .json + * x-ms-original-file: 2024-12-30/OperationResults_Get.json */ /** - * Sample code: List databases in a server. + * Sample code: OperationResults_Get. * * @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); + public static void operationResultsGet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operationResults() + .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_CreateOrUpdate +### Operations_List ```java /** - * Samples for FirewallRules CreateOrUpdate. + * Samples for Operations List. */ -public final class FirewallRulesCreateOrUpdateSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleCreate. - * json + * x-ms-original-file: 2024-12-30/OperationsList.json */ /** - * Sample code: Create a firewall rule. + * Sample code: OperationList. * * @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(); + public static void operationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_Delete +### PrivateEndpointConnections_CreateOrUpdate ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; + /** - * Samples for FirewallRules Delete. + * Samples for PrivateEndpointConnections CreateOrUpdate. */ -public final class FirewallRulesDeleteSamples { +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleDelete. - * json + * x-ms-original-file: 2024-12-30/PrivateEndpointConnectionUpdate.json */ /** - * Sample code: Delete a firewall rule. + * Sample code: Approve or reject a private endpoint connection with a given name. * * @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); + 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(); } } ``` -### FirewallRules_Get +### PrivateEndpointConnections_Delete ```java /** - * Samples for FirewallRules Get. + * Samples for PrivateEndpointConnections Delete. */ -public final class FirewallRulesGetSamples { +public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleGet.json + * x-ms-original-file: 2024-12-30/PrivateEndpointConnectionDelete.json */ /** - * Sample code: Get a firewall rule. + * Sample code: Deletes a private endpoint connection with a given name. * * @param manager Entry point to MySqlManager. */ - public static void getAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().getWithResponse("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.privateEndpointConnections() + .delete("Default", "test-svr", "private-endpoint-connection-name", com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_ListByServer +### PrivateEndpointConnections_Get ```java /** - * Samples for FirewallRules ListByServer. + * Samples for PrivateEndpointConnections Get. */ -public final class FirewallRulesListByServerSamples { +public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * FirewallRulesListByServer.json + * x-ms-original-file: 2024-12-30/PrivateEndpointConnectionGet.json */ /** - * Sample code: List all firewall rules in a server. + * Sample code: Gets private endpoint connection. * * @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); + getsPrivateEndpointConnection(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.privateEndpointConnections() + .getWithResponse("Default", "test-svr", "private-endpoint-connection-name", + com.azure.core.util.Context.NONE); } } ``` -### GetPrivateDnsZoneSuffix_Execute +### PrivateEndpointConnections_ListByServer ```java /** - * Samples for GetPrivateDnsZoneSuffix Execute. + * Samples for PrivateEndpointConnections ListByServer. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { +public final class PrivateEndpointConnectionsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * GetPrivateDnsZoneSuffix.json + * x-ms-original-file: 2024-12-30/PrivateEndpointConnectionList.json */ /** - * Sample code: GetPrivateDnsZoneSuffix. + * Sample code: Gets list of private endpoint connections on a server. * * @param manager Entry point to MySqlManager. */ - public static void getPrivateDnsZoneSuffix(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + public static void getsListOfPrivateEndpointConnectionsOnAServer( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.privateEndpointConnections() + .listByServerWithResponse("Default", "test-svr", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilities_List +### PrivateLinkResources_Get ```java /** - * Samples for LocationBasedCapabilities List. + * Samples for PrivateLinkResources Get. */ -public final class LocationBasedCapabilitiesListSamples { +public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * CapabilitiesByLocationList.json + * x-ms-original-file: 2024-12-30/PrivateLinkResourcesGet.json */ /** - * Sample code: CapabilitiesList. + * Sample code: Gets a private link resource for MySQL. * * @param manager Entry point to MySqlManager. */ - public static void capabilitiesList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilities().list("WestUS", com.azure.core.util.Context.NONE); + public static void + getsAPrivateLinkResourceForMySQL(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### PrivateLinkResources_ListByServer ```java /** - * Samples for Operations List. + * Samples for PrivateLinkResources ListByServer. */ -public final class OperationsListSamples { +public final class PrivateLinkResourcesListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/OperationsList.json + * x-ms-original-file: 2024-12-30/PrivateLinkResourcesList.json */ /** - * Sample code: OperationList. + * Sample code: Gets private link resources for MySQL. * * @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); + public static void + getsPrivateLinkResourcesForMySQL(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); } } ``` @@ -567,9 +1364,7 @@ public final class OperationsListSamples { */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ReplicasListByServer. - * json + * x-ms-original-file: 2024-12-30/ReplicasListByServer.json */ /** * Sample code: List replicas for a server. @@ -585,8 +1380,6 @@ public final class ReplicasListByServerSamples { ### 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; @@ -600,7 +1393,8 @@ 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 com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -610,9 +1404,7 @@ import java.util.Map; */ public final class ServersCreateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateReplica. - * json + * x-ms-original-file: 2024-12-30/ServerCreateReplica.json */ /** * Sample code: Create a replica server. @@ -631,8 +1423,41 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreate.json + * x-ms-original-file: 2024-12-30/ServerCreateWithDatabasePort.json + */ + /** + * Sample code: Create a server with non-default database port. + * + * @param manager Entry point to MySqlManager. + */ + public static void + createAServerWithNonDefaultDatabasePort(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) + .withDatabasePort(8888) + .withStorage(new Storage().withStorageSizeGB(100) + .withIops(600) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY)) + .withBackup(new Backup().withBackupRetentionDays(7) + .withBackupIntervalHours(24) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) + .withHighAvailability( + new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) + .create(); + } + + /* + * x-ms-original-file: 2024-12-30/ServerCreate.json */ /** * Sample code: Create a new server. @@ -651,25 +1476,27 @@ public final class ServersCreateSamples { .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)) + .withStorage(new Storage().withStorageSizeGB(100) + .withIops(600) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.ZONE_REDUNDANCY)) + .withBackup(new Backup().withBackupRetentionDays(7) + .withBackupIntervalHours(24) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateWithBYOK. - * json + * x-ms-original-file: 2024-12-30/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 { + public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager.servers() .define("mysqltestserver") .withRegion("southeastasia") @@ -678,8 +1505,7 @@ public final class ServersCreateSamples { .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)))) + new UserAssignedIdentity()))) .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") @@ -693,16 +1519,20 @@ public final class ServersCreateSamples { "/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)) + .withStorage(new Storage().withStorageSizeGB(100) + .withIops(600) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY)) + .withBackup(new Backup().withBackupRetentionDays(7) + .withBackupIntervalHours(24) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ServerCreateWithPointInTimeRestore.json + * x-ms-original-file: 2024-12-30/ServerCreateWithPointInTimeRestore.json */ /** * Sample code: Create a server as a point in time restore. @@ -746,8 +1576,7 @@ public final class ServersCreateSamples { */ public final class ServersDeleteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerDelete.json + * x-ms-original-file: 2024-12-30/ServerDelete.json */ /** * Sample code: Delete a server. @@ -760,6 +1589,33 @@ public final class ServersDeleteSamples { } ``` +### Servers_DetachVNet + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; + +/** + * Samples for Servers DetachVNet. + */ +public final class ServersDetachVNetSamples { + /* + * x-ms-original-file: 2024-12-30/ServerDetachVNet.json + */ + /** + * Sample code: Detach VNet on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void detachVNetOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.servers() + .detachVNet("TestGroup", "testserver", + new ServerDetachVNetParameter().withPublicNetworkAccess(EnableStatusEnum.ENABLED), + com.azure.core.util.Context.NONE); + } +} +``` + ### Servers_Failover ```java @@ -768,8 +1624,7 @@ public final class ServersDeleteSamples { */ public final class ServersFailoverSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerFailover.json + * x-ms-original-file: 2024-12-30/ServerFailover.json */ /** * Sample code: Restart a server. @@ -790,9 +1645,7 @@ public final class ServersFailoverSamples { */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGetWithVnet. - * json + * x-ms-original-file: 2024-12-30/ServerGetWithVnet.json */ /** * Sample code: Get a server with vnet. @@ -804,8 +1657,7 @@ public final class ServersGetByResourceGroupSamples { } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGet.json + * x-ms-original-file: 2024-12-30/ServerGet.json */ /** * Sample code: Get a server. @@ -826,8 +1678,7 @@ public final class ServersGetByResourceGroupSamples { */ public final class ServersListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServersList.json + * x-ms-original-file: 2024-12-30/ServersList.json */ /** * Sample code: List servers in a subscription. @@ -848,8 +1699,7 @@ public final class ServersListSamples { */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ServersListByResourceGroup.json + * x-ms-original-file: 2024-12-30/ServersListByResourceGroup.json */ /** * Sample code: List servers in a resource group. @@ -862,6 +1712,32 @@ public final class ServersListByResourceGroupSamples { } ``` +### Servers_ResetGtid + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; + +/** + * Samples for Servers ResetGtid. + */ +public final class ServersResetGtidSamples { + /* + * x-ms-original-file: 2024-12-30/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 @@ -873,8 +1749,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParamet */ public final class ServersRestartSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerRestart.json + * x-ms-original-file: 2024-12-30/ServerRestart.json */ /** * Sample code: Restart a server. @@ -899,8 +1774,7 @@ public final class ServersRestartSamples { */ public final class ServersStartSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStart.json + * x-ms-original-file: 2024-12-30/ServerStart.json */ /** * Sample code: Start a server. @@ -921,8 +1795,7 @@ public final class ServersStartSamples { */ public final class ServersStopSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStop.json + * x-ms-original-file: 2024-12-30/ServerStop.json */ /** * Sample code: Stop a server. @@ -938,17 +1811,20 @@ public final class ServersStopSamples { ### Servers_Update ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.mysqlflexibleserver.models.BatchOfMaintenance; 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.MaintenancePolicy; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.mysqlflexibleserver.models.Network; +import com.azure.resourcemanager.mysqlflexibleserver.models.PatchStrategy; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import java.io.IOException; +import com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; @@ -957,8 +1833,7 @@ import java.util.Map; */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: 2024-12-30/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: Update server customer maintenance window. @@ -974,22 +1849,56 @@ public final class ServersUpdateSamples { .withMaintenanceWindow(new MaintenanceWindow().withCustomWindow("Enabled") .withStartHour(8) .withStartMinute(0) - .withDayOfWeek(1)) + .withDayOfWeek(1) + .withBatchOfMaintenance(BatchOfMaintenance.BATCH1)) + .apply(); + } + + /* + * x-ms-original-file: 2024-12-30/MaintenancePolicyPatchOptInVirtualCanary.json + */ + /** + * Sample code: Update server to opt in virtual canary. + * + * @param manager Entry point to MySqlManager. + */ + public static void + updateServerToOptInVirtualCanary(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + Server resource = manager.servers() + .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withMaintenancePolicy(new MaintenancePolicy().withPatchStrategy(PatchStrategy.VIRTUAL_CANARY)) + .apply(); + } + + /* + * x-ms-original-file: 2024-12-30/MaintenancePolicyPatchOptOutVirtualCanary.json + */ + /** + * Sample code: Update server to opt out virtual canary. + * + * @param manager Entry point to MySqlManager. + */ + public static void + updateServerToOptOutVirtualCanary(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + Server resource = manager.servers() + .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withMaintenancePolicy(new MaintenancePolicy().withPatchStrategy(PatchStrategy.fromString("Default"))) .apply(); } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdateWithBYOK. - * json + * x-ms-original-file: 2024-12-30/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 { + public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); @@ -997,8 +1906,7 @@ public final class ServersUpdateSamples { .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)))) + new UserAssignedIdentity()))) .withDataEncryption(new DataEncryption().withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity") .withPrimaryKeyUri("fakeTokenPlaceholder") @@ -1010,8 +1918,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdate.json + * x-ms-original-file: 2024-12-30/ServerUpdate.json */ /** * Sample code: Update a server. @@ -1023,7 +1930,12 @@ public final class ServersUpdateSamples { .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withStorage(new Storage().withStorageSizeGB(30).withIops(200).withAutoGrow(EnableStatusEnum.DISABLED)) + .withStorage(new Storage().withStorageSizeGB(30) + .withIops(200) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withAutoIoScaling(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY)) + .withNetwork(new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED)) .apply(); } @@ -1041,3 +1953,52 @@ public final class ServersUpdateSamples { } ``` +### Servers_ValidateEstimateHighAvailability + +```java +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; + +/** + * Samples for Servers ValidateEstimateHighAvailability. + */ +public final class ServersValidateEstimateHighAvailabilitySamples { + /* + * x-ms-original-file: 2024-12-30/ServerValidateEstimateHighAvailability.json + */ + /** + * Sample code: Validate a validation and estimation of high availability. + * + * @param manager Entry point to MySqlManager. + */ + public static void validateAValidationAndEstimationOfHighAvailability( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.servers() + .validateEstimateHighAvailabilityWithResponse("TestGroup", "testserver", + new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ServersMigration_CutoverMigration + +```java +/** + * Samples for ServersMigration CutoverMigration. + */ +public final class ServersMigrationCutoverMigrationSamples { + /* + * x-ms-original-file: 2024-12-30/CutoverMigration.json + */ + /** + * Sample code: Cutover migration for MySQL import. + * + * @param manager Entry point to MySqlManager. + */ + public static void + cutoverMigrationForMySQLImport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.serversMigrations().cutoverMigration("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml index b693dff13c31..d3c87c0e15e2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-mysqlflexibleserver - 1.1.0-beta.1 + 1.1.0 jar Microsoft Azure SDK for MySql Management - This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. + 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 api-version 2024-12-30. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - false diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java index 40b537b0aa42..b72e7b592cc6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver; @@ -22,8 +22,12 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.AdvancedThreatProtectionSettingsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsImpl; @@ -33,10 +37,23 @@ import com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitySetsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.LogFilesImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupOperationsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.MaintenancesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationProgressImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationResultsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersMigrationsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; import com.azure.resourcemanager.mysqlflexibleserver.models.Backups; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilities; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilityWithoutLocations; @@ -46,13 +63,24 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRules; import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixes; import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilities; +import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; +import com.azure.resourcemanager.mysqlflexibleserver.models.LogFiles; +import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackupOperations; +import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackups; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenances; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgress; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; import com.azure.resourcemanager.mysqlflexibleserver.models.Operations; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnections; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResources; import com.azure.resourcemanager.mysqlflexibleserver.models.Replicas; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -62,18 +90,40 @@ * including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. */ public final class MySqlManager { + private Operations operations; + + private AzureADAdministrators azureADAdministrators; + private Servers servers; - private Replicas replicas; + private BackupAndExports backupAndExports; + + private LogFiles logFiles; + + private ServersMigrations serversMigrations; private Backups backups; - private FirewallRules firewallRules; + private LongRunningBackups longRunningBackups; - private Databases databases; + private LongRunningBackupOperations longRunningBackupOperations; private Configurations configurations; + private Databases databases; + + private FirewallRules firewallRules; + + private AdvancedThreatProtectionSettings advancedThreatProtectionSettings; + + private LocationBasedCapabilitySets locationBasedCapabilitySets; + + private Maintenances maintenances; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + private LocationBasedCapabilities locationBasedCapabilities; private CheckVirtualNetworkSubnetUsages checkVirtualNetworkSubnetUsages; @@ -82,9 +132,13 @@ public final class MySqlManager { private CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocations; + private OperationResults operationResults; + + private OperationProgress operationProgress; + private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; - private Operations operations; + private Replicas replicas; private final MySqlManagementClient clientObject; @@ -138,6 +192,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-mysqlflexibleserver.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -245,12 +302,14 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.mysqlflexibleserver") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -296,6 +355,30 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil } } + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of 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 Servers. It manages Server. * @@ -309,15 +392,39 @@ public Servers servers() { } /** - * Gets the resource collection API of Replicas. + * Gets the resource collection API of BackupAndExports. * - * @return Resource collection API of Replicas. + * @return Resource collection API of BackupAndExports. */ - public Replicas replicas() { - if (this.replicas == null) { - this.replicas = new ReplicasImpl(clientObject.getReplicas(), this); + public BackupAndExports backupAndExports() { + if (this.backupAndExports == null) { + this.backupAndExports = new BackupAndExportsImpl(clientObject.getBackupAndExports(), this); } - return replicas; + return backupAndExports; + } + + /** + * 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 ServersMigrations. + * + * @return Resource collection API of ServersMigrations. + */ + public ServersMigrations serversMigrations() { + if (this.serversMigrations == null) { + this.serversMigrations = new ServersMigrationsImpl(clientObject.getServersMigrations(), this); + } + return serversMigrations; } /** @@ -333,15 +440,40 @@ public Backups backups() { } /** - * Gets the resource collection API of FirewallRules. It manages FirewallRule. + * Gets the resource collection API of LongRunningBackups. * - * @return Resource collection API of FirewallRules. + * @return Resource collection API of LongRunningBackups. */ - public FirewallRules firewallRules() { - if (this.firewallRules == null) { - this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); + public LongRunningBackups longRunningBackups() { + if (this.longRunningBackups == null) { + this.longRunningBackups = new LongRunningBackupsImpl(clientObject.getLongRunningBackups(), this); } - return firewallRules; + return longRunningBackups; + } + + /** + * Gets the resource collection API of LongRunningBackupOperations. It manages ServerBackupV2. + * + * @return Resource collection API of LongRunningBackupOperations. + */ + public LongRunningBackupOperations longRunningBackupOperations() { + if (this.longRunningBackupOperations == null) { + this.longRunningBackupOperations + = new LongRunningBackupOperationsImpl(clientObject.getLongRunningBackupOperations(), this); + } + return longRunningBackupOperations; + } + + /** + * 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; } /** @@ -357,15 +489,78 @@ public Databases databases() { } /** - * Gets the resource collection API of Configurations. + * Gets the resource collection API of FirewallRules. It manages FirewallRule. * - * @return Resource collection API of Configurations. + * @return Resource collection API of FirewallRules. */ - public Configurations configurations() { - if (this.configurations == null) { - this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); } - return configurations; + return firewallRules; + } + + /** + * Gets the resource collection API of AdvancedThreatProtectionSettings. + * + * @return Resource collection API of AdvancedThreatProtectionSettings. + */ + public AdvancedThreatProtectionSettings advancedThreatProtectionSettings() { + if (this.advancedThreatProtectionSettings == null) { + this.advancedThreatProtectionSettings + = new AdvancedThreatProtectionSettingsImpl(clientObject.getAdvancedThreatProtectionSettings(), this); + } + return advancedThreatProtectionSettings; + } + + /** + * Gets the resource collection API of LocationBasedCapabilitySets. + * + * @return Resource collection API of LocationBasedCapabilitySets. + */ + public LocationBasedCapabilitySets locationBasedCapabilitySets() { + if (this.locationBasedCapabilitySets == null) { + this.locationBasedCapabilitySets + = new LocationBasedCapabilitySetsImpl(clientObject.getLocationBasedCapabilitySets(), this); + } + return locationBasedCapabilitySets; + } + + /** + * Gets the resource collection API of Maintenances. + * + * @return Resource collection API of Maintenances. + */ + public Maintenances maintenances() { + if (this.maintenances == null) { + this.maintenances = new MaintenancesImpl(clientObject.getMaintenances(), this); + } + return maintenances; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; } /** @@ -420,6 +615,30 @@ public CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocatio return checkNameAvailabilityWithoutLocations; } + /** + * Gets the resource collection API of OperationResults. + * + * @return Resource collection API of OperationResults. + */ + public OperationResults operationResults() { + if (this.operationResults == null) { + this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); + } + return operationResults; + } + + /** + * Gets the resource collection API of OperationProgress. + * + * @return Resource collection API of OperationProgress. + */ + public OperationProgress operationProgress() { + if (this.operationProgress == null) { + this.operationProgress = new OperationProgressImpl(clientObject.getOperationProgress(), this); + } + return operationProgress; + } + /** * Gets the resource collection API of GetPrivateDnsZoneSuffixes. * @@ -434,15 +653,15 @@ public GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes() { } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of Replicas. * - * @return Resource collection API of Operations. + * @return Resource collection API of Replicas. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public Replicas replicas() { + if (this.replicas == null) { + this.replicas = new ReplicasImpl(clientObject.getReplicas(), this); } - return operations; + return replicas; } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java new file mode 100644 index 000000000000..dd710edc33ed --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; + +/** + * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionSettingsClient. + */ +public interface AdvancedThreatProtectionSettingsClient { + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, Context context); + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner get(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionInner parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionInner parameters, Context context); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, + Context context); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, Context context); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, + Context context); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java new file mode 100644 index 000000000000..c5ea4b0e8640 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 { + /** + * 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); + + /** + * 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); + + /** + * 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 new file mode 100644 index 000000000000..fb460ab6bb73 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 long-running operation. + */ + @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 long-running operation. + */ + @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 the 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters, + Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateBackupWithResponse(String resourceGroupName, String serverName, + Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java index e6a21fde6914..730efd090a0a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -45,6 +45,36 @@ Response getWithResponse(String resourceGroupName, String ser @ServiceMethod(returns = ReturnType.SINGLE) ServerBackupInner get(String resourceGroupName, String serverName, String backupName); + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. * @@ -53,7 +83,7 @@ Response getWithResponse(String resourceGroupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByServer(String resourceGroupName, String serverName); @@ -67,7 +97,7 @@ Response getWithResponse(String resourceGroupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation 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 index bc8676a2f9a6..3f6b59421315 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -19,7 +19,7 @@ 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 nameAvailabilityRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -34,7 +34,7 @@ Response executeWithResponse(String locationName, * 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 nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index db8d36165b22..ee6e99f67751 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -19,7 +19,7 @@ public interface CheckNameAvailabilityWithoutLocationsClient { /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -33,7 +33,7 @@ Response executeWithResponse(NameAvailabilityRequest name /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index 1f2a6eb140be..52352028321c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -19,7 +19,7 @@ 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 parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -34,7 +34,7 @@ Response executeWithResponse(String locati * 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 parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java index 63b2c4ec5048..220c6b693ffb 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -19,6 +19,36 @@ * An instance of this class provides access to all the operations defined in ConfigurationsClient. */ public interface ConfigurationsClient { + /** + * 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); + /** * Updates a configuration of a server. * @@ -32,7 +62,7 @@ public interface ConfigurationsClient { * @return the {@link SyncPoller} for polling of represents a Configuration. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationInner> beginUpdate(String resourceGroupName, + SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); /** @@ -49,7 +79,7 @@ SyncPoller, ConfigurationInner> beginUpdate(Strin * @return the {@link SyncPoller} for polling of represents a Configuration. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationInner> beginUpdate(String resourceGroupName, + SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters, Context context); /** @@ -65,7 +95,7 @@ SyncPoller, ConfigurationInner> beginUpdate(Strin * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); /** @@ -82,69 +112,106 @@ ConfigurationInner update(String resourceGroupName, String serverName, String co * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters, Context context); /** - * Gets information about a configuration of server. + * 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 information about a configuration of server along with {@link Response}. + * @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) - Response getWithResponse(String resourceGroupName, String serverName, String configurationName, - Context context); + ConfigurationInner update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters); /** - * Gets information about a configuration of server. + * 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 information about a configuration of server. + * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner get(String resourceGroupName, String serverName, String configurationName); + ConfigurationInner update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context); /** - * Update a list of configurations in a given server. + * 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 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. + * @return the response of a Configuration list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationListResultInner> - beginBatchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); /** - * Update a list of configurations in a given server. + * 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 parameters The parameters for updating a list of server configuration. + * @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 the {@link SyncPoller} for polling of a list of server configurations. + * @return the response of a Configuration list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationListResultInner> beginBatchUpdate( - String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName, String tags, + String keyword, Integer page, Integer pageSize, Context context); /** * Update a list of configurations in a given server. @@ -155,11 +222,11 @@ SyncPoller, ConfigurationListResultInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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. + * @return the {@link SyncPoller} for polling of the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, - ConfigurationListForBatchUpdate parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationListResultInner> + beginBatchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters); /** * Update a list of configurations in a given server. @@ -171,36 +238,40 @@ ConfigurationListResultInner batchUpdate(String resourceGroupName, String 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. + * @return the {@link SyncPoller} for polling of the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, - ConfigurationListForBatchUpdate parameters, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationListResultInner> beginBatchUpdate( + String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context); /** - * List all the configurations in a given server. + * 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 as paginated response with {@link PagedIterable}. + * @return the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, + ConfigurationListForBatchUpdate parameters); /** - * List all the configurations in a given server. + * 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 as paginated response with {@link PagedIterable}. + * @return the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, + ConfigurationListForBatchUpdate parameters, 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 index b76b455ee0b6..0019f3bff9ee 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -17,6 +17,36 @@ * An instance of this class provides access to all the operations defined in DatabasesClient. */ public interface DatabasesClient { + /** + * 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); + /** * Creates a new database or updates an existing database. * @@ -140,36 +170,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @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. * @@ -178,7 +178,7 @@ Response getWithResponse(String resourceGroupName, String serverN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a Database list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByServer(String resourceGroupName, String serverName); @@ -192,7 +192,7 @@ Response getWithResponse(String resourceGroupName, String serverN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a Database list operation 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/FirewallRulesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/FirewallRulesClient.java index 4f98e6415488..8d1d9a0ddfcf 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/FirewallRulesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -17,6 +17,36 @@ * An instance of this class provides access to all the operations defined in FirewallRulesClient. */ public interface FirewallRulesClient { + /** + * 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 com.azure.core.management.exception.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); + + /** + * 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 com.azure.core.management.exception.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); + /** * Creates a new firewall rule or updates an existing firewall rule. * @@ -141,36 +171,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String serverName, String firewallRuleName, Context 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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); - - /** - * 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 com.azure.core.management.exception.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); - /** * List all the firewall rules in a given server. * @@ -179,7 +179,7 @@ Response getWithResponse(String resourceGroupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a FirewallRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByServer(String resourceGroupName, String serverName); @@ -193,7 +193,7 @@ Response getWithResponse(String resourceGroupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a FirewallRule list operation 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 index 1f37cbb17073..b38d71b742b5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; 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 index ab0aeb9595dd..a75949f5caac 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java new file mode 100644 index 000000000000..823caeb49cec --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; + +/** + * An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. + */ +public interface LocationBasedCapabilitySetsClient { + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, String capabilitySetName, Context context); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityInner get(String locationName, String capabilitySetName); + + /** + * 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 new file mode 100644 index 000000000000..2356e00000df --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 the response of a LogFile list operation 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 the response of a LogFile list operation 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/LongRunningBackupOperationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupOperationsClient.java new file mode 100644 index 000000000000..6659b27d4824 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupOperationsClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; + +/** + * An instance of this class provides access to all the operations defined in LongRunningBackupOperationsClient. + */ +public interface LongRunningBackupOperationsClient { + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, + String serverName, String backupName); + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, + String serverName, String backupName, ServerBackupV2Inner parameters, Context context); + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName); + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName, + ServerBackupV2Inner parameters, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java new file mode 100644 index 000000000000..479f32ddd90b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; + +/** + * An instance of this class provides access to all the operations defined in LongRunningBackupsClient. + */ +public interface LongRunningBackupsClient { + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serverName, String backupName, + Context context); + + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBackupV2Inner get(String resourceGroupName, String serverName, String backupName); + + /** + * List all the backups for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName); + + /** + * List all the backups for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java new file mode 100644 index 000000000000..59f045014a72 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; + +/** + * An instance of this class provides access to all the operations defined in MaintenancesClient. + */ +public interface MaintenancesClient { + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, + Context context); + + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner read(String resourceGroupName, String serverName, String maintenanceName); + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, String serverName, + String maintenanceName); + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, String serverName, + String maintenanceName, MaintenanceUpdate parameters, Context context); + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName); + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters, Context context); + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName); + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java index 727614c73126..0af8b59fa8e9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -12,26 +12,26 @@ */ public interface MySqlManagementClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -46,6 +46,20 @@ public interface MySqlManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AzureADAdministratorsClient object to access its operations. + * + * @return the AzureADAdministratorsClient object. + */ + AzureADAdministratorsClient getAzureADAdministrators(); + /** * Gets the ServersClient object to access its operations. * @@ -54,11 +68,25 @@ public interface MySqlManagementClient { ServersClient getServers(); /** - * Gets the ReplicasClient object to access its operations. + * Gets the BackupAndExportsClient object to access its operations. * - * @return the ReplicasClient object. + * @return the BackupAndExportsClient object. */ - ReplicasClient getReplicas(); + BackupAndExportsClient getBackupAndExports(); + + /** + * Gets the LogFilesClient object to access its operations. + * + * @return the LogFilesClient object. + */ + LogFilesClient getLogFiles(); + + /** + * Gets the ServersMigrationsClient object to access its operations. + * + * @return the ServersMigrationsClient object. + */ + ServersMigrationsClient getServersMigrations(); /** * Gets the BackupsClient object to access its operations. @@ -68,18 +96,18 @@ public interface MySqlManagementClient { BackupsClient getBackups(); /** - * Gets the FirewallRulesClient object to access its operations. + * Gets the LongRunningBackupsClient object to access its operations. * - * @return the FirewallRulesClient object. + * @return the LongRunningBackupsClient object. */ - FirewallRulesClient getFirewallRules(); + LongRunningBackupsClient getLongRunningBackups(); /** - * Gets the DatabasesClient object to access its operations. + * Gets the LongRunningBackupOperationsClient object to access its operations. * - * @return the DatabasesClient object. + * @return the LongRunningBackupOperationsClient object. */ - DatabasesClient getDatabases(); + LongRunningBackupOperationsClient getLongRunningBackupOperations(); /** * Gets the ConfigurationsClient object to access its operations. @@ -88,6 +116,55 @@ public interface MySqlManagementClient { */ 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 AdvancedThreatProtectionSettingsClient object to access its operations. + * + * @return the AdvancedThreatProtectionSettingsClient object. + */ + AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings(); + + /** + * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * + * @return the LocationBasedCapabilitySetsClient object. + */ + LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets(); + + /** + * Gets the MaintenancesClient object to access its operations. + * + * @return the MaintenancesClient object. + */ + MaintenancesClient getMaintenances(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + /** * Gets the LocationBasedCapabilitiesClient object to access its operations. * @@ -116,6 +193,20 @@ public interface MySqlManagementClient { */ CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWithoutLocations(); + /** + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. + */ + OperationResultsClient getOperationResults(); + + /** + * Gets the OperationProgressClient object to access its operations. + * + * @return the OperationProgressClient object. + */ + OperationProgressClient getOperationProgress(); + /** * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. * @@ -124,9 +215,9 @@ public interface MySqlManagementClient { GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes(); /** - * Gets the OperationsClient object to access its operations. + * Gets the ReplicasClient object to access its operations. * - * @return the OperationsClient object. + * @return the ReplicasClient object. */ - OperationsClient getOperations(); + ReplicasClient getReplicas(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java new file mode 100644 index 000000000000..9544c0ed856b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; + +/** + * An instance of this class provides access to all the operations defined in OperationProgressClient. + */ +public interface OperationProgressClient { + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, String operationId, Context context); + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationProgressResultInner get(String locationName, String operationId); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java new file mode 100644 index 000000000000..c771ed3da5d5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; + +/** + * An instance of this class provides access to all the operations defined in OperationResultsClient. + */ +public interface OperationResultsClient { + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, String operationId, + Context context); + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusExtendedResultInner get(String locationName, String operationId); +} 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 index 5a6a60a28ac1..5d7201a004f9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -15,23 +15,25 @@ */ public interface OperationsClient { /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + * @return the static parameters for a resource group based resource as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + * @return the static parameters for a resource group based resource 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/PrivateEndpointConnectionsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..b850990af1e9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * 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 associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName, 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 associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String serverName, + String privateEndpointConnectionName); + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String serverName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String serverName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context); + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters); + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, + String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, + String privateEndpointConnectionName, Context context); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); + + /** + * 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 all private endpoint connections on a server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServerWithResponse(String resourceGroupName, + String serverName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a server. + */ + @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..a331cc11278f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * 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); + + /** + * 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 for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * 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 for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 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/ReplicasClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ReplicasClient.java index 4ce61a9dfa24..fd427b13f1f9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -22,7 +22,7 @@ public interface ReplicasClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByServer(String resourceGroupName, String serverName); @@ -36,7 +36,7 @@ public interface ReplicasClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation 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 index ba7ffac6c34b..8f7b0af1a3e6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent; @@ -11,14 +11,44 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; 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 { + /** + * 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); + /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * @@ -195,33 +225,6 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou @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. * @@ -229,7 +232,7 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -242,7 +245,7 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -252,7 +255,7 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou * * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -264,7 +267,7 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -321,6 +324,38 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) void failover(String resourceGroupName, String serverName, Context context); + /** + * Validate a deployment of high availability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateEstimateHighAvailabilityWithResponse( + String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, + Context context); + + /** + * Validate a deployment of high availability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HighAvailabilityValidationEstimationInner validateEstimateHighAvailability(String resourceGroupName, + String serverName, HighAvailabilityValidationEstimationInner parameters); + /** * Restarts a server. * @@ -482,4 +517,123 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void stop(String resourceGroupName, String serverName, Context context); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters, Context context); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); + + /** + * Detach VNet 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 detach vnet 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, ServerInner> beginDetachVNet(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters); + + /** + * Detach VNet 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 detach vnet 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, ServerInner> beginDetachVNet(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters, Context context); + + /** + * Detach VNet 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 detach vnet 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerInner detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters); + + /** + * Detach VNet 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 detach vnet 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerInner detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters, + Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java new file mode 100644 index 000000000000..2629b53aea99 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; + +/** + * An instance of this class provides access to all the operations defined in ServersMigrationsClient. + */ +public interface ServersMigrationsClient { + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName, + Context context); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerInner cutoverMigration(String resourceGroupName, String serverName); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java new file mode 100644 index 000000000000..9aee283ac50b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import java.io.IOException; + +/** + * The properties of an administrator. + */ +@Fluent +public final class AdministratorProperties implements JsonSerializable { + /* + * Type of the sever administrator. + */ + private AdministratorType administratorType; + + /* + * Login name of the server administrator. + */ + private String login; + + /* + * SID (object ID) of the server administrator. + */ + private String sid; + + /* + * Tenant ID of the administrator. + */ + private String tenantId; + + /* + * The resource id of the identity used for AAD Authentication. + */ + private String identityResourceId; + + /** + * Creates an instance of AdministratorProperties class. + */ + public AdministratorProperties() { + } + + /** + * Get the administratorType property: Type of the sever administrator. + * + * @return the administratorType value. + */ + public AdministratorType administratorType() { + return this.administratorType; + } + + /** + * Set the administratorType property: Type of the sever administrator. + * + * @param administratorType the administratorType value to set. + * @return the AdministratorProperties object itself. + */ + public AdministratorProperties withAdministratorType(AdministratorType administratorType) { + this.administratorType = administratorType; + return this; + } + + /** + * Get the login property: Login name of the server administrator. + * + * @return the login value. + */ + public String login() { + return this.login; + } + + /** + * Set the login property: Login name of the server administrator. + * + * @param login the login value to set. + * @return the AdministratorProperties object itself. + */ + public AdministratorProperties withLogin(String login) { + this.login = login; + return this; + } + + /** + * Get the sid property: SID (object ID) of the server administrator. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Set the sid property: SID (object ID) of the server administrator. + * + * @param sid the sid value to set. + * @return the AdministratorProperties object itself. + */ + public AdministratorProperties withSid(String sid) { + this.sid = sid; + return this; + } + + /** + * Get the tenantId property: Tenant ID of the administrator. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant ID of the administrator. + * + * @param tenantId the tenantId value to set. + * @return the AdministratorProperties object itself. + */ + public AdministratorProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the identityResourceId property: The resource id of the identity used for AAD Authentication. + * + * @return the identityResourceId value. + */ + public String identityResourceId() { + return this.identityResourceId; + } + + /** + * Set the identityResourceId property: The resource id of the identity used for AAD Authentication. + * + * @param identityResourceId the identityResourceId value to set. + * @return the AdministratorProperties object itself. + */ + public AdministratorProperties withIdentityResourceId(String identityResourceId) { + this.identityResourceId = identityResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("administratorType", + this.administratorType == null ? null : this.administratorType.toString()); + jsonWriter.writeStringField("login", this.login); + jsonWriter.writeStringField("sid", this.sid); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("identityResourceId", this.identityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministratorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdministratorProperties. + */ + public static AdministratorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorProperties deserializedAdministratorProperties = new AdministratorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorType".equals(fieldName)) { + deserializedAdministratorProperties.administratorType + = AdministratorType.fromString(reader.getString()); + } else if ("login".equals(fieldName)) { + deserializedAdministratorProperties.login = reader.getString(); + } else if ("sid".equals(fieldName)) { + deserializedAdministratorProperties.sid = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAdministratorProperties.tenantId = reader.getString(); + } else if ("identityResourceId".equals(fieldName)) { + deserializedAdministratorProperties.identityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java new file mode 100644 index 000000000000..b8a8223e4432 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * A server's Advanced Threat Protection. + */ +@Fluent +public final class AdvancedThreatProtectionInner extends ProxyResource { + /* + * Resource properties. + */ + private AdvancedThreatProtectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AdvancedThreatProtectionInner class. + */ + public AdvancedThreatProtectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private AdvancedThreatProtectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionInner object itself. + */ + public AdvancedThreatProtectionInner withState(AdvancedThreatProtectionState state) { + if (this.innerProperties() == null) { + this.innerProperties = new AdvancedThreatProtectionProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Threat Protection. + * + * @return the provisioningState value. + */ + public AdvancedThreatProtectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedThreatProtectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedThreatProtectionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdvancedThreatProtectionInner. + */ + public static AdvancedThreatProtectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedThreatProtectionInner deserializedAdvancedThreatProtectionInner + = new AdvancedThreatProtectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAdvancedThreatProtectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAdvancedThreatProtectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAdvancedThreatProtectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAdvancedThreatProtectionInner.innerProperties + = AdvancedThreatProtectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAdvancedThreatProtectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedThreatProtectionInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java new file mode 100644 index 000000000000..72b33efa1a82 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of an Advanced Threat Protection setting. + */ +@Fluent +public final class AdvancedThreatProtectionProperties implements JsonSerializable { + /* + * Specifies the UTC creation time of the policy. + */ + private OffsetDateTime creationTime; + + /* + * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been + * applied yet on the specific database or server. + */ + private AdvancedThreatProtectionState state; + + /* + * Provisioning state of the Threat Protection. + */ + private AdvancedThreatProtectionProvisioningState provisioningState; + + /** + * Creates an instance of AdvancedThreatProtectionProperties class. + */ + public AdvancedThreatProtectionProperties() { + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionProperties object itself. + */ + public AdvancedThreatProtectionProperties withState(AdvancedThreatProtectionState state) { + this.state = state; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Threat Protection. + * + * @return the provisioningState value. + */ + public AdvancedThreatProtectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedThreatProtectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedThreatProtectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedThreatProtectionProperties. + */ + public static AdvancedThreatProtectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedThreatProtectionProperties deserializedAdvancedThreatProtectionProperties + = new AdvancedThreatProtectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("creationTime".equals(fieldName)) { + deserializedAdvancedThreatProtectionProperties.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedAdvancedThreatProtectionProperties.state + = AdvancedThreatProtectionState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAdvancedThreatProtectionProperties.provisioningState + = AdvancedThreatProtectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedThreatProtectionProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java new file mode 100644 index 000000000000..7de99e927bdb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.io.IOException; + +/** + * Properties of Advanced Threat Protection that can be updated. + */ +@Fluent +public final class AdvancedThreatProtectionUpdateProperties + implements JsonSerializable { + /* + * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been + * applied yet on the specific database or server. + */ + private AdvancedThreatProtectionState state; + + /** + * Creates an instance of AdvancedThreatProtectionUpdateProperties class. + */ + public AdvancedThreatProtectionUpdateProperties() { + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionUpdateProperties object itself. + */ + public AdvancedThreatProtectionUpdateProperties withState(AdvancedThreatProtectionState state) { + this.state = state; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedThreatProtectionUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedThreatProtectionUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdvancedThreatProtectionUpdateProperties. + */ + public static AdvancedThreatProtectionUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedThreatProtectionUpdateProperties deserializedAdvancedThreatProtectionUpdateProperties + = new AdvancedThreatProtectionUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedAdvancedThreatProtectionUpdateProperties.state + = AdvancedThreatProtectionState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedThreatProtectionUpdateProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java new file mode 100644 index 000000000000..9e6af00c1e46 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import java.io.IOException; + +/** + * Represents a Administrator. + */ +@Fluent +public final class AzureADAdministratorInner extends ProxyResource { + /* + * The properties of an administrator. + */ + private AdministratorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AzureADAdministratorInner class. + */ + public AzureADAdministratorInner() { + } + + /** + * Get the innerProperties property: The properties of an administrator. + * + * @return the innerProperties value. + */ + private AdministratorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the administratorType property: Type of the sever administrator. + * + * @return the administratorType value. + */ + public AdministratorType administratorType() { + return this.innerProperties() == null ? null : this.innerProperties().administratorType(); + } + + /** + * Set the administratorType property: Type of the sever administrator. + * + * @param administratorType the administratorType value to set. + * @return the AzureADAdministratorInner object itself. + */ + public AzureADAdministratorInner withAdministratorType(AdministratorType administratorType) { + if (this.innerProperties() == null) { + this.innerProperties = new AdministratorProperties(); + } + this.innerProperties().withAdministratorType(administratorType); + return this; + } + + /** + * Get the login property: Login name of the server administrator. + * + * @return the login value. + */ + public String login() { + return this.innerProperties() == null ? null : this.innerProperties().login(); + } + + /** + * Set the login property: Login name of the server administrator. + * + * @param login the login value to set. + * @return the AzureADAdministratorInner object itself. + */ + public AzureADAdministratorInner withLogin(String login) { + if (this.innerProperties() == null) { + this.innerProperties = new AdministratorProperties(); + } + this.innerProperties().withLogin(login); + return this; + } + + /** + * Get the sid property: SID (object ID) of the server administrator. + * + * @return the sid value. + */ + public String sid() { + return this.innerProperties() == null ? null : this.innerProperties().sid(); + } + + /** + * Set the sid property: SID (object ID) of the server administrator. + * + * @param sid the sid value to set. + * @return the AzureADAdministratorInner object itself. + */ + public AzureADAdministratorInner withSid(String sid) { + if (this.innerProperties() == null) { + this.innerProperties = new AdministratorProperties(); + } + this.innerProperties().withSid(sid); + return this; + } + + /** + * Get the tenantId property: Tenant ID of the administrator. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: Tenant ID of the administrator. + * + * @param tenantId the tenantId value to set. + * @return the AzureADAdministratorInner object itself. + */ + public AzureADAdministratorInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new AdministratorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the identityResourceId property: The resource id of the identity used for AAD Authentication. + * + * @return the identityResourceId value. + */ + public String identityResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().identityResourceId(); + } + + /** + * Set the identityResourceId property: The resource id of the identity used for AAD Authentication. + * + * @param identityResourceId the identityResourceId value to set. + * @return the AzureADAdministratorInner object itself. + */ + public AzureADAdministratorInner withIdentityResourceId(String identityResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new AdministratorProperties(); + } + this.innerProperties().withIdentityResourceId(identityResourceId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureADAdministratorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureADAdministratorInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureADAdministratorInner. + */ + public static AzureADAdministratorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureADAdministratorInner deserializedAzureADAdministratorInner = new AzureADAdministratorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureADAdministratorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAzureADAdministratorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureADAdministratorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAzureADAdministratorInner.innerProperties = AdministratorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAzureADAdministratorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureADAdministratorInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java new file mode 100644 index 000000000000..12aa20211506 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents BackupAndExportAPI Response. + */ +@Immutable +public final class BackupAndExportResponseInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private BackupAndExportResponseProperties innerProperties; + + /* + * The error object. + */ + private ManagementError error; + + /* + * The name of the backup and export response. + */ + private String name; + + /* + * The operation status + */ + private OperationStatus status; + + /* + * Start time + */ + private OffsetDateTime startTime; + + /* + * End time + */ + private OffsetDateTime endTime; + + /* + * Operation progress (0-100). + */ + private Double percentComplete; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BackupAndExportResponseInner class. + */ + private BackupAndExportResponseInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private BackupAndExportResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the error property: The error object. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the name property: The name of the backup and export response. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the status property: The operation status. + * + * @return the status value. + */ + public OperationStatus status() { + return this.status; + } + + /** + * Get the startTime property: Start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the percentComplete property: Operation progress (0-100). + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes(); + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupAndExportResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupAndExportResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BackupAndExportResponseInner. + */ + public static BackupAndExportResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupAndExportResponseInner deserializedBackupAndExportResponseInner = new BackupAndExportResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBackupAndExportResponseInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBackupAndExportResponseInner.type = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBackupAndExportResponseInner.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBackupAndExportResponseInner.innerProperties + = BackupAndExportResponseProperties.fromJson(reader); + } else if ("error".equals(fieldName)) { + deserializedBackupAndExportResponseInner.error = ManagementError.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedBackupAndExportResponseInner.status = OperationStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedBackupAndExportResponseInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedBackupAndExportResponseInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("percentComplete".equals(fieldName)) { + deserializedBackupAndExportResponseInner.percentComplete + = reader.getNullable(JsonReader::getDouble); + } else if ("systemData".equals(fieldName)) { + deserializedBackupAndExportResponseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupAndExportResponseInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java new file mode 100644 index 000000000000..118ffc87d9de --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BackupAndExport Response Properties. + */ +@Immutable +public final class BackupAndExportResponseProperties implements JsonSerializable { + /* + * Size of datasource in bytes + */ + private Long datasourceSizeInBytes; + + /* + * Data transferred in bytes + */ + private Long dataTransferredInBytes; + + /* + * Metadata related to backup to be stored for restoring resource in key-value pairs. + */ + private String backupMetadata; + + /** + * Creates an instance of BackupAndExportResponseProperties class. + */ + private BackupAndExportResponseProperties() { + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.datasourceSizeInBytes; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.dataTransferredInBytes; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("datasourceSizeInBytes", this.datasourceSizeInBytes); + jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); + jsonWriter.writeStringField("backupMetadata", this.backupMetadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupAndExportResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupAndExportResponseProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupAndExportResponseProperties. + */ + public static BackupAndExportResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupAndExportResponseProperties deserializedBackupAndExportResponseProperties + = new BackupAndExportResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("datasourceSizeInBytes".equals(fieldName)) { + deserializedBackupAndExportResponseProperties.datasourceSizeInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("dataTransferredInBytes".equals(fieldName)) { + deserializedBackupAndExportResponseProperties.dataTransferredInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("backupMetadata".equals(fieldName)) { + deserializedBackupAndExportResponseProperties.backupMetadata = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupAndExportResponseProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java new file mode 100644 index 000000000000..6c93c89f417a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.FeatureProperty; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; +import java.io.IOException; +import java.util.List; + +/** + * Represents a location capability set. + */ +@Immutable +public final class CapabilityInner extends ProxyResource { + /* + * The properties of a location capability set. + */ + private CapabilityPropertiesV2 innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CapabilityInner class. + */ + private CapabilityInner() { + } + + /** + * Get the innerProperties property: The properties of a location capability set. + * + * @return the innerProperties value. + */ + private CapabilityPropertiesV2 innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the supportedGeoBackupRegions property: supported geo backup regions. + * + * @return the supportedGeoBackupRegions value. + */ + public List supportedGeoBackupRegions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedGeoBackupRegions(); + } + + /** + * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. + * + * @return the supportedFlexibleServerEditions value. + */ + public List supportedFlexibleServerEditions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedFlexibleServerEditions(); + } + + /** + * Get the supportedServerVersions property: A list of supported server versions. + * + * @return the supportedServerVersions value. + */ + public List supportedServerVersions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedServerVersions(); + } + + /** + * Get the supportedFeatures property: A list of supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.innerProperties() == null ? null : this.innerProperties().supportedFeatures(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilityInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CapabilityInner. + */ + public static CapabilityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilityInner deserializedCapabilityInner = new CapabilityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCapabilityInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCapabilityInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCapabilityInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCapabilityInner.innerProperties = CapabilityPropertiesV2.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCapabilityInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilityInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesInner.java index 45ca9dcce86e..f7f2d50852a6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -41,7 +41,7 @@ public final class CapabilityPropertiesInner implements JsonSerializable 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java new file mode 100644 index 000000000000..c2caa4533da1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.FeatureProperty; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; +import java.io.IOException; +import java.util.List; + +/** + * Location capability. + */ +@Immutable +public final class CapabilityPropertiesV2 implements JsonSerializable { + /* + * supported geo backup regions + */ + private List supportedGeoBackupRegions; + + /* + * A list of supported flexible server editions. + */ + private List supportedFlexibleServerEditions; + + /* + * A list of supported server versions. + */ + private List supportedServerVersions; + + /* + * A list of supported features. + */ + private List supportedFeatures; + + /** + * Creates an instance of CapabilityPropertiesV2 class. + */ + private CapabilityPropertiesV2() { + } + + /** + * Get the supportedGeoBackupRegions property: supported geo backup regions. + * + * @return the supportedGeoBackupRegions value. + */ + public List supportedGeoBackupRegions() { + return this.supportedGeoBackupRegions; + } + + /** + * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. + * + * @return the supportedFlexibleServerEditions value. + */ + public List supportedFlexibleServerEditions() { + return this.supportedFlexibleServerEditions; + } + + /** + * Get the supportedServerVersions property: A list of supported server versions. + * + * @return the supportedServerVersions value. + */ + public List supportedServerVersions() { + return this.supportedServerVersions; + } + + /** + * Get the supportedFeatures property: A list of supported features. + * + * @return the supportedFeatures value. + */ + public List supportedFeatures() { + return this.supportedFeatures; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilityPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilityPropertiesV2 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilityPropertiesV2. + */ + public static CapabilityPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilityPropertiesV2 deserializedCapabilityPropertiesV2 = new CapabilityPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportedGeoBackupRegions".equals(fieldName)) { + List supportedGeoBackupRegions = reader.readArray(reader1 -> reader1.getString()); + deserializedCapabilityPropertiesV2.supportedGeoBackupRegions = supportedGeoBackupRegions; + } else if ("supportedFlexibleServerEditions".equals(fieldName)) { + List supportedFlexibleServerEditions + = reader.readArray(reader1 -> ServerEditionCapabilityV2.fromJson(reader1)); + deserializedCapabilityPropertiesV2.supportedFlexibleServerEditions + = supportedFlexibleServerEditions; + } else if ("supportedServerVersions".equals(fieldName)) { + List supportedServerVersions + = reader.readArray(reader1 -> ServerVersionCapabilityV2.fromJson(reader1)); + deserializedCapabilityPropertiesV2.supportedServerVersions = supportedServerVersions; + } else if ("supportedFeatures".equals(fieldName)) { + List supportedFeatures + = reader.readArray(reader1 -> FeatureProperty.fromJson(reader1)); + deserializedCapabilityPropertiesV2.supportedFeatures = supportedFeatures; + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilityPropertiesV2; + }); + } +} 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 index 720aeb6e3835..3045797604c2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -73,14 +73,6 @@ public ConfigurationForBatchUpdateProperties withSource(String source) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java index abffbd42f30f..a31117734f3d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -27,7 +27,7 @@ public final class ConfigurationInner extends ProxyResource { private ConfigurationProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -62,7 +62,7 @@ private ConfigurationProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -123,6 +123,29 @@ public ConfigurationInner withValue(String value) { return this; } + /** + * Get the currentValue property: Current value of the configuration. + * + * @return the currentValue value. + */ + public String currentValue() { + return this.innerProperties() == null ? null : this.innerProperties().currentValue(); + } + + /** + * Set the currentValue property: Current value of the configuration. + * + * @param currentValue the currentValue value to set. + * @return the ConfigurationInner object itself. + */ + public ConfigurationInner withCurrentValue(String currentValue) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationProperties(); + } + this.innerProperties().withCurrentValue(currentValue); + return this; + } + /** * Get the description property: Description of the configuration. * @@ -132,6 +155,15 @@ 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. * @@ -209,17 +241,6 @@ 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(); - } - } - /** * {@inheritDoc} */ 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 index d41f3bf2bfd1..6a41065cf6cb 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,28 +13,28 @@ import java.util.List; /** - * A list of server configurations. + * The response of a Configuration list operation. */ -@Fluent +@Immutable public final class ConfigurationListResultInner implements JsonSerializable { /* - * The list of server configurations. + * The Configuration items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ConfigurationListResultInner class. */ - public ConfigurationListResultInner() { + private ConfigurationListResultInner() { } /** - * Get the value property: The list of server configurations. + * Get the value property: The Configuration items on this page. * * @return the value value. */ @@ -43,18 +43,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -62,28 +51,6 @@ 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java index 8c29eaa6b186..86c2315e4257 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -25,11 +25,21 @@ public final class ConfigurationProperties implements JsonSerializable { /* @@ -25,7 +25,7 @@ public final class GetPrivateDnsZoneSuffixResponseInner /** * Creates an instance of GetPrivateDnsZoneSuffixResponseInner class. */ - public GetPrivateDnsZoneSuffixResponseInner() { + private GetPrivateDnsZoneSuffixResponseInner() { } /** @@ -37,25 +37,6 @@ 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() { - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/HighAvailabilityValidationEstimationInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/HighAvailabilityValidationEstimationInner.java new file mode 100644 index 000000000000..faf9a7c5da3a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/HighAvailabilityValidationEstimationInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * High availability validation properties of a server. + */ +@Fluent +public final class HighAvailabilityValidationEstimationInner + implements JsonSerializable { + /* + * Estimated seconds of downtime for the deployment. + */ + private Integer estimatedDowntime; + + /* + * Scheduled Availability zone of the standby server. + */ + private String scheduledStandbyAvailabilityZone; + + /* + * Expected Availability zone of the standby server. + */ + private String expectedStandbyAvailabilityZone; + + /** + * Creates an instance of HighAvailabilityValidationEstimationInner class. + */ + public HighAvailabilityValidationEstimationInner() { + } + + /** + * Get the estimatedDowntime property: Estimated seconds of downtime for the deployment. + * + * @return the estimatedDowntime value. + */ + public Integer estimatedDowntime() { + return this.estimatedDowntime; + } + + /** + * Get the scheduledStandbyAvailabilityZone property: Scheduled Availability zone of the standby server. + * + * @return the scheduledStandbyAvailabilityZone value. + */ + public String scheduledStandbyAvailabilityZone() { + return this.scheduledStandbyAvailabilityZone; + } + + /** + * Get the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. + * + * @return the expectedStandbyAvailabilityZone value. + */ + public String expectedStandbyAvailabilityZone() { + return this.expectedStandbyAvailabilityZone; + } + + /** + * Set the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. + * + * @param expectedStandbyAvailabilityZone the expectedStandbyAvailabilityZone value to set. + * @return the HighAvailabilityValidationEstimationInner object itself. + */ + public HighAvailabilityValidationEstimationInner + withExpectedStandbyAvailabilityZone(String expectedStandbyAvailabilityZone) { + this.expectedStandbyAvailabilityZone = expectedStandbyAvailabilityZone; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expectedStandbyAvailabilityZone", this.expectedStandbyAvailabilityZone); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HighAvailabilityValidationEstimationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HighAvailabilityValidationEstimationInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HighAvailabilityValidationEstimationInner. + */ + public static HighAvailabilityValidationEstimationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HighAvailabilityValidationEstimationInner deserializedHighAvailabilityValidationEstimationInner + = new HighAvailabilityValidationEstimationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("estimatedDowntime".equals(fieldName)) { + deserializedHighAvailabilityValidationEstimationInner.estimatedDowntime + = reader.getNullable(JsonReader::getInt); + } else if ("scheduledStandbyAvailabilityZone".equals(fieldName)) { + deserializedHighAvailabilityValidationEstimationInner.scheduledStandbyAvailabilityZone + = reader.getString(); + } else if ("expectedStandbyAvailabilityZone".equals(fieldName)) { + deserializedHighAvailabilityValidationEstimationInner.expectedStandbyAvailabilityZone + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHighAvailabilityValidationEstimationInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java new file mode 100644 index 000000000000..bb4094ae8d57 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Represents a logFile. + */ +@Immutable +public final class LogFileInner extends ProxyResource { + /* + * The properties of a logFile. + */ + private LogFileProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogFileInner class. + */ + private LogFileInner() { + } + + /** + * Get the innerProperties property: The properties of a logFile. + * + * @return the innerProperties value. + */ + private LogFileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the sizeInKB property: The size in kb of the logFile. + * + * @return the sizeInKB value. + */ + public Long sizeInKB() { + return this.innerProperties() == null ? null : this.innerProperties().sizeInKB(); + } + + /** + * 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(); + } + + /** + * Get the type property: Type of the log file. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogFileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogFileInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogFileInner. + */ + public static LogFileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogFileInner deserializedLogFileInner = new LogFileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogFileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogFileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogFileInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLogFileInner.innerProperties = LogFileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogFileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogFileInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java new file mode 100644 index 000000000000..79821d3de4e3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The properties of a logFile. + */ +@Immutable +public final class LogFileProperties implements JsonSerializable { + /* + * The size in kb of the logFile. + */ + private Long sizeInKB; + + /* + * Creation timestamp of the log file. + */ + private OffsetDateTime createdTime; + + /* + * Type of the log file. + */ + private String type; + + /* + * Last modified timestamp of the log file. + */ + private OffsetDateTime lastModifiedTime; + + /* + * The url to download the log file from. + */ + private String url; + + /** + * Creates an instance of LogFileProperties class. + */ + private LogFileProperties() { + } + + /** + * Get the sizeInKB property: The size in kb of the logFile. + * + * @return the sizeInKB value. + */ + public Long sizeInKB() { + return this.sizeInKB; + } + + /** + * Get the createdTime property: Creation timestamp of the log file. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the type property: Type of the log file. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the lastModifiedTime property: Last modified timestamp of the log file. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the url property: The url to download the log file from. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("sizeInKB", this.sizeInKB); + jsonWriter.writeStringField("createdTime", + this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("lastModifiedTime", + this.lastModifiedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogFileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogFileProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogFileProperties. + */ + public static LogFileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogFileProperties deserializedLogFileProperties = new LogFileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sizeInKB".equals(fieldName)) { + deserializedLogFileProperties.sizeInKB = reader.getNullable(JsonReader::getLong); + } else if ("createdTime".equals(fieldName)) { + deserializedLogFileProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedLogFileProperties.type = reader.getString(); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedLogFileProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("url".equals(fieldName)) { + deserializedLogFileProperties.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogFileProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java new file mode 100644 index 000000000000..f3ede450eb27 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Represents a maintenance. + */ +@Immutable +public final class MaintenanceInner extends ProxyResource { + /* + * The properties of a maintenance + */ + private MaintenanceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MaintenanceInner class. + */ + private MaintenanceInner() { + } + + /** + * Get the innerProperties property: The properties of a maintenance. + * + * @return the innerProperties value. + */ + private MaintenanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the maintenanceType property: A string defines maintenance type. + * + * @return the maintenanceType value. + */ + public MaintenanceType maintenanceType() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceType(); + } + + /** + * Get the maintenanceState property: A string describes the maintenance status. + * + * @return the maintenanceState value. + */ + public MaintenanceState maintenanceState() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceState(); + } + + /** + * Get the maintenanceStartTime property: The start time for a maintenance. + * + * @return the maintenanceStartTime value. + */ + public OffsetDateTime maintenanceStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); + } + + /** + * Get the maintenanceEndTime property: The end time for a maintenance. + * + * @return the maintenanceEndTime value. + */ + public OffsetDateTime maintenanceEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceEndTime(); + } + + /** + * Get the maintenanceExecutionStartTime property: The start time for a maintenance execution. + * + * @return the maintenanceExecutionStartTime value. + */ + public OffsetDateTime maintenanceExecutionStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceExecutionStartTime(); + } + + /** + * Get the maintenanceExecutionEndTime property: The end time for a maintenance execution. + * + * @return the maintenanceExecutionEndTime value. + */ + public OffsetDateTime maintenanceExecutionEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceExecutionEndTime(); + } + + /** + * Get the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. + * + * @return the maintenanceAvailableScheduleMinTime value. + */ + public OffsetDateTime maintenanceAvailableScheduleMinTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceAvailableScheduleMinTime(); + } + + /** + * Get the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. + * + * @return the maintenanceAvailableScheduleMaxTime value. + */ + public OffsetDateTime maintenanceAvailableScheduleMaxTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceAvailableScheduleMaxTime(); + } + + /** + * Get the maintenanceTitle property: The maintenance title. + * + * @return the maintenanceTitle value. + */ + public String maintenanceTitle() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceTitle(); + } + + /** + * Get the maintenanceDescription property: The maintenance description. + * + * @return the maintenanceDescription value. + */ + public String maintenanceDescription() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceDescription(); + } + + /** + * Get the provisioningState property: Provisioning state of the Maintenance. + * + * @return the provisioningState value. + */ + public MaintenanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MaintenanceInner. + */ + public static MaintenanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceInner deserializedMaintenanceInner = new MaintenanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMaintenanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMaintenanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMaintenanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMaintenanceInner.innerProperties = MaintenanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMaintenanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java new file mode 100644 index 000000000000..00e730286f81 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The properties of a maintenance resource. + */ +@Immutable +public final class MaintenanceProperties implements JsonSerializable { + /* + * A string defines maintenance type. + */ + private MaintenanceType maintenanceType; + + /* + * A string describes the maintenance status + */ + private MaintenanceState maintenanceState; + + /* + * The start time for a maintenance. + */ + private OffsetDateTime maintenanceStartTime; + + /* + * The end time for a maintenance. + */ + private OffsetDateTime maintenanceEndTime; + + /* + * The start time for a maintenance execution. + */ + private OffsetDateTime maintenanceExecutionStartTime; + + /* + * The end time for a maintenance execution. + */ + private OffsetDateTime maintenanceExecutionEndTime; + + /* + * The min time the maintenance can be rescheduled. + */ + private OffsetDateTime maintenanceAvailableScheduleMinTime; + + /* + * The max time the maintenance can be rescheduled. + */ + private OffsetDateTime maintenanceAvailableScheduleMaxTime; + + /* + * The maintenance title. + */ + private String maintenanceTitle; + + /* + * The maintenance description. + */ + private String maintenanceDescription; + + /* + * Provisioning state of the Maintenance. + */ + private MaintenanceProvisioningState provisioningState; + + /** + * Creates an instance of MaintenanceProperties class. + */ + private MaintenanceProperties() { + } + + /** + * Get the maintenanceType property: A string defines maintenance type. + * + * @return the maintenanceType value. + */ + public MaintenanceType maintenanceType() { + return this.maintenanceType; + } + + /** + * Get the maintenanceState property: A string describes the maintenance status. + * + * @return the maintenanceState value. + */ + public MaintenanceState maintenanceState() { + return this.maintenanceState; + } + + /** + * Get the maintenanceStartTime property: The start time for a maintenance. + * + * @return the maintenanceStartTime value. + */ + public OffsetDateTime maintenanceStartTime() { + return this.maintenanceStartTime; + } + + /** + * Get the maintenanceEndTime property: The end time for a maintenance. + * + * @return the maintenanceEndTime value. + */ + public OffsetDateTime maintenanceEndTime() { + return this.maintenanceEndTime; + } + + /** + * Get the maintenanceExecutionStartTime property: The start time for a maintenance execution. + * + * @return the maintenanceExecutionStartTime value. + */ + public OffsetDateTime maintenanceExecutionStartTime() { + return this.maintenanceExecutionStartTime; + } + + /** + * Get the maintenanceExecutionEndTime property: The end time for a maintenance execution. + * + * @return the maintenanceExecutionEndTime value. + */ + public OffsetDateTime maintenanceExecutionEndTime() { + return this.maintenanceExecutionEndTime; + } + + /** + * Get the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. + * + * @return the maintenanceAvailableScheduleMinTime value. + */ + public OffsetDateTime maintenanceAvailableScheduleMinTime() { + return this.maintenanceAvailableScheduleMinTime; + } + + /** + * Get the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. + * + * @return the maintenanceAvailableScheduleMaxTime value. + */ + public OffsetDateTime maintenanceAvailableScheduleMaxTime() { + return this.maintenanceAvailableScheduleMaxTime; + } + + /** + * Get the maintenanceTitle property: The maintenance title. + * + * @return the maintenanceTitle value. + */ + public String maintenanceTitle() { + return this.maintenanceTitle; + } + + /** + * Get the maintenanceDescription property: The maintenance description. + * + * @return the maintenanceDescription value. + */ + public String maintenanceDescription() { + return this.maintenanceDescription; + } + + /** + * Get the provisioningState property: Provisioning state of the Maintenance. + * + * @return the provisioningState value. + */ + public MaintenanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("maintenanceStartTime", + this.maintenanceStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maintenanceStartTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceProperties. + */ + public static MaintenanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceProperties deserializedMaintenanceProperties = new MaintenanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maintenanceType".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceType = MaintenanceType.fromString(reader.getString()); + } else if ("maintenanceState".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceState + = MaintenanceState.fromString(reader.getString()); + } else if ("maintenanceStartTime".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maintenanceEndTime".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceEndTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maintenanceExecutionStartTime".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceExecutionStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maintenanceExecutionEndTime".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceExecutionEndTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maintenanceAvailableScheduleMinTime".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceAvailableScheduleMinTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maintenanceAvailableScheduleMaxTime".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceAvailableScheduleMaxTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maintenanceTitle".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceTitle = reader.getString(); + } else if ("maintenanceDescription".equals(fieldName)) { + deserializedMaintenanceProperties.maintenanceDescription = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedMaintenanceProperties.provisioningState + = MaintenanceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java new file mode 100644 index 000000000000..517c4d4247c5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The properties of a maintenance update parameter. + */ +@Fluent +public final class MaintenancePropertiesForUpdate implements JsonSerializable { + /* + * The start time for a maintenance. + */ + private OffsetDateTime maintenanceStartTime; + + /** + * Creates an instance of MaintenancePropertiesForUpdate class. + */ + public MaintenancePropertiesForUpdate() { + } + + /** + * Get the maintenanceStartTime property: The start time for a maintenance. + * + * @return the maintenanceStartTime value. + */ + public OffsetDateTime maintenanceStartTime() { + return this.maintenanceStartTime; + } + + /** + * Set the maintenanceStartTime property: The start time for a maintenance. + * + * @param maintenanceStartTime the maintenanceStartTime value to set. + * @return the MaintenancePropertiesForUpdate object itself. + */ + public MaintenancePropertiesForUpdate withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { + this.maintenanceStartTime = maintenanceStartTime; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("maintenanceStartTime", + this.maintenanceStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maintenanceStartTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenancePropertiesForUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenancePropertiesForUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenancePropertiesForUpdate. + */ + public static MaintenancePropertiesForUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenancePropertiesForUpdate deserializedMaintenancePropertiesForUpdate + = new MaintenancePropertiesForUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maintenanceStartTime".equals(fieldName)) { + deserializedMaintenancePropertiesForUpdate.maintenanceStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenancePropertiesForUpdate; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/NameAvailabilityInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/NameAvailabilityInner.java index 7ecbed0f8bd1..23ff99aa5fe0 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Represents a resource name availability. */ -@Fluent +@Immutable public final class NameAvailabilityInner implements JsonSerializable { /* * Error Message. @@ -34,7 +34,7 @@ public final class NameAvailabilityInner implements JsonSerializable { /* - * The name of the operation being performed on this particular object. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * The localized display information for this particular operation or action. + * Localized display information for this particular operation. */ private OperationDisplay display; /* - * The intended executor of the operation. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ - private String origin; + private Origin origin; /* * Additional descriptions for the operation. @@ -41,11 +44,12 @@ public final class OperationInner implements JsonSerializable { /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: The name of the operation being performed on this particular object. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -54,18 +58,7 @@ public String 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. + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ @@ -74,36 +67,15 @@ public OperationDisplay 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. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * * @return the origin value. */ - public String origin() { + public Origin 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. * @@ -113,37 +85,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); jsonWriter.writeJsonField("display", this.display); - jsonWriter.writeStringField("origin", this.origin); jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); return jsonWriter.writeEndObject(); } @@ -168,7 +116,7 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = reader.getString(); + deserializedOperationInner.origin = Origin.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { Map properties = reader.readMap(reader1 -> reader1.readUntyped()); deserializedOperationInner.properties = properties; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java new file mode 100644 index 000000000000..3865fc743c37 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents Operation Results API Response. + */ +@Immutable +public final class OperationProgressResultInner extends OperationStatusResult { + /* + * The response properties specific to the operation + */ + private OperationProgressResponseType properties; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * The operations list. + */ + private List operations; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * Operation status. + */ + private String status; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /** + * Creates an instance of OperationProgressResultInner class. + */ + private OperationProgressResultInner() { + } + + /** + * Get the properties property: The response properties specific to the operation. + * + * @return the properties value. + */ + public OperationProgressResponseType properties() { + return this.properties; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + @Override + public String resourceId() { + return this.resourceId; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + @Override + public ManagementError error() { + return this.error; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + @Override + public List operations() { + return this.operations; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + @Override + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + @Override + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + @Override + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + @Override + public String status() { + return this.status; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", status()); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeNumberField("percentComplete", percentComplete()); + jsonWriter.writeStringField("startTime", + startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); + jsonWriter.writeStringField("endTime", + endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); + jsonWriter.writeArrayField("operations", operations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", error()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProgressResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProgressResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationProgressResultInner. + */ + public static OperationProgressResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProgressResultInner deserializedOperationProgressResultInner = new OperationProgressResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationProgressResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationProgressResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationProgressResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationProgressResultInner.percentComplete + = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationProgressResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationProgressResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); + deserializedOperationProgressResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationProgressResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationProgressResultInner.resourceId = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationProgressResultInner.properties + = OperationProgressResponseType.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProgressResultInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java new file mode 100644 index 000000000000..58d24e141c80 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Represents Operation Results API Response. + */ +@Immutable +public final class OperationStatusExtendedResultInner extends OperationStatusResult { + /* + * The extended properties of Operation Results + */ + private Map properties; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * The operations list. + */ + private List operations; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * Operation status. + */ + private String status; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /** + * Creates an instance of OperationStatusExtendedResultInner class. + */ + private OperationStatusExtendedResultInner() { + } + + /** + * Get the properties property: The extended properties of Operation Results. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + @Override + public String resourceId() { + return this.resourceId; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + @Override + public ManagementError error() { + return this.error; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + @Override + public List operations() { + return this.operations; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + @Override + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + @Override + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + @Override + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + @Override + public String status() { + return this.status; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", status()); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeNumberField("percentComplete", percentComplete()); + jsonWriter.writeStringField("startTime", + startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); + jsonWriter.writeStringField("endTime", + endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); + jsonWriter.writeArrayField("operations", operations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", error()); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusExtendedResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusExtendedResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusExtendedResultInner. + */ + public static OperationStatusExtendedResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusExtendedResultInner deserializedOperationStatusExtendedResultInner + = new OperationStatusExtendedResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.percentComplete + = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); + deserializedOperationStatusExtendedResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusExtendedResultInner.resourceId = reader.getString(); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedOperationStatusExtendedResultInner.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusExtendedResultInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/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..ef5be4d629bb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * A private endpoint connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} 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..89a806573c23 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PrivateEndpointConnection list operation. + */ +@Immutable +public final class PrivateEndpointConnectionListResultInner + implements JsonSerializable { + /* + * The PrivateEndpointConnection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResultInner class. + */ + private PrivateEndpointConnectionListResultInner() { + } + + /** + * Get the value property: The PrivateEndpointConnection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResultInner. + */ + public static PrivateEndpointConnectionListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResultInner deserializedPrivateEndpointConnectionListResultInner + = new PrivateEndpointConnectionListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResultInner; + }); + } +} 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..0f287d3d71b1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private endpoint connection. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The private endpoint resource. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/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..eb175c0d0590 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceProperties; +import java.io.IOException; + +/** + * A private link resource. + */ +@Immutable +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + private PrivateLinkResourceInner() { + } + + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.properties = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java index fb2bcb081b03..64abdf5a6992 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * Server backup properties. */ -@Fluent +@Immutable public final class ServerBackupInner extends ProxyResource { /* * The properties of a server backup. @@ -24,7 +24,7 @@ public final class ServerBackupInner extends ProxyResource { private ServerBackupProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -46,7 +46,7 @@ public final class ServerBackupInner extends ProxyResource { /** * Creates an instance of ServerBackupInner class. */ - public ServerBackupInner() { + private ServerBackupInner() { } /** @@ -59,7 +59,7 @@ private ServerBackupProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -106,20 +106,6 @@ 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). * @@ -129,20 +115,6 @@ 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. * @@ -152,31 +124,6 @@ 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(); - } - } - /** * {@inheritDoc} */ 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 index d853be9f7238..29ac757dcbae 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The properties of a server backup. */ -@Fluent +@Immutable public final class ServerBackupProperties implements JsonSerializable { /* * Backup type. @@ -37,7 +37,7 @@ public final class ServerBackupProperties implements JsonSerializable { + /* + * Backup name + */ + private String backupNameV2; + + /* + * The backupType property. + */ + private BackupType backupType; + + /* + * Backup completed time (ISO8601 format). + */ + private OffsetDateTime completedTime; + + /* + * Backup source + */ + private String source; + + /* + * The provisioning state of backup resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ServerBackupPropertiesV2 class. + */ + public ServerBackupPropertiesV2() { + } + + /** + * Get the backupNameV2 property: Backup name. + * + * @return the backupNameV2 value. + */ + public String backupNameV2() { + return this.backupNameV2; + } + + /** + * Set the backupNameV2 property: Backup name. + * + * @param backupNameV2 the backupNameV2 value to set. + * @return the ServerBackupPropertiesV2 object itself. + */ + public ServerBackupPropertiesV2 withBackupNameV2(String backupNameV2) { + this.backupNameV2 = backupNameV2; + return this; + } + + /** + * Get the backupType property: The backupType property. + * + * @return the backupType value. + */ + public BackupType backupType() { + return this.backupType; + } + + /** + * Set the backupType property: The backupType property. + * + * @param backupType the backupType value to set. + * @return the ServerBackupPropertiesV2 object itself. + */ + public ServerBackupPropertiesV2 withBackupType(BackupType backupType) { + this.backupType = backupType; + return this; + } + + /** + * Get the completedTime property: Backup completed time (ISO8601 format). + * + * @return the completedTime value. + */ + public OffsetDateTime completedTime() { + return this.completedTime; + } + + /** + * Set the completedTime property: Backup completed time (ISO8601 format). + * + * @param completedTime the completedTime value to set. + * @return the ServerBackupPropertiesV2 object itself. + */ + public ServerBackupPropertiesV2 withCompletedTime(OffsetDateTime completedTime) { + this.completedTime = completedTime; + return this; + } + + /** + * Get the source property: Backup source. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Backup source. + * + * @param source the source value to set. + * @return the ServerBackupPropertiesV2 object itself. + */ + public ServerBackupPropertiesV2 withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of backup resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupNameV2", this.backupNameV2); + jsonWriter.writeStringField("backupType", this.backupType == null ? null : this.backupType.toString()); + jsonWriter.writeStringField("completedTime", + this.completedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedTime)); + jsonWriter.writeStringField("source", this.source); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerBackupPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerBackupPropertiesV2 if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerBackupPropertiesV2. + */ + public static ServerBackupPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerBackupPropertiesV2 deserializedServerBackupPropertiesV2 = new ServerBackupPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupNameV2".equals(fieldName)) { + deserializedServerBackupPropertiesV2.backupNameV2 = reader.getString(); + } else if ("backupType".equals(fieldName)) { + deserializedServerBackupPropertiesV2.backupType = BackupType.fromString(reader.getString()); + } else if ("completedTime".equals(fieldName)) { + deserializedServerBackupPropertiesV2.completedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("source".equals(fieldName)) { + deserializedServerBackupPropertiesV2.source = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedServerBackupPropertiesV2.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServerBackupPropertiesV2; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java new file mode 100644 index 000000000000..9def7fff7222 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Server backup properties. + */ +@Fluent +public final class ServerBackupV2Inner extends ProxyResource { + /* + * The properties of a server backup. + */ + private ServerBackupPropertiesV2 innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ServerBackupV2Inner class. + */ + public ServerBackupV2Inner() { + } + + /** + * Get the innerProperties property: The properties of a server backup. + * + * @return the innerProperties value. + */ + private ServerBackupPropertiesV2 innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the backupNameV2 property: Backup name. + * + * @return the backupNameV2 value. + */ + public String backupNameV2() { + return this.innerProperties() == null ? null : this.innerProperties().backupNameV2(); + } + + /** + * Set the backupNameV2 property: Backup name. + * + * @param backupNameV2 the backupNameV2 value to set. + * @return the ServerBackupV2Inner object itself. + */ + public ServerBackupV2Inner withBackupNameV2(String backupNameV2) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerBackupPropertiesV2(); + } + this.innerProperties().withBackupNameV2(backupNameV2); + return this; + } + + /** + * Get the backupType property: The backupType property. + * + * @return the backupType value. + */ + public BackupType backupType() { + return this.innerProperties() == null ? null : this.innerProperties().backupType(); + } + + /** + * Set the backupType property: The backupType property. + * + * @param backupType the backupType value to set. + * @return the ServerBackupV2Inner object itself. + */ + public ServerBackupV2Inner withBackupType(BackupType backupType) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerBackupPropertiesV2(); + } + this.innerProperties().withBackupType(backupType); + return this; + } + + /** + * Get the completedTime property: Backup completed time (ISO8601 format). + * + * @return the completedTime value. + */ + public OffsetDateTime completedTime() { + return this.innerProperties() == null ? null : this.innerProperties().completedTime(); + } + + /** + * Set the completedTime property: Backup completed time (ISO8601 format). + * + * @param completedTime the completedTime value to set. + * @return the ServerBackupV2Inner object itself. + */ + public ServerBackupV2Inner withCompletedTime(OffsetDateTime completedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerBackupPropertiesV2(); + } + this.innerProperties().withCompletedTime(completedTime); + return this; + } + + /** + * Get the source property: Backup source. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: Backup source. + * + * @param source the source value to set. + * @return the ServerBackupV2Inner object itself. + */ + public ServerBackupV2Inner withSource(String source) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerBackupPropertiesV2(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of backup resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerBackupV2Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerBackupV2Inner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServerBackupV2Inner. + */ + public static ServerBackupV2Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerBackupV2Inner deserializedServerBackupV2Inner = new ServerBackupV2Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServerBackupV2Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerBackupV2Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServerBackupV2Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedServerBackupV2Inner.innerProperties = ServerBackupPropertiesV2.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServerBackupV2Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerBackupV2Inner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java index 508feeccbf1a..4b1f9b0f0e60 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -15,6 +15,8 @@ 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.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenancePolicy; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; @@ -24,6 +26,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -31,6 +34,11 @@ */ @Fluent public final class ServerInner extends Resource { + /* + * Properties of the server. + */ + private ServerProperties innerProperties; + /* * The cmk identity for the server. */ @@ -42,12 +50,7 @@ public final class ServerInner extends Resource { private Sku sku; /* - * Properties of the server. - */ - private ServerProperties innerProperties; - - /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -72,6 +75,15 @@ public final class ServerInner extends Resource { public ServerInner() { } + /** + * Get the innerProperties property: Properties of the server. + * + * @return the innerProperties value. + */ + private ServerProperties innerProperties() { + return this.innerProperties; + } + /** * Get the identity property: The cmk identity for the server. * @@ -113,16 +125,7 @@ public ServerInner withSku(Sku sku) { } /** - * 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. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -229,7 +232,7 @@ public ServerInner withAdministratorLoginPassword(String administratorLoginPassw } /** - * Get the version property: Server version. + * Get the version property: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. * * @return the version value. */ @@ -238,7 +241,7 @@ public ServerVersion version() { } /** - * Set the version property: Server version. + * Set the version property: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. * * @param version the version value to set. * @return the ServerInner object itself. @@ -251,6 +254,15 @@ public ServerInner withVersion(ServerVersion version) { return this; } + /** + * Get the fullVersion property: Major version and actual engine version. + * + * @return the fullVersion value. + */ + public String fullVersion() { + return this.innerProperties() == null ? null : this.innerProperties().fullVersion(); + } + /** * Get the availabilityZone property: availability Zone information of the server. * @@ -418,6 +430,29 @@ public String fullyQualifiedDomainName() { return this.innerProperties() == null ? null : this.innerProperties().fullyQualifiedDomainName(); } + /** + * Get the databasePort property: The server database port. Can only be specified when the server is being created. + * + * @return the databasePort value. + */ + public Integer databasePort() { + return this.innerProperties() == null ? null : this.innerProperties().databasePort(); + } + + /** + * Set the databasePort property: The server database port. Can only be specified when the server is being created. + * + * @param databasePort the databasePort value to set. + * @return the ServerInner object itself. + */ + public ServerInner withDatabasePort(Integer databasePort) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); + } + this.innerProperties().withDatabasePort(databasePort); + return this; + } + /** * Get the storage property: Storage related properties of a server. * @@ -511,7 +546,40 @@ public ServerInner withNetwork(Network network) { } /** - * Get the maintenanceWindow property: Maintenance window of a server. + * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the maintenancePolicy property: Maintenance policy of a server. + * + * @return the maintenancePolicy value. + */ + public MaintenancePolicy maintenancePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().maintenancePolicy(); + } + + /** + * Set the maintenancePolicy property: Maintenance policy of a server. + * + * @param maintenancePolicy the maintenancePolicy value to set. + * @return the ServerInner object itself. + */ + public ServerInner withMaintenancePolicy(MaintenancePolicy maintenancePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); + } + this.innerProperties().withMaintenancePolicy(maintenancePolicy); + return this; + } + + /** + * Get the maintenanceWindow property: Maintenance window of a server. Known issue: cannot be set during server + * creation or updated with other properties during server update; must be updated separately. * * @return the maintenanceWindow value. */ @@ -520,7 +588,8 @@ public MaintenanceWindow maintenanceWindow() { } /** - * Set the maintenanceWindow property: Maintenance window of a server. + * Set the maintenanceWindow property: Maintenance window of a server. Known issue: cannot be set during server + * creation or updated with other properties during server update; must be updated separately. * * @param maintenanceWindow the maintenanceWindow value to set. * @return the ServerInner object itself. @@ -534,20 +603,26 @@ public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { } /** - * Validates the instance. + * Get the importSourceProperties property: Source properties for import from storage. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the importSourceProperties value. */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); + public ImportSourceProperties importSourceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().importSourceProperties(); + } + + /** + * Set the importSourceProperties property: Source properties for import from storage. + * + * @param importSourceProperties the importSourceProperties value to set. + * @return the ServerInner object itself. + */ + public ServerInner withImportSourceProperties(ImportSourceProperties importSourceProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); } + this.innerProperties().withImportSourceProperties(importSourceProperties); + return this; } /** @@ -558,9 +633,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -591,12 +666,12 @@ public static ServerInner fromJson(JsonReader jsonReader) throws IOException { } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedServerInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedServerInner.innerProperties = ServerProperties.fromJson(reader); } else if ("identity".equals(fieldName)) { deserializedServerInner.identity = Identity.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedServerInner.sku = Sku.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedServerInner.innerProperties = ServerProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedServerInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java index 6dd62aff6100..4c191fea0b82 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -14,6 +14,8 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; +import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenancePolicy; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; @@ -23,6 +25,7 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.util.List; /** * The properties of a server. @@ -41,10 +44,15 @@ public final class ServerProperties implements JsonSerializable privateEndpointConnections; + + /* + * Maintenance policy of a server. + */ + private MaintenancePolicy maintenancePolicy; + + /* + * Maintenance window of a server. Known issue: cannot be set during server creation or updated with other + * properties during server update; must be updated separately. */ private MaintenanceWindow maintenanceWindow; + /* + * Source properties for import from storage. + */ + private ImportSourceProperties importSourceProperties; + /** * Creates an instance of ServerProperties class. */ @@ -166,7 +195,7 @@ public ServerProperties withAdministratorLoginPassword(String administratorLogin } /** - * Get the version property: Server version. + * Get the version property: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. * * @return the version value. */ @@ -175,7 +204,7 @@ public ServerVersion version() { } /** - * Set the version property: Server version. + * Set the version property: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. * * @param version the version value to set. * @return the ServerProperties object itself. @@ -185,6 +214,15 @@ public ServerProperties withVersion(ServerVersion version) { return this; } + /** + * Get the fullVersion property: Major version and actual engine version. + * + * @return the fullVersion value. + */ + public String fullVersion() { + return this.fullVersion; + } + /** * Get the availabilityZone property: availability Zone information of the server. * @@ -334,6 +372,26 @@ public String fullyQualifiedDomainName() { return this.fullyQualifiedDomainName; } + /** + * Get the databasePort property: The server database port. Can only be specified when the server is being created. + * + * @return the databasePort value. + */ + public Integer databasePort() { + return this.databasePort; + } + + /** + * Set the databasePort property: The server database port. Can only be specified when the server is being created. + * + * @param databasePort the databasePort value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withDatabasePort(Integer databasePort) { + this.databasePort = databasePort; + return this; + } + /** * Get the storage property: Storage related properties of a server. * @@ -415,7 +473,37 @@ public ServerProperties withNetwork(Network network) { } /** - * Get the maintenanceWindow property: Maintenance window of a server. + * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the maintenancePolicy property: Maintenance policy of a server. + * + * @return the maintenancePolicy value. + */ + public MaintenancePolicy maintenancePolicy() { + return this.maintenancePolicy; + } + + /** + * Set the maintenancePolicy property: Maintenance policy of a server. + * + * @param maintenancePolicy the maintenancePolicy value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withMaintenancePolicy(MaintenancePolicy maintenancePolicy) { + this.maintenancePolicy = maintenancePolicy; + return this; + } + + /** + * Get the maintenanceWindow property: Maintenance window of a server. Known issue: cannot be set during server + * creation or updated with other properties during server update; must be updated separately. * * @return the maintenanceWindow value. */ @@ -424,7 +512,8 @@ public MaintenanceWindow maintenanceWindow() { } /** - * Set the maintenanceWindow property: Maintenance window of a server. + * Set the maintenanceWindow property: Maintenance window of a server. Known issue: cannot be set during server + * creation or updated with other properties during server update; must be updated separately. * * @param maintenanceWindow the maintenanceWindow value to set. * @return the ServerProperties object itself. @@ -435,29 +524,23 @@ public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindo } /** - * Validates the instance. + * Get the importSourceProperties property: Source properties for import from storage. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the importSourceProperties value. */ - 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(); - } + public ImportSourceProperties importSourceProperties() { + return this.importSourceProperties; + } + + /** + * Set the importSourceProperties property: Source properties for import from storage. + * + * @param importSourceProperties the importSourceProperties value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withImportSourceProperties(ImportSourceProperties importSourceProperties) { + this.importSourceProperties = importSourceProperties; + return this; } /** @@ -479,11 +562,14 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("replicationRole", this.replicationRole == null ? null : this.replicationRole.toString()); jsonWriter.writeJsonField("dataEncryption", this.dataEncryption); + jsonWriter.writeNumberField("databasePort", this.databasePort); jsonWriter.writeJsonField("storage", this.storage); jsonWriter.writeJsonField("backup", this.backup); jsonWriter.writeJsonField("highAvailability", this.highAvailability); jsonWriter.writeJsonField("network", this.network); + jsonWriter.writeJsonField("maintenancePolicy", this.maintenancePolicy); jsonWriter.writeJsonField("maintenanceWindow", this.maintenanceWindow); + jsonWriter.writeJsonField("importSourceProperties", this.importSourceProperties); return jsonWriter.writeEndObject(); } @@ -508,6 +594,8 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedServerProperties.administratorLoginPassword = reader.getString(); } else if ("version".equals(fieldName)) { deserializedServerProperties.version = ServerVersion.fromString(reader.getString()); + } else if ("fullVersion".equals(fieldName)) { + deserializedServerProperties.fullVersion = reader.getString(); } else if ("availabilityZone".equals(fieldName)) { deserializedServerProperties.availabilityZone = reader.getString(); } else if ("createMode".equals(fieldName)) { @@ -527,6 +615,8 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedServerProperties.state = ServerState.fromString(reader.getString()); } else if ("fullyQualifiedDomainName".equals(fieldName)) { deserializedServerProperties.fullyQualifiedDomainName = reader.getString(); + } else if ("databasePort".equals(fieldName)) { + deserializedServerProperties.databasePort = reader.getNullable(JsonReader::getInt); } else if ("storage".equals(fieldName)) { deserializedServerProperties.storage = Storage.fromJson(reader); } else if ("backup".equals(fieldName)) { @@ -535,8 +625,16 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedServerProperties.highAvailability = HighAvailability.fromJson(reader); } else if ("network".equals(fieldName)) { deserializedServerProperties.network = Network.fromJson(reader); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedServerProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("maintenancePolicy".equals(fieldName)) { + deserializedServerProperties.maintenancePolicy = MaintenancePolicy.fromJson(reader); } else if ("maintenanceWindow".equals(fieldName)) { deserializedServerProperties.maintenanceWindow = MaintenanceWindow.fromJson(reader); + } else if ("importSourceProperties".equals(fieldName)) { + deserializedServerProperties.importSourceProperties = ImportSourceProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java index e4db5bc6ca0e..d758dc051b1c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -12,8 +12,11 @@ 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.MaintenancePolicy; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; +import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -27,6 +30,11 @@ public final class ServerPropertiesForUpdate implements JsonSerializable { + /* + * The response properties of a pre backup operation. + */ + private ValidateBackupResponseProperties innerProperties; + + /** + * Creates an instance of ValidateBackupResponseInner class. + */ + private 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateBackupResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateBackupResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateBackupResponseInner. + */ + public static ValidateBackupResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateBackupResponseInner deserializedValidateBackupResponseInner = new ValidateBackupResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedValidateBackupResponseInner.innerProperties + = ValidateBackupResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateBackupResponseInner; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java new file mode 100644 index 000000000000..59206133a737 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ValidateBackup Response Properties. + */ +@Immutable +public final class ValidateBackupResponseProperties implements JsonSerializable { + /* + * Estimated no of storage containers required for resource data to be backed up. + */ + private Integer numberOfContainers; + + /** + * Creates an instance of ValidateBackupResponseProperties class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("numberOfContainers", this.numberOfContainers); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateBackupResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateBackupResponseProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateBackupResponseProperties. + */ + public static ValidateBackupResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateBackupResponseProperties deserializedValidateBackupResponseProperties + = new ValidateBackupResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfContainers".equals(fieldName)) { + deserializedValidateBackupResponseProperties.numberOfContainers + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateBackupResponseProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java index 15164f2c1b6e..f7bcc4ac16f5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; @@ -37,7 +37,7 @@ public final class VirtualNetworkSubnetUsageResultInner /** * Creates an instance of VirtualNetworkSubnetUsageResultInner class. */ - public VirtualNetworkSubnetUsageResultInner() { + private VirtualNetworkSubnetUsageResultInner() { } /** @@ -67,17 +67,6 @@ 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/package-info.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/package-info.java index f1c5dccfe641..4818ead75d3b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/package-info.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for MySqlManagementClient. + * Package containing the inner data models for MySql. * 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. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/package-info.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/package-info.java index 2509e87f564b..f41583c44033 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/package-info.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for MySqlManagementClient. + * Package containing the service clients for MySql. * 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. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java new file mode 100644 index 000000000000..4373dddb74de --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.time.OffsetDateTime; + +public final class AdvancedThreatProtectionImpl implements AdvancedThreatProtection { + private AdvancedThreatProtectionInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + AdvancedThreatProtectionImpl(AdvancedThreatProtectionInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public AdvancedThreatProtectionState state() { + return this.innerModel().state(); + } + + public AdvancedThreatProtectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public AdvancedThreatProtectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java new file mode 100644 index 000000000000..1bbd4406a790 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java @@ -0,0 +1,813 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdvancedThreatProtectionListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionSettingsClient. + */ +public final class AdvancedThreatProtectionSettingsClientImpl implements AdvancedThreatProtectionSettingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AdvancedThreatProtectionSettingsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of AdvancedThreatProtectionSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AdvancedThreatProtectionSettingsClientImpl(MySqlManagementClientImpl client) { + this.service = RestProxy.create(AdvancedThreatProtectionSettingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientAdvancedThreatProtectionSettings to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientAdvancedThreatProtectionSettings") + public interface AdvancedThreatProtectionSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePut(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AdvancedThreatProtectionInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updatePutSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AdvancedThreatProtectionInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AdvancedThreatProtectionForUpdate parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AdvancedThreatProtectionForUpdate parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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}/advancedThreatProtectionSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName) { + return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, advancedThreatProtectionName, accept, context); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner get(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName) { + return getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, Context.NONE).getValue(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updatePut(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updatePutWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updatePutSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, contentType, + accept, parameters, Context.NONE); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updatePutWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updatePutSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, contentType, + accept, parameters, context); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AdvancedThreatProtectionInner> beginUpdatePutAsync( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionInner parameters) { + Mono>> mono + = updatePutWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, + this.client.getContext()); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionInner parameters) { + Response response + = updatePutWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + return this.client.getLroResult(response, + AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, Context.NONE); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionInner parameters, Context context) { + Response response + = updatePutWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); + return this.client.getLroResult(response, + AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, context); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { + return beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { + return beginUpdatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters).getFinalResult(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, + Context context) { + return beginUpdatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) + .getFinalResult(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, contentType, + accept, parameters, Context.NONE); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, advancedThreatProtectionName, contentType, + accept, parameters, context); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, + this.client.getContext()); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + Response response + = updateWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + return this.client.getLroResult(response, + AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, Context.NONE); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, Context context) { + Response response + = updateWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); + return this.client.getLroResult(response, + AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, context); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { + return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { + return beginUpdate(resourceGroupName, serverName, advancedThreatProtectionName, parameters).getFinalResult(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, + Context context) { + return beginUpdate(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) + .getFinalResult(); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, serverName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, serverName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java new file mode 100644 index 000000000000..884d6ccbad06 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; + +public final class AdvancedThreatProtectionSettingsImpl implements AdvancedThreatProtectionSettings { + private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionSettingsImpl.class); + + private final AdvancedThreatProtectionSettingsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public AdvancedThreatProtectionSettingsImpl(AdvancedThreatProtectionSettingsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AdvancedThreatProtectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AdvancedThreatProtection get(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName) { + AdvancedThreatProtectionInner inner + = this.serviceClient().get(resourceGroupName, serverName, advancedThreatProtectionName); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { + AdvancedThreatProtectionInner inner + = this.serviceClient().updatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, + Context context) { + AdvancedThreatProtectionInner inner = this.serviceClient() + .updatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AdvancedThreatProtection update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { + AdvancedThreatProtectionInner inner + = this.serviceClient().update(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AdvancedThreatProtection update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, + Context context) { + AdvancedThreatProtectionInner inner = this.serviceClient() + .update(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serverName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); + } + + private AdvancedThreatProtectionSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java new file mode 100644 index 000000000000..71e542d201b1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; + +public final class AzureADAdministratorImpl + implements AzureADAdministrator, AzureADAdministrator.Definition, AzureADAdministrator.Update { + private AzureADAdministratorInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AdministratorType administratorType() { + return this.innerModel().administratorType(); + } + + public String login() { + return this.innerModel().login(); + } + + public String sid() { + return this.innerModel().sid(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String identityResourceId() { + return this.innerModel().identityResourceId(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AzureADAdministratorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serverName; + + private AdministratorName administratorName; + + public AzureADAdministratorImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + public AzureADAdministrator create() { + this.innerObject = serviceManager.serviceClient() + .getAzureADAdministrators() + .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), Context.NONE); + return this; + } + + public AzureADAdministrator create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAzureADAdministrators() + .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), context); + return this; + } + + AzureADAdministratorImpl(AdministratorName name, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = new AzureADAdministratorInner(); + this.serviceManager = serviceManager; + this.administratorName = name; + } + + public AzureADAdministratorImpl update() { + return this; + } + + public AzureADAdministrator apply() { + this.innerObject = serviceManager.serviceClient() + .getAzureADAdministrators() + .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), Context.NONE); + return this; + } + + public AzureADAdministrator apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAzureADAdministrators() + .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), context); + return this; + } + + AzureADAdministratorImpl(AzureADAdministratorInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.administratorName = AdministratorName + .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "administrators")); + } + + public AzureADAdministrator refresh() { + this.innerObject = serviceManager.serviceClient() + .getAzureADAdministrators() + .getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE) + .getValue(); + return this; + } + + public AzureADAdministrator refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAzureADAdministrators() + .getWithResponse(resourceGroupName, serverName, administratorName, context) + .getValue(); + return this; + } + + public AzureADAdministratorImpl withAdministratorType(AdministratorType administratorType) { + this.innerModel().withAdministratorType(administratorType); + return this; + } + + public AzureADAdministratorImpl withLogin(String login) { + this.innerModel().withLogin(login); + return this; + } + + public AzureADAdministratorImpl withSid(String sid) { + this.innerModel().withSid(sid); + return this; + } + + public AzureADAdministratorImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public AzureADAdministratorImpl withIdentityResourceId(String identityResourceId) { + this.innerModel().withIdentityResourceId(identityResourceId); + return this; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java new file mode 100644 index 000000000000..7a57ba911907 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java @@ -0,0 +1,774 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.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("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientAzureADAdministrators") + public interface AzureADAdministratorsService { + @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("endpoint") 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) + Response getSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("administratorName") AdministratorName administratorName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AzureADAdministratorInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("administratorName") AdministratorName administratorName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AzureADAdministratorInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("administratorName") AdministratorName administratorName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("administratorName") AdministratorName administratorName, 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("endpoint") 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}/administrators") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerSync(@HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureADAdministratorInner get(String resourceGroupName, String serverName, + AdministratorName administratorName) { + return getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE).getValue(); + } + + /** + * 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, contentType, accept, + parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + AdministratorName administratorName, AzureADAdministratorInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, contentType, accept, + parameters, Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + AdministratorName administratorName, AzureADAdministratorInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, contentType, accept, + parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, administratorName, parameters); + return this.client.getLroResult(response, + AzureADAdministratorInner.class, AzureADAdministratorInner.class, Context.NONE); + } + + /** + * 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) { + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, administratorName, parameters, context); + return this.client.getLroResult(response, + 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 beginCreateOrUpdate(resourceGroupName, serverName, administratorName, parameters).getFinalResult(); + } + + /** + * 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 beginCreateOrUpdate(resourceGroupName, serverName, administratorName, parameters, context) + .getFinalResult(); + } + + /** + * 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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, + AdministratorName administratorName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, Context.NONE); + } + + /** + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, + AdministratorName administratorName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + Response response = deleteWithResponse(resourceGroupName, serverName, administratorName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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) { + Response response = deleteWithResponse(resourceGroupName, serverName, administratorName, context); + return this.client.getLroResult(response, 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + beginDelete(resourceGroupName, serverName, administratorName).getFinalResult(); + } + + /** + * 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) { + beginDelete(resourceGroupName, serverName, administratorName, context).getFinalResult(); + } + + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, + String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a List of azure ad administrators along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a List of azure ad administrators along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java new file mode 100644 index 000000000000..9453b64d082b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; + +public final class AzureADAdministratorsImpl implements AzureADAdministrators { + private static final ClientLogger LOGGER = new ClientLogger(AzureADAdministratorsImpl.class); + + private final AzureADAdministratorsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public AzureADAdministratorsImpl(AzureADAdministratorsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String serverName, + AdministratorName administratorName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, serverName, administratorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AzureADAdministratorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureADAdministrator get(String resourceGroupName, String serverName, AdministratorName administratorName) { + AzureADAdministratorInner inner = this.serviceClient().get(resourceGroupName, serverName, administratorName); + if (inner != null) { + return new AzureADAdministratorImpl(inner, this.manager()); + } else { + return null; + } + } + + public 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 PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); + } + + public AzureADAdministrator getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); + if (administratorNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + } + AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); + return this.getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); + if (administratorNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + } + AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); + return this.getWithResponse(resourceGroupName, serverName, administratorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); + if (administratorNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + } + AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); + this.delete(resourceGroupName, serverName, administratorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); + if (administratorNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); + } + AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); + this.delete(resourceGroupName, serverName, administratorName, context); + } + + private AzureADAdministratorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } + + public AzureADAdministratorImpl define(AdministratorName name) { + return new AzureADAdministratorImpl(name, this.manager()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java new file mode 100644 index 000000000000..bb0e5c07c3ca --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; +import java.time.OffsetDateTime; + +public final class BackupAndExportResponseImpl implements BackupAndExportResponse { + private BackupAndExportResponseInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + BackupAndExportResponseImpl(BackupAndExportResponseInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public 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 new file mode 100644 index 000000000000..c1ad832f31ad --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.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("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientBackupAndExports") + public interface BackupAndExportsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BackupAndExportRequest parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BackupAndExportRequest parameters, 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("endpoint") 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}/validateBackup") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateBackupSync(@HostParam("endpoint") 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 the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, + BackupAndExportRequest parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String serverName, + BackupAndExportRequest parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + Context.NONE); + } + + /** + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String serverName, + BackupAndExportRequest parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, 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 long-running operation. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, BackupAndExportResponseInner> + beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + Response response = createWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, + BackupAndExportResponseInner.class, BackupAndExportResponseInner.class, Context.NONE); + } + + /** + * 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackupAndExportResponseInner> + beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + Response response = createWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, + 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 response body 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupAndExportResponseInner create(String resourceGroupName, String serverName, + BackupAndExportRequest parameters) { + return beginCreate(resourceGroupName, serverName, parameters).getFinalResult(); + } + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupAndExportResponseInner create(String resourceGroupName, String serverName, + BackupAndExportRequest parameters, Context context) { + return beginCreate(resourceGroupName, serverName, parameters, context).getFinalResult(); + } + + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateBackup(this.client.getEndpoint(), this.client.getApiVersion(), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + final String accept = "application/json"; + return service.validateBackupSync(this.client.getEndpoint(), this.client.getApiVersion(), + 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. + */ + @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 new file mode 100644 index 000000000000..30005a33ff3c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; +import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; + +public final class BackupAndExportsImpl implements BackupAndExports { + private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportsImpl.class); + + private final BackupAndExportsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public BackupAndExportsImpl(BackupAndExportsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupAndExportResponse create(String resourceGroupName, String serverName, + BackupAndExportRequest parameters) { + BackupAndExportResponseInner inner = this.serviceClient().create(resourceGroupName, serverName, parameters); + if (inner != null) { + return new BackupAndExportResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public BackupAndExportResponse create(String resourceGroupName, String serverName, + BackupAndExportRequest parameters, Context context) { + BackupAndExportResponseInner inner + = this.serviceClient().create(resourceGroupName, serverName, parameters, context); + if (inner != null) { + return new BackupAndExportResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateBackupWithResponse(String resourceGroupName, String serverName, + Context context) { + Response inner + = this.serviceClient().validateBackupWithResponse(resourceGroupName, serverName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateBackupResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateBackupResponse validateBackup(String resourceGroupName, String serverName) { + ValidateBackupResponseInner inner = this.serviceClient().validateBackup(resourceGroupName, serverName); + if (inner != null) { + return new ValidateBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private BackupAndExportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java index 713b6d936e36..4ff8686b72d4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -11,6 +11,7 @@ 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; @@ -27,7 +28,7 @@ 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupListResult; import reactor.core.publisher.Mono; /** @@ -58,23 +59,59 @@ public final class BackupsClientImpl implements BackupsClient { * The interface defining all the services for MySqlManagementClientBackups to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientBackups") public interface BackupsService { @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, + Mono> get(@HostParam("endpoint") 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) + Response getSync(@HostParam("endpoint") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("endpoint") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response putSync(@HostParam("endpoint") 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("endpoint") 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}/backups") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer(@HostParam("$host") String endpoint, + Response listByServerSync(@HostParam("endpoint") 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); @@ -84,7 +121,15 @@ Mono> listByServer(@HostParam("$host") String e @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -102,24 +147,6 @@ Mono> listByServerNext( @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 accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -127,6 +154,23 @@ private Mono> getWithResponseAsync(String resourceGr .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. * @@ -137,32 +181,13 @@ private Mono> getWithResponseAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return server backup properties along with {@link Response}. */ @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.")); - } + public Response getWithResponse(String resourceGroupName, String serverName, String backupName, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, context); } @@ -175,16 +200,53 @@ private Mono> getWithResponseAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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(); + } + + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Mono putAsync(String resourceGroupName, String serverName, String backupName) { + return putWithResponseAsync(resourceGroupName, serverName, backupName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all the backups for a given server. + * 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. @@ -196,13 +258,15 @@ private Mono getAsync(String resourceGroupName, String server * @return server backup properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, String backupName, + public Response putWithResponse(String resourceGroupName, String serverName, String backupName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, backupName, context).block(); + final String accept = "application/json"; + return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, backupName, accept, context); } /** - * List all the backups for a given server. + * 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. @@ -213,8 +277,8 @@ public Response getWithResponse(String resourceGroupName, Str * @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(); + public ServerBackupInner put(String resourceGroupName, String serverName, String backupName) { + return putWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); } /** @@ -225,26 +289,12 @@ public ServerBackupInner get(String resourceGroupName, String serverName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), @@ -259,37 +309,15 @@ private Mono> listByServerSinglePageAsync(Strin * * @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}. + * @return the response of a ServerBackup list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** @@ -300,12 +328,16 @@ private Mono> listByServerSinglePageAsync(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 server backups as paginated response with {@link PagedFlux}. + * @return the response of a ServerBackup list operation along with {@link PagedResponse}. */ - @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 PagedResponse listByServerSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -317,13 +349,17 @@ 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 server backups as paginated response with {@link PagedFlux}. + * @return the response of a ServerBackup list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -334,11 +370,12 @@ 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 server backups as paginated response with {@link PagedIterable}. + * @return the response of a ServerBackup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePage(nextLink)); } /** @@ -350,11 +387,12 @@ public PagedIterable listByServer(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation 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)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); } /** @@ -364,17 +402,11 @@ public PagedIterable listByServer(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation 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)) @@ -383,6 +415,24 @@ private Mono> listByServerNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -391,21 +441,14 @@ private Mono> listByServerNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java index 978c5749d31e..93e1d5425fd6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -48,6 +48,27 @@ public ServerBackup get(String resourceGroupName, String serverName, String back } } + 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 PagedIterable listByServer(String resourceGroupName, String serverName) { PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupImpl(inner1, this.manager())); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java new file mode 100644 index 000000000000..1868dff1a4af --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; +import com.azure.resourcemanager.mysqlflexibleserver.models.FeatureProperty; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; +import java.util.Collections; +import java.util.List; + +public final class CapabilityImpl implements Capability { + private CapabilityInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + CapabilityImpl(CapabilityInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List supportedGeoBackupRegions() { + List inner = this.innerModel().supportedGeoBackupRegions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedFlexibleServerEditions() { + List inner = this.innerModel().supportedFlexibleServerEditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedServerVersions() { + List inner = this.innerModel().supportedServerVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedFeatures() { + List inner = this.innerModel().supportedFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CapabilityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityPropertiesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityPropertiesImpl.java index 23aff48da474..b2051c91b936 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/CapabilityPropertiesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java index a8426abeb5a3..f9c57a345f55 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -56,25 +55,33 @@ public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailab * The interface defining all the services for MySqlManagementClientCheckNameAvailabilities to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientCheckNameAvailabilities") 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, + Mono> execute(@HostParam("endpoint") 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); + @PathParam("locationName") String locationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") 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. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -84,27 +91,11 @@ Mono> execute(@HostParam("$host") String endpoin @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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), locationName, nameAvailabilityRequest, accept, context)) + this.client.getSubscriptionId(), locationName, contentType, accept, nameAvailabilityRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -112,45 +103,7 @@ private Mono> executeWithResponseAsync(String lo * 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), 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. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -167,7 +120,7 @@ private Mono executeAsync(String locationName, * 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 nameAvailabilityRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -177,14 +130,17 @@ private Mono executeAsync(String locationName, @ServiceMethod(returns = ReturnType.SINGLE) public Response executeWithResponse(String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context) { - return executeWithResponseAsync(locationName, nameAvailabilityRequest, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, contentType, accept, nameAvailabilityRequest, 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. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index ace0e597187e..2e3b4ab359f3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java index abf77aa3d9ca..06b276b3b835 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -58,23 +57,30 @@ public final class CheckNameAvailabilityWithoutLocationsClientImpl * The interface defining all the services for MySqlManagementClientCheckNameAvailabilityWithoutLocations to be used * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientCheckNameAvailabilityWithoutLocations") 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, + Mono> execute(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, Context context); } /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -84,65 +90,18 @@ Mono> execute(@HostParam("$host") String endpoin @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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), nameAvailabilityRequest, accept, context)) + this.client.getSubscriptionId(), contentType, accept, nameAvailabilityRequest, 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), 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. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -156,7 +115,7 @@ private Mono executeAsync(NameAvailabilityRequest nameAva /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -166,13 +125,16 @@ private Mono executeAsync(NameAvailabilityRequest nameAva @ServiceMethod(returns = ReturnType.SINGLE) public Response executeWithResponse(NameAvailabilityRequest nameAvailabilityRequest, Context context) { - return executeWithResponseAsync(nameAvailabilityRequest, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, nameAvailabilityRequest, context); } /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index fb361bc9942c..66a8f5dd376d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java index a29199c63362..97f529eb70ad 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -56,25 +55,33 @@ public final class CheckVirtualNetworkSubnetUsagesClientImpl implements CheckVir * The interface defining all the services for MySqlManagementClientCheckVirtualNetworkSubnetUsages to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientCheckVirtualNetworkSubnetUsages") 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, + Mono> execute(@HostParam("endpoint") 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); + @PathParam("locationName") String locationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") VirtualNetworkSubnetUsageParameter parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkVirtualNetworkSubnetUsage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") 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. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -84,26 +91,11 @@ Mono> execute(@HostParam("$host") @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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), locationName, parameters, accept, context)) + this.client.getSubscriptionId(), locationName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -111,44 +103,7 @@ private Mono> executeWithResponse * 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), 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. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -164,7 +119,7 @@ private Mono executeAsync(String locationN * 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 parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -174,14 +129,17 @@ private Mono executeAsync(String locationN @ServiceMethod(returns = ReturnType.SINGLE) public Response executeWithResponse(String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context) { - return executeWithResponseAsync(locationName, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, contentType, accept, parameters, 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. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index 27648dc87d69..7f634f318497 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java index fb3b8b3776a3..0b341e857098 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -12,17 +13,11 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig; import com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly; -public final class ConfigurationImpl implements Configuration { +public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update { private ConfigurationInner innerObject; private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - ConfigurationImpl(ConfigurationInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -43,10 +38,18 @@ 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(); } @@ -75,6 +78,10 @@ public IsDynamicConfig isDynamicConfig() { return this.innerModel().isDynamicConfig(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ConfigurationInner innerModel() { return this.innerObject; } @@ -82,4 +89,94 @@ public ConfigurationInner innerModel() { private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } + + private String resourceGroupName; + + private String serverName; + + private String configurationName; + + public ConfigurationImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + public Configuration create() { + this.innerObject = serviceManager.serviceClient() + .getConfigurations() + .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public Configuration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigurations() + .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), context); + return this; + } + + ConfigurationImpl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = new ConfigurationInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public ConfigurationImpl update() { + return this; + } + + public Configuration apply() { + this.innerObject = serviceManager.serviceClient() + .getConfigurations() + .update(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public Configuration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigurations() + .update(resourceGroupName, serverName, configurationName, this.innerModel(), context); + return this; + } + + ConfigurationImpl(ConfigurationInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.configurationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurations"); + } + + public Configuration refresh() { + this.innerObject = serviceManager.serviceClient() + .getConfigurations() + .getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public Configuration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigurations() + .getWithResponse(resourceGroupName, serverName, configurationName, context) + .getValue(); + return this; + } + + public ConfigurationImpl withValue(String value) { + this.innerModel().withValue(value); + return this; + } + + public ConfigurationImpl withCurrentValue(String currentValue) { + this.innerModel().withCurrentValue(currentValue); + return this; + } + + public ConfigurationImpl withSource(ConfigurationSource source) { + this.innerModel().withSource(source); + return this; + } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationListResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationListResultImpl.java index 83e717134137..1512669a903b 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/ConfigurationListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java index 03a5ceba6549..02bf44f13235 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -14,6 +14,7 @@ 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; @@ -27,6 +28,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -68,58 +70,199 @@ public final class ConfigurationsClientImpl implements ConfigurationsClient { * The interface defining all the services for MySqlManagementClientConfigurations to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientConfigurations") public interface ConfigurationsService { @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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, + @PathParam("configurationName") String configurationName, @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, + Response getSync(@HostParam("endpoint") 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") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> batchUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") 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); + @PathParam("configurationName") String configurationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConfigurationInner parameters, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("configurationName") String configurationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConfigurationInner parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("configurationName") String configurationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConfigurationInner parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("configurationName") String configurationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConfigurationInner parameters, + 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, + Mono> listByServer(@HostParam("endpoint") 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); + @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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerSync(@HostParam("endpoint") 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); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> batchUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationListForBatchUpdate parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response batchUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationListForBatchUpdate parameters, 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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner get(String resourceGroupName, String serverName, String configurationName) { + return getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); + } + /** * Updates a configuration of a server. * @@ -133,37 +276,14 @@ Mono> listByServerNext( * @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(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String serverName, String configurationName, ConfigurationInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, parameters, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -174,43 +294,19 @@ private Mono>> updateWithResponseAsync(String resource * @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}. + * @return represents a Configuration along with {@link Response}. */ @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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String configurationName, ConfigurationInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, contentType, accept, + parameters, Context.NONE); } /** @@ -220,18 +316,20 @@ private Mono>> updateWithResponseAsync(String resource * @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. + * @return represents a Configuration along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String configurationName, ConfigurationInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, contentType, accept, + parameters, context); } /** @@ -241,20 +339,18 @@ private PollerFlux, ConfigurationInner> beginUpda * @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); + private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ConfigurationInner.class, ConfigurationInner.class, context); + ConfigurationInner.class, ConfigurationInner.class, this.client.getContext()); } /** @@ -270,9 +366,12 @@ private PollerFlux, ConfigurationInner> beginUpda * @return the {@link SyncPoller} for polling of represents a Configuration. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationInner> beginUpdate(String resourceGroupName, + public SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return this.beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, configurationName, parameters); + return this.client.getLroResult(response, ConfigurationInner.class, + ConfigurationInner.class, Context.NONE); } /** @@ -289,10 +388,12 @@ public SyncPoller, ConfigurationInner> beginUpdat * @return the {@link SyncPoller} for polling of represents a Configuration. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationInner> beginUpdate(String resourceGroupName, + public SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, configurationName, parameters, context); + return this.client.getLroResult(response, ConfigurationInner.class, + ConfigurationInner.class, context); } /** @@ -308,9 +409,9 @@ public SyncPoller, ConfigurationInner> beginUpdat * @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() + private Mono createOrUpdateAsync(String resourceGroupName, String serverName, + String configurationName, ConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -321,17 +422,15 @@ private Mono updateAsync(String resourceGroupName, String se * @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}. + * @return represents a Configuration. */ @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); + public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters) { + return beginCreateOrUpdate(resourceGroupName, serverName, configurationName, parameters).getFinalResult(); } /** @@ -341,15 +440,17 @@ private Mono updateAsync(String resourceGroupName, String se * @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) { - return updateAsync(resourceGroupName, serverName, configurationName, parameters).block(); + public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, serverName, configurationName, parameters, context) + .getFinalResult(); } /** @@ -359,327 +460,352 @@ public ConfigurationInner update(String resourceGroupName, String serverName, St * @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. + * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. */ @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(); + private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, + String configurationName, ConfigurationInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, contentType, accept, + parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about a configuration of server. + * 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 information about a configuration of server along with {@link Response} on successful completion of - * {@link Mono}. + * @return represents a Configuration along with {@link Response}. */ @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.")); - } + private Response updateWithResponse(String resourceGroupName, String serverName, + String configurationName, ConfigurationInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, contentType, accept, + parameters, Context.NONE); } /** - * Gets information about a configuration of server. + * 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 information about a configuration of server along with {@link Response} on successful completion of - * {@link Mono}. + * @return represents a Configuration along with {@link Response}. */ @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.")); - } + private Response updateWithResponse(String resourceGroupName, String serverName, + String configurationName, ConfigurationInner parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, contentType, accept, + parameters, context); } /** - * Gets information about a configuration of server. + * 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 information about a configuration of server on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of represents a Configuration. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String configurationName) { - return getWithResponseAsync(resourceGroupName, serverName, configurationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @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()); } /** - * Gets information about a configuration of server. + * 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) { + Response response + = updateWithResponse(resourceGroupName, serverName, configurationName, parameters); + return this.client.getLroResult(response, ConfigurationInner.class, + ConfigurationInner.class, Context.NONE); + } + + /** + * 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 information about a configuration of server along with {@link Response}. + * @return the {@link SyncPoller} for polling of represents a Configuration. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, - String configurationName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, configurationName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationInner> beginUpdate(String resourceGroupName, + String serverName, String configurationName, ConfigurationInner parameters, Context context) { + Response response + = updateWithResponse(resourceGroupName, serverName, configurationName, parameters, context); + return this.client.getLroResult(response, ConfigurationInner.class, + ConfigurationInner.class, context); } /** - * Gets information about a configuration of server. + * 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 information about a configuration of server. + * @return represents a Configuration on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner get(String resourceGroupName, String serverName, String configurationName) { - return getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); + private Mono updateAsync(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters) { + return beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update a list of configurations in a given server. + * 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 parameters The parameters for updating a list of server configuration. + * @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 a list of server configurations along with {@link Response} on successful completion of {@link Mono}. + * @return represents a Configuration. */ @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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public ConfigurationInner update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters) { + return beginUpdate(resourceGroupName, serverName, configurationName, parameters).getFinalResult(); } /** - * Update a list of configurations in a given server. + * 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 parameters The parameters for updating a list of server configuration. + * @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 a list of server configurations along with {@link Response} on successful completion of {@link Mono}. + * @return represents a Configuration. */ @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(); - } + public ConfigurationInner update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context) { + return beginUpdate(resourceGroupName, serverName, configurationName, parameters, context).getFinalResult(); + } + + /** + * 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 the response of a Configuration list operation 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) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); + return FluxUtil + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + 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())); } /** - * Update a list of configurations in a given server. + * 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 parameters The parameters for updating a list of server configuration. + * @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 the {@link PollerFlux} for polling of a list of server configurations. + * @return the response of a Configuration list operation as paginated response with {@link PagedFlux}. */ - @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()); + @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)); } /** - * Update a list of configurations in a given server. + * 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 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. + * @return the response of a Configuration list operation as paginated response with {@link PagedFlux}. */ - @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); + @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)); } /** - * Update a list of configurations in a given server. + * 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 parameters The parameters for updating a list of server configuration. + * @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 the {@link SyncPoller} for polling of a list of server configurations. + * @return the response of a Configuration list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationListResultInner> - beginBatchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - return this.beginBatchUpdateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + String tags, String keyword, Integer page, Integer pageSize) { + final String accept = "application/json"; + Response res = service.listByServerSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, tags, keyword, + page, pageSize, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update a list of configurations in a given server. + * 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 parameters The parameters for updating a list of server configuration. + * @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 the {@link SyncPoller} for polling of a list of server configurations. + * @return the response of a Configuration list operation along with {@link PagedResponse}. */ - @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(); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + String tags, String keyword, Integer page, Integer pageSize, Context context) { + final String accept = "application/json"; + Response res = service.listByServerSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, tags, keyword, + page, pageSize, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update a list of configurations in a given server. + * 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 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}. + * @return the response of a Configuration list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono batchUpdateAsync(String resourceGroupName, String serverName, - ConfigurationListForBatchUpdate parameters) { - return beginBatchUpdateAsync(resourceGroupName, serverName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @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<>( + () -> listByServerSinglePage(resourceGroupName, serverName, tags, keyword, page, pageSize), + nextLink -> listByServerNextSinglePage(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 the response of a Configuration list operation 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<>( + () -> listByServerSinglePage(resourceGroupName, serverName, tags, keyword, page, pageSize, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); } /** @@ -688,17 +814,22 @@ private Mono batchUpdateAsync(String resourceGroup * @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}. + * @return the response of a Configuration list operation along with {@link Response} 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); + private Mono>> batchUpdateWithResponseAsync(String resourceGroupName, String serverName, + ConfigurationListForBatchUpdate parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -710,12 +841,16 @@ private Mono batchUpdateAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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. + * @return the response of a Configuration list operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, + private Response batchUpdateWithResponse(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { - return batchUpdateAsync(resourceGroupName, serverName, parameters).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.batchUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + Context.NONE); } /** @@ -728,155 +863,127 @@ public ConfigurationListResultInner batchUpdate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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. + * @return the response of a Configuration list operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, + private Response batchUpdateWithResponse(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { - return batchUpdateAsync(resourceGroupName, serverName, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.batchUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context); } /** - * List all the configurations in a given server. + * 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 PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link PollerFlux} for polling of the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @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()); } /** - * List all the configurations in a given server. + * 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 context The context to associate with this operation. + * @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 PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationListResultInner> + beginBatchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { + Response response = batchUpdateWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, + ConfigurationListResultInner.class, ConfigurationListResultInner.class, Context.NONE); } /** - * List all the configurations in a given server. + * 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 as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationListResultInner> beginBatchUpdate( + String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context) { + Response response = batchUpdateWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, + ConfigurationListResultInner.class, ConfigurationListResultInner.class, context); } /** - * List all the configurations in a given server. + * 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 context The context to associate with this operation. + * @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 as paginated response with {@link PagedFlux}. + * @return the response of a Configuration list operation on successful completion of {@link Mono}. */ - @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) + private Mono batchUpdateAsync(String resourceGroupName, String serverName, + ConfigurationListForBatchUpdate parameters) { + return beginBatchUpdateAsync(resourceGroupName, serverName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List all the configurations in a given server. + * 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 as paginated response with {@link PagedIterable}. + * @return the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, + ConfigurationListForBatchUpdate parameters) { + return beginBatchUpdate(resourceGroupName, serverName, parameters).getFinalResult(); } /** - * List all the configurations in a given server. + * 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 as paginated response with {@link PagedIterable}. + * @return the response of a Configuration list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, - Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationListResultInner batchUpdate(String resourceGroupName, String serverName, + ConfigurationListForBatchUpdate parameters, Context context) { + return beginBatchUpdate(resourceGroupName, serverName, parameters, context).getFinalResult(); } /** @@ -886,18 +993,11 @@ public PagedIterable listByServer(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 server configurations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Configuration list operation 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)) @@ -906,6 +1006,24 @@ private Mono> listByServerNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Configuration list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -914,22 +1032,14 @@ private Mono> listByServerNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a Configuration list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java index 95d286bf23ee..90e87591bfdd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -30,28 +30,6 @@ public ConfigurationsImpl(ConfigurationsClient innerClient, this.serviceManager = serviceManager; } - public Configuration update(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters) { - ConfigurationInner inner - = this.serviceClient().update(resourceGroupName, serverName, configurationName, parameters); - if (inner != null) { - return new ConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Configuration update(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters, Context context) { - ConfigurationInner inner - = this.serviceClient().update(resourceGroupName, serverName, configurationName, parameters, context); - if (inner != null) { - return new ConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceGroupName, String serverName, String configurationName, Context context) { Response inner @@ -73,6 +51,18 @@ public Configuration get(String resourceGroupName, String serverName, String con } } + public PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, String tags, + String keyword, Integer page, Integer pageSize, Context context) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName, tags, keyword, page, pageSize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + } + public ConfigurationListResult batchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters) { ConfigurationListResultInner inner @@ -95,15 +85,42 @@ public ConfigurationListResult batchUpdate(String resourceGroupName, String serv } } - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + public Configuration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); } - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, configurationName, context); } private ConfigurationsClient serviceClient() { @@ -113,4 +130,8 @@ private ConfigurationsClient serviceClient() { private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } + + public ConfigurationImpl define(String name) { + return new ConfigurationImpl(name, this.manager()); + } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabaseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabaseImpl.java index 8692934d8b8a..66d2904ab5b8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java index a386d6d810e7..9982c04064ad 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.DatabaseListResult; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.DatabaseListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,42 +68,79 @@ public final class DatabasesClientImpl implements DatabasesClient { * The interface defining all the services for MySqlManagementClientDatabases to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientDatabases") public interface DatabasesService { @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("endpoint") 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) + Response getSync(@HostParam("endpoint") 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); + @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, + Mono>> createOrUpdate(@HostParam("endpoint") 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); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatabaseInner parameters, + Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatabaseInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> delete(@HostParam("endpoint") 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); + @PathParam("databaseName") String databaseName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("databaseName") String databaseName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> listByServer(@HostParam("endpoint") 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); + @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, + Response listByServerSync(@HostParam("endpoint") 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); @@ -112,10 +150,92 @@ Mono> listByServer(@HostParam("$host") String endpo @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner get(String resourceGroupName, String serverName, String databaseName) { + return getWithResponse(resourceGroupName, serverName, databaseName, Context.NONE).getValue(); + } + /** * Creates a new database or updates an existing database. * @@ -131,34 +251,12 @@ Mono> listByServerNext( @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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -169,42 +267,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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}. + * @return represents a Database along with {@link Response}. */ @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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String databaseName, DatabaseInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, contentType, accept, + parameters, Context.NONE); } /** @@ -214,18 +289,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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. + * @return represents a Database along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String databaseName, DatabaseInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, contentType, accept, + parameters, context); } /** @@ -235,7 +312,6 @@ private PollerFlux, DatabaseInner> beginCreateOrUpdate * @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. @@ -243,12 +319,11 @@ private PollerFlux, DatabaseInner> beginCreateOrUpdate */ @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); + String serverName, String databaseName, DatabaseInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, databaseName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, serverName, databaseName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DatabaseInner.class, DatabaseInner.class, context); + DatabaseInner.class, DatabaseInner.class, this.client.getContext()); } /** @@ -266,7 +341,10 @@ private PollerFlux, DatabaseInner> beginCreateOrUpdate @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(); + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, databaseName, parameters); + return this.client.getLroResult(response, DatabaseInner.class, + DatabaseInner.class, Context.NONE); } /** @@ -285,8 +363,10 @@ public SyncPoller, DatabaseInner> beginCreateOrUpdate( @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(); + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, databaseName, parameters, context); + return this.client.getLroResult(response, DatabaseInner.class, + DatabaseInner.class, context); } /** @@ -308,26 +388,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String .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. * @@ -343,7 +403,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters).getFinalResult(); } /** @@ -362,7 +422,7 @@ public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, @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(); + return beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, context).getFinalResult(); } /** @@ -379,28 +439,9 @@ public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, @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 accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -410,37 +451,15 @@ private Mono>> deleteWithResponseAsync(String resource * @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}. + * @return the response body along with {@link Response}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, databaseName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String serverName, String databaseName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, Context.NONE); } /** @@ -449,17 +468,17 @@ private Mono>> deleteWithResponseAsync(String resource * @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. + * @return the response body along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, String databaseName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, context); } /** @@ -468,7 +487,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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. @@ -476,12 +494,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @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); + String databaseName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName, databaseName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -498,7 +514,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, String databaseName) { - return this.beginDeleteAsync(resourceGroupName, serverName, databaseName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, serverName, databaseName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -516,7 +533,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @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(); + Response response = deleteWithResponse(resourceGroupName, serverName, databaseName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -536,24 +554,6 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri .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. * @@ -566,7 +566,7 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String serverName, String databaseName) { - deleteAsync(resourceGroupName, serverName, databaseName).block(); + beginDelete(resourceGroupName, serverName, databaseName).getFinalResult(); } /** @@ -582,136 +582,7 @@ public void delete(String resourceGroupName, String serverName, String databaseN */ @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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), 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(); + beginDelete(resourceGroupName, serverName, databaseName, context).getFinalResult(); } /** @@ -722,26 +593,12 @@ public DatabaseInner get(String resourceGroupName, String serverName, String dat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a Database list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), @@ -756,37 +613,15 @@ private Mono> listByServerSinglePageAsync(String re * * @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}. + * @return the response of a Database list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** @@ -797,12 +632,16 @@ private Mono> listByServerSinglePageAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a Database list operation along with {@link PagedResponse}. */ - @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 PagedResponse listByServerSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -814,12 +653,17 @@ private PagedFlux listByServerAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a Database list operation along with {@link PagedResponse}. */ - @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) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -830,11 +674,12 @@ private PagedFlux listByServerAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the response of a Database list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePage(nextLink)); } /** @@ -846,11 +691,12 @@ public PagedIterable listByServer(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 databases as paginated response with {@link PagedIterable}. + * @return the response of a Database list operation 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)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); } /** @@ -860,17 +706,11 @@ public PagedIterable listByServer(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 databases along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Database list operation 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)) @@ -879,6 +719,24 @@ private Mono> listByServerNextSinglePageAsync(Strin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Database list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -887,21 +745,14 @@ private Mono> listByServerNextSinglePageAsync(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 databases along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Database list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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 index cdf2a5661f14..1e751613922f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,14 +27,6 @@ public DatabasesImpl(DatabasesClient 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 @@ -56,6 +48,14 @@ public Database get(String resourceGroupName, String serverName, String database } } + 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 PagedIterable listByServer(String resourceGroupName, String serverName) { PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, 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 index 4cc607c58b82..5c53d146ae38 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java index 3316f56e000f..0bd710cd03fa 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRuleListResult; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.FirewallRuleListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,45 +68,81 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient { * The interface defining all the services for MySqlManagementClientFirewallRules to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientFirewallRules") public interface FirewallRulesService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("firewallRuleName") String firewallRuleName, @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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") 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, @HeaderParam("Accept") String accept, + @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FirewallRuleInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FirewallRuleInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("firewallRuleName") String firewallRuleName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("firewallRuleName") String firewallRuleName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> listByServer(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer(@HostParam("$host") String endpoint, + Response listByServerSync(@HostParam("endpoint") 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); @@ -115,8 +152,91 @@ Mono> listByServer(@HostParam("$host") String e @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String serverName, + String firewallRuleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName) { + return getWithResponse(resourceGroupName, serverName, firewallRuleName, Context.NONE).getValue(); } /** @@ -134,35 +254,12 @@ Mono> listByServerNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (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.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, parameters, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -173,44 +270,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 represents a server firewall rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, String firewallRuleName, FirewallRuleInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (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.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String firewallRuleName, FirewallRuleInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, parameters, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, contentType, accept, + parameters, Context.NONE); } /** @@ -220,18 +292,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 represents a server firewall rule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FirewallRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - FirewallRuleInner.class, FirewallRuleInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String firewallRuleName, FirewallRuleInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, contentType, accept, + parameters, context); } /** @@ -241,7 +315,6 @@ private PollerFlux, FirewallRuleInner> beginCreate * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -249,13 +322,11 @@ private PollerFlux, FirewallRuleInner> beginCreate */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, FirewallRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - FirewallRuleInner.class, FirewallRuleInner.class, context); + FirewallRuleInner.class, FirewallRuleInner.class, this.client.getContext()); } /** @@ -273,8 +344,10 @@ private PollerFlux, FirewallRuleInner> beginCreate @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FirewallRuleInner> beginCreateOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, firewallRuleName, parameters); + return this.client.getLroResult(response, FirewallRuleInner.class, + FirewallRuleInner.class, Context.NONE); } /** @@ -293,8 +366,10 @@ public SyncPoller, FirewallRuleInner> beginCreateO @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FirewallRuleInner> beginCreateOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, firewallRuleName, parameters, context); + return this.client.getLroResult(response, FirewallRuleInner.class, + FirewallRuleInner.class, context); } /** @@ -316,26 +391,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, St .flatMap(this.client::getLroFinalResultOrError); } - /** - * Creates a new firewall rule or updates an existing firewall rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - String firewallRuleName, FirewallRuleInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Creates a new firewall rule or updates an existing firewall rule. * @@ -351,7 +406,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, serverName, firewallRuleName, parameters).getFinalResult(); } /** @@ -370,7 +425,8 @@ public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverN @ServiceMethod(returns = ReturnType.SINGLE) public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, serverName, firewallRuleName, parameters, context) + .getFinalResult(); } /** @@ -387,29 +443,9 @@ public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(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 accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -419,38 +455,16 @@ private Mono>> deleteWithResponseAsync(String resource * @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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, - String firewallRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, firewallRuleName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String serverName, + String firewallRuleName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, Context.NONE); } /** @@ -459,18 +473,17 @@ private Mono>> deleteWithResponseAsync(String resource * @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 the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, - String firewallRuleName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, serverName, firewallRuleName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, + String firewallRuleName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, context); } /** @@ -479,7 +492,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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. @@ -487,12 +499,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, - String firewallRuleName, Context context) { - context = this.client.mergeContext(context); + String firewallRuleName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, serverName, firewallRuleName, context); + = deleteWithResponseAsync(resourceGroupName, serverName, firewallRuleName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -509,7 +520,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, String firewallRuleName) { - return this.beginDeleteAsync(resourceGroupName, serverName, firewallRuleName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, serverName, firewallRuleName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -527,7 +539,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @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(); + Response response = deleteWithResponse(resourceGroupName, serverName, firewallRuleName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -547,25 +560,6 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, String firewallRuleName, - Context context) { - return beginDeleteAsync(resourceGroupName, serverName, firewallRuleName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a firewall rule. * @@ -578,7 +572,7 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String serverName, String firewallRuleName) { - deleteAsync(resourceGroupName, serverName, firewallRuleName).block(); + beginDelete(resourceGroupName, serverName, firewallRuleName).getFinalResult(); } /** @@ -594,140 +588,7 @@ public void delete(String resourceGroupName, String serverName, String firewallR */ @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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - String firewallRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), 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(); + beginDelete(resourceGroupName, serverName, firewallRuleName, context).getFinalResult(); } /** @@ -738,26 +599,12 @@ public FirewallRuleInner get(String resourceGroupName, String serverName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), @@ -772,37 +619,15 @@ private Mono> listByServerSinglePageAsync(Strin * * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FirewallRule list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** @@ -813,12 +638,16 @@ private Mono> listByServerSinglePageAsync(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 firewall rules as paginated response with {@link PagedFlux}. + * @return the response of a FirewallRule list operation along with {@link PagedResponse}. */ - @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 PagedResponse listByServerSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -830,13 +659,17 @@ 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 the response of a FirewallRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -847,11 +680,12 @@ 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 PagedIterable}. + * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePage(nextLink)); } /** @@ -863,11 +697,12 @@ public PagedIterable listByServer(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a FirewallRule list operation 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)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); } /** @@ -877,17 +712,11 @@ public PagedIterable listByServer(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a FirewallRule list operation 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)) @@ -896,6 +725,24 @@ private Mono> listByServerNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FirewallRule list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -904,21 +751,14 @@ private Mono> listByServerNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a FirewallRule list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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 index 8dedf9b2bac3..fe42c7e98f47 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,14 +27,6 @@ public FirewallRulesImpl(FirewallRulesClient 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 @@ -56,6 +48,14 @@ public FirewallRule get(String resourceGroupName, String serverName, String fire } } + 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 PagedIterable listByServer(String resourceGroupName, String serverName) { PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, 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 index ef655f401624..4e8e11a194c3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java index 7f48312bd655..331e8127051e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -53,14 +53,21 @@ public final class GetPrivateDnsZoneSuffixesClientImpl implements GetPrivateDnsZ * The interface defining all the services for MySqlManagementClientGetPrivateDnsZoneSuffixes to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientGetPrivateDnsZoneSuffixes") public interface GetPrivateDnsZoneSuffixesService { @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.DBforMySQL/getPrivateDnsZoneSuffix") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> execute(@HostParam("$host") String endpoint, + Mono> execute(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.DBforMySQL/getPrivateDnsZoneSuffix") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } @@ -74,10 +81,6 @@ Mono> execute(@HostParam("$host") */ @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 accept = "application/json"; return FluxUtil .withContext( @@ -85,27 +88,6 @@ private Mono> executeWithResponse .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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - } - /** * Get private DNS zone suffix in the cloud. * @@ -129,7 +111,8 @@ private Mono executeAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response executeWithResponse(Context context) { - return executeWithResponseAsync(context).block(); + final String accept = "application/json"; + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** 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 index 2b10bd647f1d..3583e09ec4c5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java new file mode 100644 index 000000000000..d0f942e8ea65 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; + +public final class HighAvailabilityValidationEstimationImpl implements HighAvailabilityValidationEstimation { + private HighAvailabilityValidationEstimationInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + HighAvailabilityValidationEstimationImpl(HighAvailabilityValidationEstimationInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer estimatedDowntime() { + return this.innerModel().estimatedDowntime(); + } + + public String scheduledStandbyAvailabilityZone() { + return this.innerModel().scheduledStandbyAvailabilityZone(); + } + + public String expectedStandbyAvailabilityZone() { + return this.innerModel().expectedStandbyAvailabilityZone(); + } + + public HighAvailabilityValidationEstimationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java index eea36cc4a331..89074ef149c6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,7 +27,7 @@ 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitiesListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,22 @@ public final class LocationBasedCapabilitiesClientImpl implements LocationBasedC * The interface defining all the services for MySqlManagementClientLocationBasedCapabilities to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientLocationBasedCapabilities") 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, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); @@ -75,7 +83,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -90,17 +105,6 @@ Mono> listNext(@PathParam(value = "nextLink", e */ @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 accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -114,33 +118,14 @@ private Mono> listSinglePageAsync(Strin * 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}. + * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. */ - @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName) { + return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -150,11 +135,15 @@ private Mono> listSinglePageAsync(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 capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String locationName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -165,12 +154,15 @@ private PagedFlux listAsync(String locationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String locationName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -185,7 +177,7 @@ private PagedFlux listAsync(String locationName, Cont */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String locationName) { - return new PagedIterable<>(listAsync(locationName)); + return new PagedIterable<>(() -> listSinglePage(locationName), nextLink -> listNextSinglePage(nextLink)); } /** @@ -201,7 +193,8 @@ public PagedIterable list(String locationName) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String locationName, Context context) { - return new PagedIterable<>(listAsync(locationName, context)); + return new PagedIterable<>(() -> listSinglePage(locationName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -211,17 +204,11 @@ public PagedIterable list(String locationName, Contex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return capabilities at specified location in a given subscription 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(), @@ -229,6 +216,24 @@ private Mono> listNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -237,21 +242,14 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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 index 1df942ea4d37..03fd06e2ea9b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java new file mode 100644 index 000000000000..08ba516c59eb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitySetsList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. + */ +public final class LocationBasedCapabilitySetsClientImpl implements LocationBasedCapabilitySetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LocationBasedCapabilitySetsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedCapabilitySetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationBasedCapabilitySetsClientImpl(MySqlManagementClientImpl client) { + this.service = RestProxy.create(LocationBasedCapabilitySetsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientLocationBasedCapabilitySets to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientLocationBasedCapabilitySets") + public interface LocationBasedCapabilitySetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("capabilitySetName") String capabilitySetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("capabilitySetName") String capabilitySetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName, String capabilitySetName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, capabilitySetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String capabilitySetName) { + return getWithResponseAsync(locationName, capabilitySetName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, String capabilitySetName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, capabilitySetName, accept, context); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityInner get(String locationName, String capabilitySetName) { + return getWithResponse(locationName, capabilitySetName, Context.NONE).getValue(); + } + + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String locationName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String locationName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, context); + return 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName) { + return new PagedIterable<>(() -> listSinglePage(locationName), nextLink -> listNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName, Context context) { + return new PagedIterable<>(() -> listSinglePage(locationName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java new file mode 100644 index 000000000000..0a9bf77ef42d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; +import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; + +public final class LocationBasedCapabilitySetsImpl implements LocationBasedCapabilitySets { + private static final ClientLogger LOGGER = new ClientLogger(LocationBasedCapabilitySetsImpl.class); + + private final LocationBasedCapabilitySetsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public LocationBasedCapabilitySetsImpl(LocationBasedCapabilitySetsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String locationName, String capabilitySetName, Context context) { + Response inner + = this.serviceClient().getWithResponse(locationName, capabilitySetName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CapabilityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Capability get(String locationName, String capabilitySetName) { + CapabilityInner inner = this.serviceClient().get(locationName, capabilitySetName); + if (inner != null) { + return new CapabilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String locationName) { + PagedIterable inner = this.serviceClient().list(locationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); + } + + public PagedIterable list(String locationName, Context context) { + PagedIterable inner = this.serviceClient().list(locationName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); + } + + private LocationBasedCapabilitySetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java new file mode 100644 index 000000000000..e89b47cc731b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 new file mode 100644 index 000000000000..cdd950c0ae7b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientLogFiles") + 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("endpoint") 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}/logFiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerSync(@HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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 the response of a LogFile list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the server log files in a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogFile list operation 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogFile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogFile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return 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 the response of a LogFile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePage(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 the response of a LogFile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogFile list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogFile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogFile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..1671344c4e04 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; +import com.azure.resourcemanager.mysqlflexibleserver.models.LogFiles; + +public final class LogFilesImpl implements LogFiles { + private static final ClientLogger LOGGER = new ClientLogger(LogFilesImpl.class); + + private final LogFilesClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public LogFilesImpl(LogFilesClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { + PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); + } + + private LogFilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsClientImpl.java new file mode 100644 index 000000000000..8ce617fa13b3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsClientImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LongRunningBackupOperationsClient. + */ +public final class LongRunningBackupOperationsClientImpl implements LongRunningBackupOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LongRunningBackupOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of LongRunningBackupOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LongRunningBackupOperationsClientImpl(MySqlManagementClientImpl client) { + this.service = RestProxy.create(LongRunningBackupOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientLongRunningBackupOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientLongRunningBackupOperations") + public interface LongRunningBackupOperationsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") 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, + @BodyParam("application/json") ServerBackupV2Inner parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") 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, + @BodyParam("application/json") ServerBackupV2Inner parameters, Context context); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, + String backupName, ServerBackupV2Inner parameters) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Response createWithResponse(String resourceGroupName, String serverName, String backupName, + ServerBackupV2Inner parameters) { + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, parameters, + Context.NONE); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String serverName, String backupName, + ServerBackupV2Inner parameters, Context context) { + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, parameters, context); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, + String serverName, String backupName, ServerBackupV2Inner parameters) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ServerBackupV2Inner.class, ServerBackupV2Inner.class, this.client.getContext()); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, + String serverName, String backupName) { + final ServerBackupV2Inner parameters = null; + Mono>> mono + = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ServerBackupV2Inner.class, ServerBackupV2Inner.class, this.client.getContext()); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, + String serverName, String backupName, ServerBackupV2Inner parameters) { + Response response = createWithResponse(resourceGroupName, serverName, backupName, parameters); + return this.client.getLroResult(response, ServerBackupV2Inner.class, + ServerBackupV2Inner.class, Context.NONE); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, + String serverName, String backupName) { + final ServerBackupV2Inner parameters = null; + Response response = createWithResponse(resourceGroupName, serverName, backupName, parameters); + return this.client.getLroResult(response, ServerBackupV2Inner.class, + ServerBackupV2Inner.class, Context.NONE); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of server backup properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, + String serverName, String backupName, ServerBackupV2Inner parameters, Context context) { + Response response + = createWithResponse(resourceGroupName, serverName, backupName, parameters, context); + return this.client.getLroResult(response, ServerBackupV2Inner.class, + ServerBackupV2Inner.class, context); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String serverName, String backupName, + ServerBackupV2Inner parameters) { + return beginCreateAsync(resourceGroupName, serverName, backupName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String serverName, String backupName) { + final ServerBackupV2Inner parameters = null; + return beginCreateAsync(resourceGroupName, serverName, backupName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName) { + final ServerBackupV2Inner parameters = null; + return beginCreate(resourceGroupName, serverName, backupName, parameters).getFinalResult(); + } + + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server backup properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName, + ServerBackupV2Inner parameters, Context context) { + return beginCreate(resourceGroupName, serverName, backupName, parameters, context).getFinalResult(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsImpl.java new file mode 100644 index 000000000000..1e9785a79811 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsImpl.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackupOperations; + +public final class LongRunningBackupOperationsImpl implements LongRunningBackupOperations { + private static final ClientLogger LOGGER = new ClientLogger(LongRunningBackupOperationsImpl.class); + + private final LongRunningBackupOperationsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public LongRunningBackupOperationsImpl(LongRunningBackupOperationsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + private LongRunningBackupOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } + + public ServerBackupV2Impl define(String name) { + return new ServerBackupV2Impl(name, this.manager()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java new file mode 100644 index 000000000000..a16f3cec6218 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.LongRunningBackupsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupV2ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LongRunningBackupsClient. + */ +public final class LongRunningBackupsClientImpl implements LongRunningBackupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LongRunningBackupsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of LongRunningBackupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LongRunningBackupsClientImpl(MySqlManagementClientImpl client) { + this.service = RestProxy.create(LongRunningBackupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientLongRunningBackups to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientLongRunningBackups") + public interface LongRunningBackupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("backupName") String backupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("backupName") String backupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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}/backupsV2") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String serverName, + String backupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serverName, String backupName) { + return getWithResponseAsync(resourceGroupName, serverName, backupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String serverName, String backupName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, backupName, accept, context); + } + + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBackupV2Inner get(String resourceGroupName, String serverName, String backupName) { + return getWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); + } + + /** + * List all the backups for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the 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 the response of a ServerBackupV2 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the backups for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); + return 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 the response of a ServerBackupV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, serverName), + nextLink -> listNextSinglePage(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 the response of a ServerBackupV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, serverName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java new file mode 100644 index 000000000000..82583280a940 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.LongRunningBackupsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackups; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; + +public final class LongRunningBackupsImpl implements LongRunningBackups { + private static final ClientLogger LOGGER = new ClientLogger(LongRunningBackupsImpl.class); + + private final LongRunningBackupsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public LongRunningBackupsImpl(LongRunningBackupsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String serverName, String backupName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, serverName, backupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServerBackupV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServerBackupV2 get(String resourceGroupName, String serverName, String backupName) { + ServerBackupV2Inner inner = this.serviceClient().get(resourceGroupName, serverName, backupName); + if (inner != null) { + return new ServerBackupV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupV2Impl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serverName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupV2Impl(inner1, this.manager())); + } + + private LongRunningBackupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java new file mode 100644 index 000000000000..34e5d8738e89 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; +import java.time.OffsetDateTime; + +public final class MaintenanceImpl implements Maintenance { + private MaintenanceInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + MaintenanceImpl(MaintenanceInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MaintenanceType maintenanceType() { + return this.innerModel().maintenanceType(); + } + + public MaintenanceState maintenanceState() { + return this.innerModel().maintenanceState(); + } + + public OffsetDateTime maintenanceStartTime() { + return this.innerModel().maintenanceStartTime(); + } + + public OffsetDateTime maintenanceEndTime() { + return this.innerModel().maintenanceEndTime(); + } + + public OffsetDateTime maintenanceExecutionStartTime() { + return this.innerModel().maintenanceExecutionStartTime(); + } + + public OffsetDateTime maintenanceExecutionEndTime() { + return this.innerModel().maintenanceExecutionEndTime(); + } + + public OffsetDateTime maintenanceAvailableScheduleMinTime() { + return this.innerModel().maintenanceAvailableScheduleMinTime(); + } + + public OffsetDateTime maintenanceAvailableScheduleMaxTime() { + return this.innerModel().maintenanceAvailableScheduleMaxTime(); + } + + public String maintenanceTitle() { + return this.innerModel().maintenanceTitle(); + } + + public String maintenanceDescription() { + return this.innerModel().maintenanceDescription(); + } + + public MaintenanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public MaintenanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java new file mode 100644 index 000000000000..d43c4ddc09fd --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.MaintenanceListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MaintenancesClient. + */ +public final class MaintenancesClientImpl implements MaintenancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final MaintenancesService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of MaintenancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MaintenancesClientImpl(MySqlManagementClientImpl client) { + this.service + = RestProxy.create(MaintenancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientMaintenances to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientMaintenances") + public interface MaintenancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> read(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response readSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceUpdate parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceUpdate parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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}/maintenances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync(String resourceGroupName, String serverName, + String maintenanceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.read(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, maintenanceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readAsync(String resourceGroupName, String serverName, String maintenanceName) { + return readWithResponseAsync(resourceGroupName, serverName, maintenanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWithResponse(String resourceGroupName, String serverName, + String maintenanceName, Context context) { + final String accept = "application/json"; + return service.readSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, maintenanceName, accept, context); + } + + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner read(String resourceGroupName, String serverName, String maintenanceName) { + return readWithResponse(resourceGroupName, serverName, maintenanceName, Context.NONE).getValue(); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, + String maintenanceName, MaintenanceUpdate parameters) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, maintenanceName, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, maintenanceName, accept, parameters, + Context.NONE); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, maintenanceName, accept, parameters, + context); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, + String serverName, String maintenanceName, MaintenanceUpdate parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MaintenanceInner.class, MaintenanceInner.class, this.client.getContext()); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, + String serverName, String maintenanceName) { + final MaintenanceUpdate parameters = null; + Mono>> mono + = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MaintenanceInner.class, MaintenanceInner.class, this.client.getContext()); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, + String serverName, String maintenanceName, MaintenanceUpdate parameters) { + Response response = updateWithResponse(resourceGroupName, serverName, maintenanceName, parameters); + return this.client.getLroResult(response, MaintenanceInner.class, + MaintenanceInner.class, Context.NONE); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, + String serverName, String maintenanceName) { + final MaintenanceUpdate parameters = null; + Response response = updateWithResponse(resourceGroupName, serverName, maintenanceName, parameters); + return this.client.getLroResult(response, MaintenanceInner.class, + MaintenanceInner.class, Context.NONE); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, + String serverName, String maintenanceName, MaintenanceUpdate parameters, Context context) { + Response response + = updateWithResponse(resourceGroupName, serverName, maintenanceName, parameters, context); + return this.client.getLroResult(response, MaintenanceInner.class, + MaintenanceInner.class, context); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName) { + final MaintenanceUpdate parameters = null; + return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName) { + final MaintenanceUpdate parameters = null; + return beginUpdate(resourceGroupName, serverName, maintenanceName, parameters).getFinalResult(); + } + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters, Context context) { + return beginUpdate(resourceGroupName, serverName, maintenanceName, parameters, context).getFinalResult(); + } + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, serverName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, serverName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java new file mode 100644 index 000000000000..581589e03030 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenances; + +public final class MaintenancesImpl implements Maintenances { + private static final ClientLogger LOGGER = new ClientLogger(MaintenancesImpl.class); + + private final MaintenancesClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public MaintenancesImpl(MaintenancesClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, + Context context) { + Response inner + = this.serviceClient().readWithResponse(resourceGroupName, serverName, maintenanceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Maintenance read(String resourceGroupName, String serverName, String maintenanceName) { + MaintenanceInner inner = this.serviceClient().read(resourceGroupName, serverName, maintenanceName); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Maintenance update(String resourceGroupName, String serverName, String maintenanceName) { + MaintenanceInner inner = this.serviceClient().update(resourceGroupName, serverName, maintenanceName); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Maintenance update(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters, Context context) { + MaintenanceInner inner + = this.serviceClient().update(resourceGroupName, serverName, maintenanceName, parameters, context); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serverName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); + } + + private MaintenancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java index b9b230a8ac63..dc1ceb708055 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { MySqlManagementClientImpl.class }) public final class MySqlManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the MySqlManagementClientBuilder. */ - public MySqlManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public MySqlManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the MySqlManagementClientBuilder. */ - public MySqlManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public MySqlManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public MySqlManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); MySqlManagementClientImpl client = new MySqlManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } 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 b02b285661f5..2df7d54f0afb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -15,14 +15,20 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient; @@ -32,10 +38,20 @@ import com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -51,26 +67,12 @@ @ServiceClient(builder = MySqlManagementClientBuilder.class) public final class MySqlManagementClientImpl implements MySqlManagementClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -79,12 +81,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -92,6 +94,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -134,6 +150,34 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The 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 ServersClient object to access its operations. */ @@ -149,17 +193,45 @@ public ServersClient getServers() { } /** - * The ReplicasClient object to access its operations. + * The BackupAndExportsClient object to access its operations. */ - private final ReplicasClient replicas; + private final BackupAndExportsClient backupAndExports; /** - * Gets the ReplicasClient object to access its operations. + * Gets the BackupAndExportsClient object to access its operations. * - * @return the ReplicasClient object. + * @return the BackupAndExportsClient object. */ - public ReplicasClient getReplicas() { - return this.replicas; + public BackupAndExportsClient getBackupAndExports() { + return this.backupAndExports; + } + + /** + * 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 ServersMigrationsClient object to access its operations. + */ + private final ServersMigrationsClient serversMigrations; + + /** + * Gets the ServersMigrationsClient object to access its operations. + * + * @return the ServersMigrationsClient object. + */ + public ServersMigrationsClient getServersMigrations() { + return this.serversMigrations; } /** @@ -177,31 +249,31 @@ public BackupsClient getBackups() { } /** - * The FirewallRulesClient object to access its operations. + * The LongRunningBackupsClient object to access its operations. */ - private final FirewallRulesClient firewallRules; + private final LongRunningBackupsClient longRunningBackups; /** - * Gets the FirewallRulesClient object to access its operations. + * Gets the LongRunningBackupsClient object to access its operations. * - * @return the FirewallRulesClient object. + * @return the LongRunningBackupsClient object. */ - public FirewallRulesClient getFirewallRules() { - return this.firewallRules; + public LongRunningBackupsClient getLongRunningBackups() { + return this.longRunningBackups; } /** - * The DatabasesClient object to access its operations. + * The LongRunningBackupOperationsClient object to access its operations. */ - private final DatabasesClient databases; + private final LongRunningBackupOperationsClient longRunningBackupOperations; /** - * Gets the DatabasesClient object to access its operations. + * Gets the LongRunningBackupOperationsClient object to access its operations. * - * @return the DatabasesClient object. + * @return the LongRunningBackupOperationsClient object. */ - public DatabasesClient getDatabases() { - return this.databases; + public LongRunningBackupOperationsClient getLongRunningBackupOperations() { + return this.longRunningBackupOperations; } /** @@ -218,6 +290,104 @@ 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 AdvancedThreatProtectionSettingsClient object to access its operations. + */ + private final AdvancedThreatProtectionSettingsClient advancedThreatProtectionSettings; + + /** + * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * + * @return the AdvancedThreatProtectionSettingsClient object. + */ + public AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings() { + return this.advancedThreatProtectionSettings; + } + + /** + * The LocationBasedCapabilitySetsClient object to access its operations. + */ + private final LocationBasedCapabilitySetsClient locationBasedCapabilitySets; + + /** + * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * + * @return the LocationBasedCapabilitySetsClient object. + */ + public LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets() { + return this.locationBasedCapabilitySets; + } + + /** + * The MaintenancesClient object to access its operations. + */ + private final MaintenancesClient maintenances; + + /** + * Gets the MaintenancesClient object to access its operations. + * + * @return the MaintenancesClient object. + */ + public MaintenancesClient getMaintenances() { + return this.maintenances; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + /** * The LocationBasedCapabilitiesClient object to access its operations. */ @@ -274,6 +444,34 @@ public CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWitho return this.checkNameAvailabilityWithoutLocations; } + /** + * The OperationResultsClient object to access its operations. + */ + private final OperationResultsClient operationResults; + + /** + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. + */ + public OperationResultsClient getOperationResults() { + return this.operationResults; + } + + /** + * The OperationProgressClient object to access its operations. + */ + private final OperationProgressClient operationProgress; + + /** + * Gets the OperationProgressClient object to access its operations. + * + * @return the OperationProgressClient object. + */ + public OperationProgressClient getOperationProgress() { + return this.operationProgress; + } + /** * The GetPrivateDnsZoneSuffixesClient object to access its operations. */ @@ -289,17 +487,17 @@ public GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes() { } /** - * The OperationsClient object to access its operations. + * The ReplicasClient object to access its operations. */ - private final OperationsClient operations; + private final ReplicasClient replicas; /** - * Gets the OperationsClient object to access its operations. + * Gets the ReplicasClient object to access its operations. * - * @return the OperationsClient object. + * @return the ReplicasClient object. */ - public OperationsClient getOperations() { - return this.operations; + public ReplicasClient getReplicas() { + return this.replicas; } /** @@ -309,29 +507,42 @@ 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 endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ MySqlManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-05-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2024-12-30"; + this.operations = new OperationsClientImpl(this); + this.azureADAdministrators = new AzureADAdministratorsClientImpl(this); this.servers = new ServersClientImpl(this); - this.replicas = new ReplicasClientImpl(this); + this.backupAndExports = new BackupAndExportsClientImpl(this); + this.logFiles = new LogFilesClientImpl(this); + this.serversMigrations = new ServersMigrationsClientImpl(this); this.backups = new BackupsClientImpl(this); - this.firewallRules = new FirewallRulesClientImpl(this); - this.databases = new DatabasesClientImpl(this); + this.longRunningBackups = new LongRunningBackupsClientImpl(this); + this.longRunningBackupOperations = new LongRunningBackupOperationsClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); + this.databases = new DatabasesClientImpl(this); + this.firewallRules = new FirewallRulesClientImpl(this); + this.advancedThreatProtectionSettings = new AdvancedThreatProtectionSettingsClientImpl(this); + this.locationBasedCapabilitySets = new LocationBasedCapabilitySetsClientImpl(this); + this.maintenances = new MaintenancesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); this.checkVirtualNetworkSubnetUsages = new CheckVirtualNetworkSubnetUsagesClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); this.checkNameAvailabilityWithoutLocations = new CheckNameAvailabilityWithoutLocationsClientImpl(this); + this.operationResults = new OperationResultsClientImpl(this); + this.operationProgress = new OperationProgressClientImpl(this); this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.replicas = new ReplicasClientImpl(this); } /** @@ -371,6 +582,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * 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 index feec4eb6aa5f..83a489d94a16 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; 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 index 224adecac6f9..0cb53b9661d0 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.models.Origin; import java.util.Collections; import java.util.Map; @@ -29,7 +30,7 @@ public OperationDisplay display() { return this.innerModel().display(); } - public String origin() { + public Origin origin() { return this.innerModel().origin(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java new file mode 100644 index 000000000000..85afe04d0751 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationProgressClient. + */ +public final class OperationProgressClientImpl implements OperationProgressClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationProgressService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of OperationProgressClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationProgressClientImpl(MySqlManagementClientImpl client) { + this.service + = RestProxy.create(OperationProgressService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientOperationProgress to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientOperationProgress") + public interface OperationProgressService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationProgress/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationProgress/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String operationId) { + return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, String operationId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, operationId, accept, context); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationProgressResultInner get(String locationName, String operationId) { + return getWithResponse(locationName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java new file mode 100644 index 000000000000..77e40dd0a837 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgress; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResult; + +public final class OperationProgressImpl implements OperationProgress { + private static final ClientLogger LOGGER = new ClientLogger(OperationProgressImpl.class); + + private final OperationProgressClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public OperationProgressImpl(OperationProgressClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String locationName, String operationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(locationName, operationId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationProgressResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationProgressResult get(String locationName, String operationId) { + OperationProgressResultInner inner = this.serviceClient().get(locationName, operationId); + if (inner != null) { + return new OperationProgressResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationProgressClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java new file mode 100644 index 000000000000..b534b998f042 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class OperationProgressResultImpl implements OperationProgressResult { + private OperationProgressResultInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + OperationProgressResultImpl(OperationProgressResultInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public OperationProgressResponseType properties() { + return this.innerModel().properties(); + } + + public OperationProgressResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java new file mode 100644 index 000000000000..3852ff702524 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationResultsClient. + */ +public final class OperationResultsClientImpl implements OperationResultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationResultsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of OperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationResultsClientImpl(MySqlManagementClientImpl client) { + this.service + = RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientOperationResults to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientOperationResults") + public interface OperationResultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName, + String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String operationId) { + return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, String operationId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, operationId, accept, context); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusExtendedResultInner get(String locationName, String operationId) { + return getWithResponse(locationName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java new file mode 100644 index 000000000000..31ed8a49501e --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; + +public final class OperationResultsImpl implements OperationResults { + private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); + + private final OperationResultsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public OperationResultsImpl(OperationResultsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String locationName, String operationId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(locationName, operationId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusExtendedResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatusExtendedResult get(String locationName, String operationId) { + OperationStatusExtendedResultInner inner = this.serviceClient().get(locationName, operationId); + if (inner != null) { + return new OperationStatusExtendedResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java new file mode 100644 index 000000000000..dcd53f8b8a4f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class OperationStatusExtendedResultImpl implements OperationStatusExtendedResult { + private OperationStatusExtendedResultInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + OperationStatusExtendedResultImpl(OperationStatusExtendedResultInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationStatusExtendedResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java index 75f050fdcb9f..4637cd6c1cb6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,7 +27,7 @@ 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for MySqlManagementClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DBforMySQL/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.DBforMySQL/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,23 +81,26 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the static parameters for a resource group based resource 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 accept = "application/json"; return FluxUtil .withContext( @@ -101,79 +111,77 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available REST API operations. + * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the static parameters for a resource group based resource as paginated response with {@link PagedFlux}. */ - @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedFlux}. + * @return the static parameters for a resource group based resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedFlux}. + * @return the static parameters for a resource group based resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + * @return the static parameters for a resource group based resource as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + * @return the static parameters for a resource group based resource as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -183,18 +191,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the static parameters for a resource group based resource 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(), @@ -202,6 +203,24 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static parameters for a resource group based resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -210,22 +229,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @return the static parameters for a resource group based resource along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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 index 6e896abc673d..bd5a893b5881 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; 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..6ad38e821272 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.privateEndpointConnectionName + = ResourceManagerUtils.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..37dd8abd0bea --- /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) TypeSpec 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 String nextLink() { + return this.innerModel().nextLink(); + } + + 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/PrivateEndpointConnectionsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..d3d5e57b1010 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,679 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.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 PrivateEndpointConnectionsClient. + */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(MySqlManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientPrivateEndpointConnections") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServer(@HostParam("endpoint") 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}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerSync(@HostParam("endpoint") 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); + } + + /** + * 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 associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String serverName, String privateEndpointConnectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, privateEndpointConnectionName, 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 associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, contentType, + accept, parameters, Context.NONE); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, contentType, + accept, parameters, context); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String serverName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Response response + = createOrUpdateWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, parameters); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String serverName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, serverName, + privateEndpointConnectionName, parameters, context); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdate(resourceGroupName, serverName, privateEndpointConnectionName, parameters) + .getFinalResult(); + } + + /** + * 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 name of the private endpoint connection associated with the Azure + * resource. + * @param parameters Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String serverName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) + .getFinalResult(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName, + String privateEndpointConnectionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, + Context.NONE); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, context); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, + String privateEndpointConnectionName) { + Response response + = deleteWithResponse(resourceGroupName, serverName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, + String privateEndpointConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + beginDelete(resourceGroupName, serverName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, + Context context) { + beginDelete(resourceGroupName, serverName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * 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 all private endpoint connections on a server along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByServerWithResponseAsync(String resourceGroupName, String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 all private endpoint connections on a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServerAsync(String resourceGroupName, + String serverName) { + return listByServerWithResponseAsync(resourceGroupName, serverName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a server along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServerWithResponse(String resourceGroupName, + String serverName, Context context) { + final String accept = "application/json"; + return service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + } + + /** + * 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 all private endpoint connections on a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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/PrivateEndpointConnectionsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..392a1c18cfb5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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 PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String serverName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, serverName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, serverName, privateEndpointConnectionName); + } + + 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) { + 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 PrivateEndpointConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, serverName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } + + 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/PrivateLinkResourceImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..4a81023e2a5e --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner 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 PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateLinkResourceInner 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/PrivateLinkResourcesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..d675cd9f0463 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * 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 PrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(MySqlManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientPrivateLinkResources") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServer(@HostParam("endpoint") 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}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerSync(@HostParam("endpoint") 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); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String serverName, + String groupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, groupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, groupName, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String serverName, String groupName) { + return getWithResponse(resourceGroupName, serverName, groupName, Context.NONE).getValue(); + } + + /** + * 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 private link resources for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerSinglePageAsync(String resourceGroupName, + String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 private link resources for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName)); + } + + /** + * 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 private link resources for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 along + * with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, + String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); + } + + /** + * 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 ManagementException thrown if 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 for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 along + * with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); + } + + /** + * 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 private link resources for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName)); + } + + /** + * 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 ManagementException thrown if 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 for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context)); + } +} 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..c165f5314911 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; +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 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; + } + } + + public PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + PagedIterable inner + = this.serviceClient().listByServer(resourceGroupName, serverName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + 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/ReplicasClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java index ec468bda9bbe..2de3c487fe05 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -27,7 +27,7 @@ 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.implementation.models.ServerListResult; import reactor.core.publisher.Mono; /** @@ -58,14 +58,23 @@ public final class ReplicasClientImpl implements ReplicasClient { * The interface defining all the services for MySqlManagementClientReplicas to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientReplicas") public interface ReplicasService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/replicas") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer(@HostParam("$host") String endpoint, + Mono> listByServer(@HostParam("endpoint") 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}/replicas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerSync(@HostParam("endpoint") 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); @@ -75,8 +84,15 @@ Mono> listByServer(@HostParam("$host") String endpoin @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByServerNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -87,25 +103,11 @@ Mono> listByServerNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), @@ -120,37 +122,15 @@ private Mono> listByServerSinglePageAsync(String reso * * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Server list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** @@ -161,12 +141,16 @@ 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 as paginated response with {@link PagedFlux}. + * @return the response of a Server list operation along with {@link PagedResponse}. */ - @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 PagedResponse listByServerSinglePage(String resourceGroupName, String serverName) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -178,12 +162,17 @@ 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 the response of a Server list operation along with {@link PagedResponse}. */ - @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) + private PagedResponse listByServerSinglePage(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByServerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -194,11 +183,12 @@ 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 PagedIterable}. + * @return the response of a Server list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePage(nextLink)); } /** @@ -210,11 +200,12 @@ public PagedIterable listByServer(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation 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)); + return new PagedIterable<>(() -> listByServerSinglePage(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePage(nextLink, context)); } /** @@ -224,17 +215,11 @@ public PagedIterable listByServer(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation 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)) @@ -243,6 +228,24 @@ private Mono> listByServerNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Server list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByServerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -251,21 +254,14 @@ private Mono> listByServerNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByServerNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByServerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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 index cd79c9a5aa75..085d09e7db4a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ResourceManagerUtils.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ResourceManagerUtils.java index 5be9b82c3a76..559f9d75d607 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ResourceManagerUtils.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; 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 index babcd2377980..64e4f11e63f3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java new file mode 100644 index 000000000000..8428db205f58 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; +import java.time.OffsetDateTime; + +public final class ServerBackupV2Impl implements ServerBackupV2, ServerBackupV2.Definition { + private ServerBackupV2Inner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + ServerBackupV2Impl(ServerBackupV2Inner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String backupNameV2() { + return this.innerModel().backupNameV2(); + } + + public BackupType backupType() { + return this.innerModel().backupType(); + } + + public OffsetDateTime completedTime() { + return this.innerModel().completedTime(); + } + + public String source() { + return this.innerModel().source(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ServerBackupV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serverName; + + private String backupName; + + public ServerBackupV2Impl withExistingFlexibleServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + public ServerBackupV2 create() { + this.innerObject = serviceManager.serviceClient() + .getLongRunningBackupOperations() + .create(resourceGroupName, serverName, backupName, this.innerModel(), Context.NONE); + return this; + } + + public ServerBackupV2 create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLongRunningBackupOperations() + .create(resourceGroupName, serverName, backupName, this.innerModel(), context); + return this; + } + + ServerBackupV2Impl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = new ServerBackupV2Inner(); + this.serviceManager = serviceManager; + this.backupName = name; + } + + public ServerBackupV2Impl withBackupNameV2(String backupNameV2) { + this.innerModel().withBackupNameV2(backupNameV2); + return this; + } + + public ServerBackupV2Impl withBackupType(BackupType backupType) { + this.innerModel().withBackupType(backupType); + return this; + } + + public ServerBackupV2Impl withCompletedTime(OffsetDateTime completedTime) { + this.innerModel().withCompletedTime(completedTime); + return this; + } + + public ServerBackupV2Impl withSource(String source) { + this.innerModel().withSource(source); + return this; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java index ca044f5d8bf5..fc0967409ac9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java @@ -1,23 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Backup; import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; +import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; +import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenancePolicy; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; 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; @@ -25,7 +34,9 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class ServerImpl implements Server, Server.Definition, Server.Update { private ServerInner innerObject; @@ -81,6 +92,10 @@ public ServerVersion version() { return this.innerModel().version(); } + public String fullVersion() { + return this.innerModel().fullVersion(); + } + public String availabilityZone() { return this.innerModel().availabilityZone(); } @@ -117,6 +132,10 @@ public String fullyQualifiedDomainName() { return this.innerModel().fullyQualifiedDomainName(); } + public Integer databasePort() { + return this.innerModel().databasePort(); + } + public Storage storage() { return this.innerModel().storage(); } @@ -133,10 +152,29 @@ public Network network() { return this.innerModel().network(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public MaintenancePolicy maintenancePolicy() { + return this.innerModel().maintenancePolicy(); + } + public MaintenanceWindow maintenanceWindow() { return this.innerModel().maintenanceWindow(); } + public ImportSourceProperties importSourceProperties() { + return this.innerModel().importSourceProperties(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -238,6 +276,17 @@ public void failover(Context context) { serviceManager.servers().failover(resourceGroupName, serverName, context); } + public Response validateEstimateHighAvailabilityWithResponse( + HighAvailabilityValidationEstimationInner parameters, Context context) { + return serviceManager.servers() + .validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, context); + } + + public HighAvailabilityValidationEstimation + validateEstimateHighAvailability(HighAvailabilityValidationEstimationInner parameters) { + return serviceManager.servers().validateEstimateHighAvailability(resourceGroupName, serverName, parameters); + } + public void restart(ServerRestartParameter parameters) { serviceManager.servers().restart(resourceGroupName, serverName, parameters); } @@ -262,6 +311,22 @@ 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 Server detachVNet(ServerDetachVNetParameter parameters) { + return serviceManager.servers().detachVNet(resourceGroupName, serverName, parameters); + } + + public Server detachVNet(ServerDetachVNetParameter parameters, Context context) { + return serviceManager.servers().detachVNet(resourceGroupName, serverName, parameters, context); + } + public ServerImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -318,8 +383,13 @@ public ServerImpl withAdministratorLoginPassword(String administratorLoginPasswo } public ServerImpl withVersion(ServerVersion version) { - this.innerModel().withVersion(version); - return this; + if (isInCreateMode()) { + this.innerModel().withVersion(version); + return this; + } else { + this.updateParameters.withVersion(version); + return this; + } } public ServerImpl withAvailabilityZone(String availabilityZone) { @@ -362,6 +432,11 @@ public ServerImpl withDataEncryption(DataEncryption dataEncryption) { } } + public ServerImpl withDatabasePort(Integer databasePort) { + this.innerModel().withDatabasePort(databasePort); + return this; + } + public ServerImpl withStorage(Storage storage) { if (isInCreateMode()) { this.innerModel().withStorage(storage); @@ -393,7 +468,27 @@ public ServerImpl withHighAvailability(HighAvailability highAvailability) { } public ServerImpl withNetwork(Network network) { - this.innerModel().withNetwork(network); + if (isInCreateMode()) { + this.innerModel().withNetwork(network); + return this; + } else { + this.updateParameters.withNetwork(network); + return this; + } + } + + public ServerImpl withMaintenancePolicy(MaintenancePolicy maintenancePolicy) { + if (isInCreateMode()) { + this.innerModel().withMaintenancePolicy(maintenancePolicy); + return this; + } else { + this.updateParameters.withMaintenancePolicy(maintenancePolicy); + return this; + } + } + + public ServerImpl withImportSourceProperties(ImportSourceProperties importSourceProperties) { + this.innerModel().withImportSourceProperties(importSourceProperties); return this; } @@ -403,6 +498,6 @@ public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || 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 index 885a4c053a4b..54bcd2f911cd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -29,14 +29,18 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -70,52 +74,95 @@ public final class ServersClientImpl implements ServersClient { * The interface defining all the services for MySqlManagementClientServers to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientServers") public interface ServersService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("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) + Response getByResourceGroupSync(@HostParam("endpoint") 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); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") 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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServerInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServerInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServerForUpdate parameters, 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, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServerForUpdate parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerForUpdate parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") 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); + @PathParam("resourceGroupName") String resourceGroupName, @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, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @@ -124,53 +171,164 @@ Mono> listByResourceGroup(@HostParam("$host") String @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/flexibleServers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/flexibleServers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> failover(@HostParam("endpoint") 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); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failoverSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateEstimateHighAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateEstimateHighAvailability( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HighAvailabilityValidationEstimationInner parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateEstimateHighAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateEstimateHighAvailabilitySync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HighAvailabilityValidationEstimationInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ServerRestartParameter parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart(@HostParam("$host") String endpoint, + Response restartSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ServerRestartParameter parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("endpoint") 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" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Response startSync(@HostParam("endpoint") 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); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> stop(@HostParam("endpoint") 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); + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/stop") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response stopSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/resetGtid") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetGtid(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ServerGtidSetParameter parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/resetGtid") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resetGtidSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ServerGtidSetParameter parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/detachVNet") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> detachVNet(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServerDetachVNetParameter parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/detachVNet") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response detachVNetSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServerDetachVNetParameter parameters, 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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -178,57 +336,92 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * 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 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}. + * @return information about 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(); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String serverName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * 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) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerInner getByResourceGroup(String resourceGroupName, String serverName) { + return getByResourceGroupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); + } + /** * 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. @@ -236,31 +429,12 @@ private Mono>> createWithResponseAsync(String resource */ @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(); - } + ServerInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -272,14 +446,16 @@ private Mono>> createWithResponseAsync(String 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. + * @return represents a server along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String serverName, + ServerInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + Context.NONE); } /** @@ -292,16 +468,15 @@ private PollerFlux, ServerInner> beginCreateAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return represents a server along with {@link Response}. */ - @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); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String serverName, ServerInner parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context); } /** @@ -313,12 +488,14 @@ private PollerFlux, ServerInner> beginCreateAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the {@link PollerFlux} 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(); + 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()); } /** @@ -327,7 +504,6 @@ public SyncPoller, ServerInner> beginCreate(String resou * @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. @@ -335,8 +511,10 @@ public SyncPoller, ServerInner> beginCreate(String resou */ @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(); + ServerInner parameters) { + Response response = createWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + Context.NONE); } /** @@ -345,15 +523,18 @@ public SyncPoller, ServerInner> beginCreate(String resou * @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}. + * @return the {@link SyncPoller} for polling of represents a server. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, ServerInner parameters) { - return beginCreateAsync(resourceGroupName, serverName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerInner> beginCreate(String resourceGroupName, String serverName, + ServerInner parameters, Context context) { + Response response = createWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + context); } /** @@ -362,16 +543,14 @@ private Mono createAsync(String resourceGroupName, String serverNam * @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() + private Mono createAsync(String resourceGroupName, String serverName, ServerInner parameters) { + return beginCreateAsync(resourceGroupName, serverName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -388,7 +567,7 @@ private Mono createAsync(String resourceGroupName, String serverNam */ @ServiceMethod(returns = ReturnType.SINGLE) public ServerInner create(String resourceGroupName, String serverName, ServerInner parameters) { - return createAsync(resourceGroupName, serverName, parameters).block(); + return beginCreate(resourceGroupName, serverName, parameters).getFinalResult(); } /** @@ -405,7 +584,7 @@ public ServerInner create(String resourceGroupName, String serverName, ServerInn */ @ServiceMethod(returns = ReturnType.SINGLE) public ServerInner create(String resourceGroupName, String serverName, ServerInner parameters, Context context) { - return createAsync(resourceGroupName, serverName, parameters, context).block(); + return beginCreate(resourceGroupName, serverName, parameters, context).getFinalResult(); } /** @@ -423,30 +602,10 @@ public ServerInner create(String resourceGroupName, String serverName, ServerInn @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 contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -457,39 +616,19 @@ private Mono>> updateWithResponseAsync(String resource * @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}. + * @return represents a server along with {@link Response}. */ @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(); - } + private Response updateWithResponse(String resourceGroupName, String serverName, + ServerForUpdate parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + Context.NONE); } /** @@ -499,17 +638,19 @@ private Mono>> updateWithResponseAsync(String resource * @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. + * @return represents a server along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String serverName, + ServerForUpdate parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context); } /** @@ -519,7 +660,6 @@ private PollerFlux, ServerInner> beginUpdateAsync(String * @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. @@ -527,12 +667,10 @@ private PollerFlux, ServerInner> beginUpdateAsync(String */ @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); + String serverName, ServerForUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, serverName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerInner.class, ServerInner.class, context); + ServerInner.class, ServerInner.class, this.client.getContext()); } /** @@ -550,7 +688,9 @@ private PollerFlux, ServerInner> beginUpdateAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServerInner> beginUpdate(String resourceGroupName, String serverName, ServerForUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + Context.NONE); } /** @@ -569,7 +709,9 @@ public SyncPoller, ServerInner> beginUpdate(String resou @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(); + Response response = updateWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + context); } /** @@ -590,26 +732,6 @@ private Mono updateAsync(String resourceGroupName, String serverNam .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. @@ -624,7 +746,7 @@ private Mono updateAsync(String resourceGroupName, String serverNam */ @ServiceMethod(returns = ReturnType.SINGLE) public ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters) { - return updateAsync(resourceGroupName, serverName, parameters).block(); + return beginUpdate(resourceGroupName, serverName, parameters).getFinalResult(); } /** @@ -643,7 +765,7 @@ public ServerInner update(String resourceGroupName, String serverName, ServerFor @ServiceMethod(returns = ReturnType.SINGLE) public ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { - return updateAsync(resourceGroupName, serverName, parameters, context).block(); + return beginUpdate(resourceGroupName, serverName, parameters, context).getFinalResult(); } /** @@ -658,25 +780,9 @@ public ServerInner update(String resourceGroupName, String serverName, ServerFor */ @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 accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, serverName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -685,34 +791,15 @@ private Mono>> deleteWithResponseAsync(String resource * * @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}. + * @return the response body along with {@link Response}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String serverName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, Context.NONE); } /** @@ -720,16 +807,16 @@ private Mono>> deleteWithResponseAsync(String resource * * @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. + * @return the response body along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String serverName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, context); } /** @@ -737,19 +824,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @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); + 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, - context); + this.client.getContext()); } /** @@ -764,7 +848,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName) { - return this.beginDeleteAsync(resourceGroupName, serverName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, serverName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -781,7 +866,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, Context context) { - return this.beginDeleteAsync(resourceGroupName, serverName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, serverName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -804,16 +890,13 @@ private Mono deleteAsync(String resourceGroupName, String serverName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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); + public void delete(String resourceGroupName, String serverName) { + beginDelete(resourceGroupName, serverName).getFinalResult(); } /** @@ -821,553 +904,722 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Cont * * @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) { - deleteAsync(resourceGroupName, serverName).block(); + public void delete(String resourceGroupName, String serverName, Context context) { + beginDelete(resourceGroupName, serverName, context).getFinalResult(); } /** - * Deletes a server. + * List all the servers in a given resource group. * * @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 response of a Server list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, Context context) { - deleteAsync(resourceGroupName, serverName, context).block(); + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about a server. + * List all the servers in a given resource group. * * @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}. + * @return the response of a Server list operation 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Server list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets information about a server. + * List all the servers in a given resource group. * * @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}. + * @return the response of a Server list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets information about a server. + * List all the servers in a given resource group. * * @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}. + * @return the response of a Server list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String serverName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, serverName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Gets information about a server. + * List all the servers in a given resource group. * * @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}. + * @return the response of a Server list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * 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 the response of a Server list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String serverName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, serverName, context).block(); + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about a server. + * List all the servers in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Server list operation 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. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Server list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 information about a server. + * @return the response of a Server list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner getByResourceGroup(String resourceGroupName, String serverName) { - return getByResourceGroupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the servers in a given resource group. + * 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 the response of a Server list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(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 the response of a Server list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, 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 a list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} 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 accept = "application/json"; + private Mono>> failoverWithResponseAsync(String resourceGroupName, String serverName) { return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the servers in a given resource group. + * Manual failover a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @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 the response body along with {@link Response}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Response failoverWithResponse(String resourceGroupName, String serverName) { + return service.failoverSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, Context.NONE); } /** - * List all the servers in a given resource group. + * 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 list of servers as paginated response with {@link PagedFlux}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverWithResponse(String resourceGroupName, String serverName, Context context) { + return service.failoverSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, context); } /** - * List all the servers in a given resource group. + * Manual failover a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @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 the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @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()); } /** - * List all the servers in a given resource group. + * 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 list of servers as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String serverName) { + Response response = failoverWithResponse(resourceGroupName, serverName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * List all the servers in a given resource group. + * 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 list of servers as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String serverName, + Context context) { + Response response = failoverWithResponse(resourceGroupName, serverName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * List all the servers in a given subscription. + * 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 list of servers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono failoverAsync(String resourceGroupName, String serverName) { + return beginFailoverAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * List all the servers in a given subscription. + * Manual failover a server. * - * @param context The context to associate with this operation. + * @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}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + public void failover(String resourceGroupName, String serverName) { + beginFailover(resourceGroupName, serverName).getFinalResult(); } /** - * List all the servers in a given subscription. + * 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 list of servers as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void failover(String resourceGroupName, String serverName, Context context) { + beginFailover(resourceGroupName, serverName, context).getFinalResult(); } /** - * List all the servers in a given subscription. + * Validate a deployment of high availability. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedFlux}. + * @return high availability validation properties of a server along with {@link Response} on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateEstimateHighAvailabilityWithResponseAsync( + String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateEstimateHighAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the servers in a given subscription. + * Validate a deployment of high availability. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. + * @return high availability validation properties of a server on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateEstimateHighAvailabilityAsync( + String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters) { + return validateEstimateHighAvailabilityWithResponseAsync(resourceGroupName, serverName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all the servers in a given subscription. + * Validate a deployment of high availability. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers as paginated response with {@link PagedIterable}. + * @return high availability validation properties of a server along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateEstimateHighAvailabilityWithResponse( + String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateEstimateHighAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context); } /** - * Manual failover a server. + * Validate a deployment of high availability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HighAvailabilityValidationEstimationInner validateEstimateHighAvailability(String resourceGroupName, + String serverName, HighAvailabilityValidationEstimationInner parameters) { + return validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, Context.NONE) + .getValue(); + } + + /** + * Restarts a server. * * @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>> 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 accept = "application/json"; + private Mono>> restartWithResponseAsync(String resourceGroupName, String serverName, + ServerRestartParameter parameters) { + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Manual failover a server. + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response restartWithResponse(String resourceGroupName, String serverName, + ServerRestartParameter parameters) { + final String contentType = "application/json"; + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, parameters, Context.NONE); + } + + /** + * 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}. + * @return the response body along with {@link Response}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.failover(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); + private Response restartWithResponse(String resourceGroupName, String serverName, + ServerRestartParameter parameters, Context context) { + final String contentType = "application/json"; + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, parameters, context); } /** - * Manual failover a server. + * 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> beginFailoverAsync(String resourceGroupName, String serverName) { - Mono>> mono = failoverWithResponseAsync(resourceGroupName, serverName); + 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()); } /** - * Manual failover a server. + * 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) { + Response response = restartWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String serverName, + public SyncPoller, Void> beginRestart(String resourceGroupName, String serverName, + ServerRestartParameter parameters, Context context) { + Response response = restartWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + beginRestart(resourceGroupName, serverName, parameters).getFinalResult(); + } + + /** + * 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) { - context = this.client.mergeContext(context); - Mono>> mono = failoverWithResponseAsync(resourceGroupName, serverName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + beginRestart(resourceGroupName, serverName, parameters, context).getFinalResult(); + } + + /** + * 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) { + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String serverName) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, Context.NONE); + } + + /** + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String serverName, Context context) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, context); } /** - * Manual failover a server. + * 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. + * @return the {@link PollerFlux} 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(); + 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()); } /** - * Manual failover a server. + * 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> beginFailover(String resourceGroupName, String serverName, - Context context) { - return this.beginFailoverAsync(resourceGroupName, serverName, context).getSyncPoller(); + public SyncPoller, Void> beginStart(String resourceGroupName, String serverName) { + Response response = startWithResponse(resourceGroupName, serverName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Manual failover a server. + * 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono failoverAsync(String resourceGroupName, String serverName) { - return beginFailoverAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String serverName, Context context) { + Response response = startWithResponse(resourceGroupName, serverName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Manual failover a server. + * 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 failoverAsync(String resourceGroupName, String serverName, Context context) { - return beginFailoverAsync(resourceGroupName, serverName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono startAsync(String resourceGroupName, String serverName) { + return beginStartAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Manual failover a server. + * Starts a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -1376,12 +1628,12 @@ private Mono failoverAsync(String resourceGroupName, String serverName, Co * @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(); + public void start(String resourceGroupName, String serverName) { + beginStart(resourceGroupName, serverName).getFinalResult(); } /** - * Manual failover a server. + * Starts a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -1391,156 +1643,99 @@ public void failover(String resourceGroupName, String serverName) { * @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(); + public void start(String resourceGroupName, String serverName, Context context) { + beginStart(resourceGroupName, serverName, context).getFinalResult(); } /** - * Restarts a server. + * Stops 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 accept = "application/json"; + private Mono>> stopWithResponseAsync(String resourceGroupName, String serverName) { return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Restarts a server. + * Stops 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}. + * @return the response body along with {@link Response}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); + private Response stopWithResponse(String resourceGroupName, String serverName) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, Context.NONE); } /** - * Restarts a server. + * Stops 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. + * @return the response body along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response stopWithResponse(String resourceGroupName, String serverName, Context context) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, context); } /** - * Restarts a server. + * Stops 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); + 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, - context); + this.client.getContext()); } /** - * Restarts a server. + * Stops 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(); + public SyncPoller, Void> beginStop(String resourceGroupName, String serverName) { + Response response = stopWithResponse(resourceGroupName, serverName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Restarts a server. + * Stops 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. @@ -1548,205 +1743,158 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, * @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); + public SyncPoller, Void> beginStop(String resourceGroupName, String serverName, Context context) { + Response response = stopWithResponse(resourceGroupName, serverName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Restarts a server. + * Stops 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); + private Mono stopAsync(String resourceGroupName, String serverName) { + return beginStopAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Restarts a server. + * Stops 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(); + public void stop(String resourceGroupName, String serverName) { + beginStop(resourceGroupName, serverName).getFinalResult(); } /** - * Restarts a server. + * Stops 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(); + public void stop(String resourceGroupName, String serverName, Context context) { + beginStop(resourceGroupName, serverName, context).getFinalResult(); } /** - * Starts a server. + * 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>> 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 accept = "application/json"; + private Mono>> resetGtidWithResponseAsync(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters) { + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .withContext(context -> service.resetGtid(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Starts a server. + * 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 context The context to associate with this operation. + * @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}. + * @return the response body along with {@link Response}. */ @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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); + private Response resetGtidWithResponse(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters) { + final String contentType = "application/json"; + return service.resetGtidSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, parameters, Context.NONE); } /** - * Starts a server. + * 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. + * @return the response body along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resetGtidWithResponse(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters, Context context) { + final String contentType = "application/json"; + return service.resetGtidSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, parameters, context); } /** - * Starts a server. + * 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 context The context to associate with this operation. + * @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> beginStartAsync(String resourceGroupName, String serverName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, serverName, context); + 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, - context); + this.client.getContext()); } /** - * Starts a server. + * 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> beginStart(String resourceGroupName, String serverName) { - return this.beginStartAsync(resourceGroupName, serverName).getSyncPoller(); + public SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters) { + Response response = resetGtidWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Starts a server. + * 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. @@ -1754,197 +1902,170 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @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); + public SyncPoller, Void> beginResetGtid(String resourceGroupName, String serverName, + ServerGtidSetParameter parameters, Context context) { + Response response = resetGtidWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Starts a server. + * 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 context The context to associate with this operation. + * @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 startAsync(String resourceGroupName, String serverName, Context context) { - return beginStartAsync(resourceGroupName, serverName, context).last() + private Mono resetGtidAsync(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + return beginResetGtidAsync(resourceGroupName, serverName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Starts a server. + * 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 start(String resourceGroupName, String serverName) { - startAsync(resourceGroupName, serverName).block(); + public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + beginResetGtid(resourceGroupName, serverName, parameters).getFinalResult(); } /** - * Starts a server. + * 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 start(String resourceGroupName, String serverName, Context context) { - startAsync(resourceGroupName, serverName, context).block(); + public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, + Context context) { + beginResetGtid(resourceGroupName, serverName, parameters, context).getFinalResult(); } /** - * Stops a server. + * Detach VNet 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 detach vnet 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}. + * @return the response body along with {@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.")); - } + private Mono>> detachVNetWithResponseAsync(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .withContext(context -> service.detachVNet(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Stops a server. + * Detach VNet 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. + * @param parameters The required parameters for detach vnet 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}. + * @return the response body along with {@link Response}. */ @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.")); - } + private Response detachVNetWithResponse(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.stop(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); + return service.detachVNetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, + Context.NONE); } /** - * Stops a server. + * Detach VNet 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 detach vnet 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. + * @return the response body along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response detachVNetWithResponse(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.detachVNetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, contentType, accept, parameters, context); } /** - * Stops a server. + * Detach VNet 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. + * @param parameters The required parameters for detach vnet 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> 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); + private PollerFlux, ServerInner> beginDetachVNetAsync(String resourceGroupName, + String serverName, ServerDetachVNetParameter parameters) { + Mono>> mono = detachVNetWithResponseAsync(resourceGroupName, serverName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ServerInner.class, ServerInner.class, this.client.getContext()); } /** - * Stops a server. + * Detach VNet 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 detach vnet 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> beginStop(String resourceGroupName, String serverName) { - return this.beginStopAsync(resourceGroupName, serverName).getSyncPoller(); + public SyncPoller, ServerInner> beginDetachVNet(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters) { + Response response = detachVNetWithResponse(resourceGroupName, serverName, parameters); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + Context.NONE); } /** - * Stops a server. + * Detach VNet 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 detach vnet 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. @@ -1952,69 +2073,63 @@ public SyncPoller, Void> beginStop(String resourceGroupName, St * @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); + public SyncPoller, ServerInner> beginDetachVNet(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters, Context context) { + Response response = detachVNetWithResponse(resourceGroupName, serverName, parameters, context); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + context); } /** - * Stops a server. + * Detach VNet 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. + * @param parameters The required parameters for detach vnet 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. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String serverName, Context context) { - return beginStopAsync(resourceGroupName, serverName, context).last() + private Mono detachVNetAsync(String resourceGroupName, String serverName, + ServerDetachVNetParameter parameters) { + return beginDetachVNetAsync(resourceGroupName, serverName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Stops a server. + * Detach VNet 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 detach vnet 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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String serverName) { - stopAsync(resourceGroupName, serverName).block(); + public ServerInner detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters) { + return beginDetachVNet(resourceGroupName, serverName, parameters).getFinalResult(); } /** - * Stops a server. + * Detach VNet 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 detach vnet 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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String serverName, Context context) { - stopAsync(resourceGroupName, serverName, context).block(); + public ServerInner detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters, + Context context) { + return beginDetachVNet(resourceGroupName, serverName, parameters, context).getFinalResult(); } /** @@ -2024,17 +2139,11 @@ public void stop(String resourceGroupName, String serverName, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation 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( @@ -2044,6 +2153,24 @@ private Mono> listByResourceGroupNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Server list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2052,22 +2179,15 @@ private Mono> listByResourceGroupNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2077,17 +2197,11 @@ private Mono> listByResourceGroupNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation 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(), @@ -2095,6 +2209,24 @@ private Mono> listNextSinglePageAsync(String nextLink .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Server list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2103,21 +2235,13 @@ private Mono> listNextSinglePageAsync(String nextLink * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 the response of a Server list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java index bbfc5770775a..e95bc34f9753 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; @@ -10,8 +10,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; @@ -28,14 +32,6 @@ public ServersImpl(ServersClient 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 @@ -57,6 +53,14 @@ public Server getByResourceGroup(String resourceGroupName, String serverName) { } } + 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 PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); @@ -85,6 +89,30 @@ public void failover(String resourceGroupName, String serverName, Context contex this.serviceClient().failover(resourceGroupName, serverName, context); } + public Response validateEstimateHighAvailabilityWithResponse( + String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, + Context context) { + Response inner = this.serviceClient() + .validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HighAvailabilityValidationEstimationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HighAvailabilityValidationEstimation validateEstimateHighAvailability(String resourceGroupName, + String serverName, HighAvailabilityValidationEstimationInner parameters) { + HighAvailabilityValidationEstimationInner inner + = this.serviceClient().validateEstimateHighAvailability(resourceGroupName, serverName, parameters); + if (inner != null) { + return new HighAvailabilityValidationEstimationImpl(inner, this.manager()); + } else { + return null; + } + } + public void restart(String resourceGroupName, String serverName, ServerRestartParameter parameters) { this.serviceClient().restart(resourceGroupName, serverName, parameters); } @@ -110,6 +138,34 @@ 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 detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters) { + ServerInner inner = this.serviceClient().detachVNet(resourceGroupName, serverName, parameters); + if (inner != null) { + return new ServerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Server detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters, + Context context) { + ServerInner inner = this.serviceClient().detachVNet(resourceGroupName, serverName, parameters, context); + if (inner != null) { + return new ServerImpl(inner, this.manager()); + } else { + return null; + } + } + public Server getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java new file mode 100644 index 000000000000..1d49323c6b63 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ServersMigrationsClient. + */ +public final class ServersMigrationsClientImpl implements ServersMigrationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ServersMigrationsService service; + + /** + * The service client containing this operation class. + */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of ServersMigrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServersMigrationsClientImpl(MySqlManagementClientImpl client) { + this.service + = RestProxy.create(ServersMigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientServersMigrations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MySqlManagementClientServersMigrations") + public interface ServersMigrationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cutoverMigration(@HostParam("endpoint") 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}/cutoverMigration") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cutoverMigrationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverMigrationWithResponseAsync(String resourceGroupName, + String serverName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cutoverMigration(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cutoverMigrationWithResponse(String resourceGroupName, String serverName) { + final String accept = "application/json"; + return service.cutoverMigrationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, Context.NONE); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cutoverMigrationWithResponse(String resourceGroupName, String serverName, + Context context) { + final String accept = "application/json"; + return service.cutoverMigrationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerInner> beginCutoverMigrationAsync(String resourceGroupName, + String serverName) { + Mono>> mono = cutoverMigrationWithResponseAsync(resourceGroupName, serverName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ServerInner.class, ServerInner.class, this.client.getContext()); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, ServerInner> beginCutoverMigration(String resourceGroupName, + String serverName) { + Response response = cutoverMigrationWithResponse(resourceGroupName, serverName); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + Context.NONE); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, + String serverName, Context context) { + Response response = cutoverMigrationWithResponse(resourceGroupName, serverName, context); + return this.client.getLroResult(response, ServerInner.class, ServerInner.class, + context); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverMigrationAsync(String resourceGroupName, String serverName) { + return beginCutoverMigrationAsync(resourceGroupName, serverName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerInner cutoverMigration(String resourceGroupName, String serverName) { + return beginCutoverMigration(resourceGroupName, serverName).getFinalResult(); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context) { + return beginCutoverMigration(resourceGroupName, serverName, context).getFinalResult(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java new file mode 100644 index 000000000000..ce657cf80a81 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Server; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; + +public final class ServersMigrationsImpl implements ServersMigrations { + private static final ClientLogger LOGGER = new ClientLogger(ServersMigrationsImpl.class); + + private final ServersMigrationsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public ServersMigrationsImpl(ServersMigrationsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Server cutoverMigration(String resourceGroupName, String serverName) { + ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName); + if (inner != null) { + return new ServerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Server cutoverMigration(String resourceGroupName, String serverName, Context context) { + ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName, context); + if (inner != null) { + return new ServerImpl(inner, this.manager()); + } else { + return null; + } + } + + private ServersMigrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java new file mode 100644 index 000000000000..bb1eba3dfa90 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 index 82267a24aa0d..69f89040a2d3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.implementation; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdministratorListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdministratorListResult.java new file mode 100644 index 000000000000..05863868eefa --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdministratorListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; +import java.io.IOException; +import java.util.List; + +/** + * A List of azure ad administrators. + */ +@Immutable +public final class AdministratorListResult implements JsonSerializable { + /* + * The list of azure ad administrator of a server. + */ + private List value; + + /* + * The link used to get the next page of operations. + */ + private String nextLink; + + /** + * Creates an instance of AdministratorListResult class. + */ + private AdministratorListResult() { + } + + /** + * Get the value property: The list of azure ad administrator of a server. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdministratorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdministratorListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdministratorListResult. + */ + public static AdministratorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdministratorListResult deserializedAdministratorListResult = new AdministratorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AzureADAdministratorInner.fromJson(reader1)); + deserializedAdministratorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAdministratorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdministratorListResult; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdvancedThreatProtectionListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdvancedThreatProtectionListResult.java new file mode 100644 index 000000000000..10fcd08bb402 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdvancedThreatProtectionListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AdvancedThreatProtection list operation. + */ +@Immutable +public final class AdvancedThreatProtectionListResult implements JsonSerializable { + /* + * The AdvancedThreatProtection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AdvancedThreatProtectionListResult class. + */ + private AdvancedThreatProtectionListResult() { + } + + /** + * Get the value property: The AdvancedThreatProtection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedThreatProtectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedThreatProtectionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedThreatProtectionListResult. + */ + public static AdvancedThreatProtectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedThreatProtectionListResult deserializedAdvancedThreatProtectionListResult + = new AdvancedThreatProtectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AdvancedThreatProtectionInner.fromJson(reader1)); + deserializedAdvancedThreatProtectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAdvancedThreatProtectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedThreatProtectionListResult; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitiesListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitiesListResult.java similarity index 80% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitiesListResult.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitiesListResult.java index bae46184bede..0fdd4f3c75e6 100644 --- 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/implementation/models/CapabilitiesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.mysqlflexibleserver.models; +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -19,23 +19,23 @@ @Immutable public final class CapabilitiesListResult implements JsonSerializable { /* - * A list of supported capabilities. + * The CapabilityProperties items on this page */ private List value; /* - * Link to retrieve next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of CapabilitiesListResult class. */ - public CapabilitiesListResult() { + private CapabilitiesListResult() { } /** - * Get the value property: A list of supported capabilities. + * Get the value property: The CapabilityProperties items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link to retrieve next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +52,13 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitySetsList.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitySetsList.java new file mode 100644 index 000000000000..d788b38b9b33 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitySetsList.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import java.io.IOException; +import java.util.List; + +/** + * location capability set. + */ +@Immutable +public final class CapabilitySetsList implements JsonSerializable { + /* + * The CapabilitySetsList items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CapabilitySetsList class. + */ + private CapabilitySetsList() { + } + + /** + * Get the value property: The CapabilitySetsList items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitySetsList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitySetsList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilitySetsList. + */ + public static CapabilitySetsList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitySetsList deserializedCapabilitySetsList = new CapabilitySetsList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CapabilityInner.fromJson(reader1)); + deserializedCapabilitySetsList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCapabilitySetsList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitySetsList; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DatabaseListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/DatabaseListResult.java similarity index 64% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DatabaseListResult.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/DatabaseListResult.java index 41877b7fe8bf..b7c5db01974b 100644 --- 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/implementation/models/DatabaseListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.mysqlflexibleserver.models; +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * A List of databases. + * The response of a Database list operation. */ -@Fluent +@Immutable public final class DatabaseListResult implements JsonSerializable { /* - * The list of databases housed in a server + * The Database items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DatabaseListResult class. */ - public DatabaseListResult() { + private DatabaseListResult() { } /** - * Get the value property: The list of databases housed in a server. + * Get the value property: The Database items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ 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()); - } - } - /** * {@inheritDoc} */ 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/implementation/models/FirewallRuleListResult.java similarity index 66% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRuleListResult.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/FirewallRuleListResult.java index feb134ad1b1d..c2f73b2187c6 100644 --- 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/implementation/models/FirewallRuleListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.mysqlflexibleserver.models; +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * A list of firewall rules. + * The response of a FirewallRule list operation. */ -@Fluent +@Immutable public final class FirewallRuleListResult implements JsonSerializable { /* - * The list of firewall rules in a server. + * The FirewallRule items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of FirewallRuleListResult class. */ - public FirewallRuleListResult() { + private FirewallRuleListResult() { } /** - * Get the value property: The list of firewall rules in a server. + * Get the value property: The FirewallRule items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/LogFileListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/LogFileListResult.java new file mode 100644 index 000000000000..30cb2f772c48 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/LogFileListResult.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LogFile list operation. + */ +@Immutable +public final class LogFileListResult implements JsonSerializable { + /* + * The LogFile items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LogFileListResult class. + */ + private LogFileListResult() { + } + + /** + * Get the value property: The LogFile items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogFileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogFileListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogFileListResult. + */ + public static LogFileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogFileListResult deserializedLogFileListResult = new LogFileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LogFileInner.fromJson(reader1)); + deserializedLogFileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogFileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogFileListResult; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/MaintenanceListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/MaintenanceListResult.java new file mode 100644 index 000000000000..f7b5e752c6a3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/MaintenanceListResult.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Maintenance list operation. + */ +@Immutable +public final class MaintenanceListResult implements JsonSerializable { + /* + * The Maintenance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MaintenanceListResult class. + */ + private MaintenanceListResult() { + } + + /** + * Get the value property: The Maintenance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceListResult. + */ + public static MaintenanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceListResult deserializedMaintenanceListResult = new MaintenanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MaintenanceInner.fromJson(reader1)); + deserializedMaintenanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMaintenanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceListResult; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/OperationListResult.java similarity index 63% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationListResult.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/OperationListResult.java index cab6b642d751..70737d1e9050 100644 --- 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/implementation/models/OperationListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.mysqlflexibleserver.models; +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * A list of resource provider operations. + * The static parameters for a resource group based resource. */ -@Fluent +@Immutable public final class OperationListResult implements JsonSerializable { /* - * Collection of available operation details + * The Operation items on this page */ private List value; /* - * URL client should use to fetch the next page (per server side paging). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: Collection of available operation details. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List 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). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/PrivateLinkResourceListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..2914ced078e1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/PrivateLinkResourceListResult.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5. It has been + * deprecated for v6 and beyond. + * + * Note: This is only intended for use with versions before v6. Do not use this if you are already on + * CommonTypes.Version.v6 or beyond. + * + * If you are migrating to v6 or above, use `PrivateLinkResourceListResult` directly. + */ +@Immutable +public final class PrivateLinkResourceListResult implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + private PrivateLinkResourceListResult() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } +} 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/implementation/models/ServerBackupListResult.java similarity index 65% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupListResult.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerBackupListResult.java index 1682360ca871..ab73305fb84c 100644 --- 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/implementation/models/ServerBackupListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.mysqlflexibleserver.models; +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * A list of server backups. + * The response of a ServerBackup list operation. */ -@Fluent +@Immutable public final class ServerBackupListResult implements JsonSerializable { /* - * The list of backups of a server. + * The ServerBackup items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ServerBackupListResult class. */ - public ServerBackupListResult() { + private ServerBackupListResult() { } /** - * Get the value property: The list of backups of a server. + * Get the value property: The ServerBackup items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerBackupV2ListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerBackupV2ListResult.java new file mode 100644 index 000000000000..6170183bf6eb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerBackupV2ListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ServerBackupV2 list operation. + */ +@Immutable +public final class ServerBackupV2ListResult implements JsonSerializable { + /* + * The ServerBackupV2 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ServerBackupV2ListResult class. + */ + private ServerBackupV2ListResult() { + } + + /** + * Get the value property: The ServerBackupV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerBackupV2ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerBackupV2ListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerBackupV2ListResult. + */ + public static ServerBackupV2ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerBackupV2ListResult deserializedServerBackupV2ListResult = new ServerBackupV2ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServerBackupV2Inner.fromJson(reader1)); + deserializedServerBackupV2ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServerBackupV2ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerBackupV2ListResult; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerListResult.java similarity index 65% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerListResult.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerListResult.java index 25419d88ce09..2e7b91ed004e 100644 --- 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/implementation/models/ServerListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.mysqlflexibleserver.models; +package com.azure.resourcemanager.mysqlflexibleserver.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * A list of servers. + * The response of a Server list operation. */ -@Fluent +@Immutable public final class ServerListResult implements JsonSerializable { /* - * The list of servers + * The Server items on this page */ private List value; /* - * The link used to get the next page of operations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ServerListResult class. */ - public ServerListResult() { + private ServerListResult() { } /** - * Get the value property: The list of servers. + * Get the value property: The Server items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/package-info.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/package-info.java index 6b3ef9153d3e..d97585e8d88c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/package-info.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for MySqlManagementClient. + * Package containing the implementations for MySql. * 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. */ 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 new file mode 100644 index 000000000000..c448734431a4 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for AdministratorName. + */ +public final class AdministratorName extends ExpandableStringEnum { + /** + * Static value ActiveDirectory for AdministratorName. + */ + public static final AdministratorName ACTIVE_DIRECTORY = fromString("ActiveDirectory"); + + /** + * Creates a new instance of AdministratorName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdministratorName() { + } + + /** + * Creates or finds a AdministratorName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdministratorName. + */ + public static AdministratorName fromString(String name) { + return fromString(name, AdministratorName.class); + } + + /** + * Gets known AdministratorName values. + * + * @return known AdministratorName values. + */ + public static Collection values() { + return values(AdministratorName.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java new file mode 100644 index 000000000000..431b226bb050 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the sever administrator. + */ +public final class AdministratorType extends ExpandableStringEnum { + /** + * Static value ActiveDirectory for AdministratorType. + */ + public static final AdministratorType ACTIVE_DIRECTORY = fromString("ActiveDirectory"); + + /** + * Creates a new instance of AdministratorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdministratorType() { + } + + /** + * Creates or finds a AdministratorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdministratorType. + */ + public static AdministratorType fromString(String name) { + return fromString(name, AdministratorType.class); + } + + /** + * Gets known AdministratorType values. + * + * @return known AdministratorType values. + */ + public static Collection values() { + return values(AdministratorType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java new file mode 100644 index 000000000000..588b8d631702 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of AdvancedThreatProtection. + */ +public interface AdvancedThreatProtection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + AdvancedThreatProtectionState state(); + + /** + * Gets the provisioningState property: Provisioning state of the Threat Protection. + * + * @return the provisioningState value. + */ + AdvancedThreatProtectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner object. + * + * @return the inner object. + */ + AdvancedThreatProtectionInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java new file mode 100644 index 000000000000..acd942a2fef7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; +import java.io.IOException; + +/** + * Parameters allowed to update advanced threat protection for a server. + */ +@Fluent +public final class AdvancedThreatProtectionForUpdate implements JsonSerializable { + /* + * Resource update properties. + */ + private AdvancedThreatProtectionUpdateProperties innerProperties; + + /** + * Creates an instance of AdvancedThreatProtectionForUpdate class. + */ + public AdvancedThreatProtectionForUpdate() { + } + + /** + * Get the innerProperties property: Resource update properties. + * + * @return the innerProperties value. + */ + private AdvancedThreatProtectionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionForUpdate object itself. + */ + public AdvancedThreatProtectionForUpdate withState(AdvancedThreatProtectionState state) { + if (this.innerProperties() == null) { + this.innerProperties = new AdvancedThreatProtectionUpdateProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedThreatProtectionForUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedThreatProtectionForUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedThreatProtectionForUpdate. + */ + public static AdvancedThreatProtectionForUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedThreatProtectionForUpdate deserializedAdvancedThreatProtectionForUpdate + = new AdvancedThreatProtectionForUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAdvancedThreatProtectionForUpdate.innerProperties + = AdvancedThreatProtectionUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedThreatProtectionForUpdate; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java new file mode 100644 index 000000000000..3223eaea74e5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for AdvancedThreatProtectionName. + */ +public final class AdvancedThreatProtectionName extends ExpandableStringEnum { + /** + * Static value Default for AdvancedThreatProtectionName. + */ + public static final AdvancedThreatProtectionName DEFAULT = fromString("Default"); + + /** + * Creates a new instance of AdvancedThreatProtectionName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedThreatProtectionName() { + } + + /** + * Creates or finds a AdvancedThreatProtectionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedThreatProtectionName. + */ + public static AdvancedThreatProtectionName fromString(String name) { + return fromString(name, AdvancedThreatProtectionName.class); + } + + /** + * Gets known AdvancedThreatProtectionName values. + * + * @return known AdvancedThreatProtectionName values. + */ + public static Collection values() { + return values(AdvancedThreatProtectionName.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java new file mode 100644 index 000000000000..9bcf08e4b8e9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class AdvancedThreatProtectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for AdvancedThreatProtectionProvisioningState. + */ + public static final AdvancedThreatProtectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Updating for AdvancedThreatProtectionProvisioningState. + */ + public static final AdvancedThreatProtectionProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Canceled for AdvancedThreatProtectionProvisioningState. + */ + public static final AdvancedThreatProtectionProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for AdvancedThreatProtectionProvisioningState. + */ + public static final AdvancedThreatProtectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of AdvancedThreatProtectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedThreatProtectionProvisioningState() { + } + + /** + * Creates or finds a AdvancedThreatProtectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedThreatProtectionProvisioningState. + */ + public static AdvancedThreatProtectionProvisioningState fromString(String name) { + return fromString(name, AdvancedThreatProtectionProvisioningState.class); + } + + /** + * Gets known AdvancedThreatProtectionProvisioningState values. + * + * @return known AdvancedThreatProtectionProvisioningState values. + */ + public static Collection values() { + return values(AdvancedThreatProtectionProvisioningState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java new file mode 100644 index 000000000000..a67e041d4b7b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; + +/** + * Resource collection API of AdvancedThreatProtectionSettings. + */ +public interface AdvancedThreatProtectionSettings { + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, Context context); + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state. + */ + AdvancedThreatProtection get(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, + Context context); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + AdvancedThreatProtection update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + AdvancedThreatProtection update(String resourceGroupName, String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, + Context context); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java new file mode 100644 index 000000000000..6ebec1d94c0f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled on the server. + */ +public final class AdvancedThreatProtectionState extends ExpandableStringEnum { + /** + * Static value Enabled for AdvancedThreatProtectionState. + */ + public static final AdvancedThreatProtectionState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for AdvancedThreatProtectionState. + */ + public static final AdvancedThreatProtectionState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AdvancedThreatProtectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedThreatProtectionState() { + } + + /** + * Creates or finds a AdvancedThreatProtectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedThreatProtectionState. + */ + public static AdvancedThreatProtectionState fromString(String name) { + return fromString(name, AdvancedThreatProtectionState.class); + } + + /** + * Gets known AdvancedThreatProtectionState values. + * + * @return known AdvancedThreatProtectionState values. + */ + public static Collection values() { + return values(AdvancedThreatProtectionState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java new file mode 100644 index 000000000000..3bb8d0c86711 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; + +/** + * An immutable client-side representation of AzureADAdministrator. + */ +public interface AzureADAdministrator { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the administratorType property: Type of the sever administrator. + * + * @return the administratorType value. + */ + AdministratorType administratorType(); + + /** + * Gets the login property: Login name of the server administrator. + * + * @return the login value. + */ + String login(); + + /** + * Gets the sid property: SID (object ID) of the server administrator. + * + * @return the sid value. + */ + String sid(); + + /** + * Gets the tenantId property: Tenant ID of the administrator. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the identityResourceId property: The resource id of the identity used for AAD Authentication. + * + * @return the identityResourceId value. + */ + String identityResourceId(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner object. + * + * @return the inner object. + */ + AzureADAdministratorInner innerModel(); + + /** + * The entirety of the AzureADAdministrator definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AzureADAdministrator definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AzureADAdministrator definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AzureADAdministrator definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serverName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @return the next definition stage. + */ + WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the AzureADAdministrator definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithAdministratorType, DefinitionStages.WithLogin, + DefinitionStages.WithSid, DefinitionStages.WithTenantId, DefinitionStages.WithIdentityResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + AzureADAdministrator create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureADAdministrator create(Context context); + } + + /** + * The stage of the AzureADAdministrator definition allowing to specify administratorType. + */ + interface WithAdministratorType { + /** + * Specifies the administratorType property: Type of the sever administrator.. + * + * @param administratorType Type of the sever administrator. + * @return the next definition stage. + */ + WithCreate withAdministratorType(AdministratorType administratorType); + } + + /** + * The stage of the AzureADAdministrator definition allowing to specify login. + */ + interface WithLogin { + /** + * Specifies the login property: Login name of the server administrator.. + * + * @param login Login name of the server administrator. + * @return the next definition stage. + */ + WithCreate withLogin(String login); + } + + /** + * The stage of the AzureADAdministrator definition allowing to specify sid. + */ + interface WithSid { + /** + * Specifies the sid property: SID (object ID) of the server administrator.. + * + * @param sid SID (object ID) of the server administrator. + * @return the next definition stage. + */ + WithCreate withSid(String sid); + } + + /** + * The stage of the AzureADAdministrator definition allowing to specify tenantId. + */ + interface WithTenantId { + /** + * Specifies the tenantId property: Tenant ID of the administrator.. + * + * @param tenantId Tenant ID of the administrator. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + + /** + * The stage of the AzureADAdministrator definition allowing to specify identityResourceId. + */ + interface WithIdentityResourceId { + /** + * Specifies the identityResourceId property: The resource id of the identity used for AAD Authentication.. + * + * @param identityResourceId The resource id of the identity used for AAD Authentication. + * @return the next definition stage. + */ + WithCreate withIdentityResourceId(String identityResourceId); + } + } + + /** + * Begins update for the AzureADAdministrator resource. + * + * @return the stage of resource update. + */ + AzureADAdministrator.Update update(); + + /** + * The template for AzureADAdministrator update. + */ + interface Update extends UpdateStages.WithAdministratorType, UpdateStages.WithLogin, UpdateStages.WithSid, + UpdateStages.WithTenantId, UpdateStages.WithIdentityResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureADAdministrator apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureADAdministrator apply(Context context); + } + + /** + * The AzureADAdministrator update stages. + */ + interface UpdateStages { + /** + * The stage of the AzureADAdministrator update allowing to specify administratorType. + */ + interface WithAdministratorType { + /** + * Specifies the administratorType property: Type of the sever administrator.. + * + * @param administratorType Type of the sever administrator. + * @return the next definition stage. + */ + Update withAdministratorType(AdministratorType administratorType); + } + + /** + * The stage of the AzureADAdministrator update allowing to specify login. + */ + interface WithLogin { + /** + * Specifies the login property: Login name of the server administrator.. + * + * @param login Login name of the server administrator. + * @return the next definition stage. + */ + Update withLogin(String login); + } + + /** + * The stage of the AzureADAdministrator update allowing to specify sid. + */ + interface WithSid { + /** + * Specifies the sid property: SID (object ID) of the server administrator.. + * + * @param sid SID (object ID) of the server administrator. + * @return the next definition stage. + */ + Update withSid(String sid); + } + + /** + * The stage of the AzureADAdministrator update allowing to specify tenantId. + */ + interface WithTenantId { + /** + * Specifies the tenantId property: Tenant ID of the administrator.. + * + * @param tenantId Tenant ID of the administrator. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + + /** + * The stage of the AzureADAdministrator update allowing to specify identityResourceId. + */ + interface WithIdentityResourceId { + /** + * Specifies the identityResourceId property: The resource id of the identity used for AAD Authentication.. + * + * @param identityResourceId The resource id of the identity used for AAD Authentication. + * @return the next definition stage. + */ + Update withIdentityResourceId(String identityResourceId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureADAdministrator refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureADAdministrator refresh(Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java new file mode 100644 index 000000000000..832e8ff25d3b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 { + /** + * 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); + + /** + * 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); + + /** + * List all the AAD administrators in a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a List of azure ad administrators as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * List all the AAD administrators in a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a List of azure ad administrators as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + + /** + * Gets information about an azure ad administrator. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an azure ad administrator along with {@link Response}. + */ + AzureADAdministrator getById(String id); + + /** + * Gets information about an azure ad administrator. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an azure ad administrator along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Azure AD Administrator. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an Azure AD Administrator. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AzureADAdministrator resource. + * + * @param name resource name. + * @return the first stage of the new AzureADAdministrator definition. + */ + AzureADAdministrator.DefinitionStages.Blank define(AdministratorName name); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java index 236dec961dcd..09352cab50af 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -23,6 +23,11 @@ public final class Backup implements JsonSerializable { */ private Integer backupRetentionDays; + /* + * Backup interval hours for the server. + */ + private Integer backupIntervalHours; + /* * Whether or not geo redundant backup is enabled. */ @@ -59,6 +64,26 @@ public Backup withBackupRetentionDays(Integer backupRetentionDays) { return this; } + /** + * Get the backupIntervalHours property: Backup interval hours for the server. + * + * @return the backupIntervalHours value. + */ + public Integer backupIntervalHours() { + return this.backupIntervalHours; + } + + /** + * Set the backupIntervalHours property: Backup interval hours for the server. + * + * @param backupIntervalHours the backupIntervalHours value to set. + * @return the Backup object itself. + */ + public Backup withBackupIntervalHours(Integer backupIntervalHours) { + this.backupIntervalHours = backupIntervalHours; + return this; + } + /** * Get the geoRedundantBackup property: Whether or not geo redundant backup is enabled. * @@ -88,14 +113,6 @@ public OffsetDateTime earliestRestoreDate() { return this.earliestRestoreDate; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -103,6 +120,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("backupRetentionDays", this.backupRetentionDays); + jsonWriter.writeNumberField("backupIntervalHours", this.backupIntervalHours); jsonWriter.writeStringField("geoRedundantBackup", this.geoRedundantBackup == null ? null : this.geoRedundantBackup.toString()); return jsonWriter.writeEndObject(); @@ -125,6 +143,8 @@ public static Backup fromJson(JsonReader jsonReader) throws IOException { if ("backupRetentionDays".equals(fieldName)) { deserializedBackup.backupRetentionDays = reader.getNullable(JsonReader::getInt); + } else if ("backupIntervalHours".equals(fieldName)) { + deserializedBackup.backupIntervalHours = reader.getNullable(JsonReader::getInt); } else if ("geoRedundantBackup".equals(fieldName)) { deserializedBackup.geoRedundantBackup = EnableStatusEnum.fromString(reader.getString()); } else if ("earliestRestoreDate".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java new file mode 100644 index 000000000000..54f2ace6d4dc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BackupAndExport API Request. + */ +@Fluent +public final class BackupAndExportRequest extends BackupRequestBase { + /* + * Backup Target Store Details + */ + private BackupStoreDetails targetDetails; + + /** + * Creates an instance of BackupAndExportRequest class. + */ + public BackupAndExportRequest() { + } + + /** + * Get the targetDetails property: Backup Target Store Details. + * + * @return the targetDetails value. + */ + public BackupStoreDetails targetDetails() { + return this.targetDetails; + } + + /** + * Set the targetDetails property: Backup Target Store Details. + * + * @param targetDetails the targetDetails value to set. + * @return the BackupAndExportRequest object itself. + */ + public BackupAndExportRequest withTargetDetails(BackupStoreDetails targetDetails) { + this.targetDetails = targetDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public BackupAndExportRequest withBackupSettings(BackupSettings backupSettings) { + super.withBackupSettings(backupSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backupSettings", backupSettings()); + jsonWriter.writeJsonField("targetDetails", this.targetDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupAndExportRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupAndExportRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BackupAndExportRequest. + */ + public static BackupAndExportRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupAndExportRequest deserializedBackupAndExportRequest = new BackupAndExportRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupSettings".equals(fieldName)) { + deserializedBackupAndExportRequest.withBackupSettings(BackupSettings.fromJson(reader)); + } else if ("targetDetails".equals(fieldName)) { + deserializedBackupAndExportRequest.targetDetails = BackupStoreDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupAndExportRequest; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java new file mode 100644 index 000000000000..878bf598046c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of BackupAndExportResponse. + */ +public interface BackupAndExportResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the error property: The error object. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the name property: The name of the backup and export response. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: The operation status. + * + * @return the status value. + */ + OperationStatus status(); + + /** + * Gets the startTime property: Start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: Operation progress (0-100). + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + Long datasourceSizeInBytes(); + + /** + * Gets the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + Long dataTransferredInBytes(); + + /** + * Gets the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value + * pairs. + * + * @return the backupMetadata value. + */ + String backupMetadata(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner object. + * + * @return the inner object. + */ + BackupAndExportResponseInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java new file mode 100644 index 000000000000..fdc36a2ce647 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BackupAndExport Response Properties. + */ +@Immutable +public final class BackupAndExportResponseType extends OperationProgressResponseType { + /* + * Identifies the type of source operation + */ + private ObjectType objectType = ObjectType.BACKUP_AND_EXPORT_RESPONSE; + + /* + * Size of datasource in bytes + */ + private Long datasourceSizeInBytes; + + /* + * Data transferred in bytes + */ + private Long dataTransferredInBytes; + + /* + * Metadata related to backup to be stored for restoring resource in key-value pairs. + */ + private String backupMetadata; + + /** + * Creates an instance of BackupAndExportResponseType class. + */ + private BackupAndExportResponseType() { + } + + /** + * Get the objectType property: Identifies the type of source operation. + * + * @return the objectType value. + */ + @Override + public ObjectType objectType() { + return this.objectType; + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.datasourceSizeInBytes; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.dataTransferredInBytes; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); + jsonWriter.writeNumberField("datasourceSizeInBytes", this.datasourceSizeInBytes); + jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); + jsonWriter.writeStringField("backupMetadata", this.backupMetadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupAndExportResponseType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupAndExportResponseType if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupAndExportResponseType. + */ + public static BackupAndExportResponseType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupAndExportResponseType deserializedBackupAndExportResponseType = new BackupAndExportResponseType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedBackupAndExportResponseType.objectType = ObjectType.fromString(reader.getString()); + } else if ("datasourceSizeInBytes".equals(fieldName)) { + deserializedBackupAndExportResponseType.datasourceSizeInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("dataTransferredInBytes".equals(fieldName)) { + deserializedBackupAndExportResponseType.dataTransferredInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("backupMetadata".equals(fieldName)) { + deserializedBackupAndExportResponseType.backupMetadata = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupAndExportResponseType; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java new file mode 100644 index 000000000000..d72395c45604 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupAndExports. + */ +public interface BackupAndExports { + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters, + Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response}. + */ + Response validateBackupWithResponse(String resourceGroupName, String serverName, + Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response. + */ + ValidateBackupResponse validateBackup(String resourceGroupName, String serverName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java new file mode 100644 index 000000000000..cc5c10645e53 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). + */ +public final class BackupFormat extends ExpandableStringEnum { + /** + * Static value CollatedFormat for BackupFormat. + */ + public static final BackupFormat COLLATED_FORMAT = fromString("CollatedFormat"); + + /** + * Static value Raw for BackupFormat. + */ + public static final BackupFormat RAW = fromString("Raw"); + + /** + * Creates a new instance of BackupFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupFormat() { + } + + /** + * Creates or finds a BackupFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupFormat. + */ + public static BackupFormat fromString(String name) { + return fromString(name, BackupFormat.class); + } + + /** + * Gets known BackupFormat values. + * + * @return known BackupFormat values. + */ + public static Collection values() { + return values(BackupFormat.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java new file mode 100644 index 000000000000..f3e9e0a1bdb1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BackupRequestBase is the base for all backup request. + */ +@Fluent +public class BackupRequestBase implements JsonSerializable { + /* + * Backup Settings + */ + private BackupSettings backupSettings; + + /** + * Creates an instance of BackupRequestBase class. + */ + public BackupRequestBase() { + } + + /** + * Get the backupSettings property: Backup Settings. + * + * @return the backupSettings value. + */ + public BackupSettings backupSettings() { + return this.backupSettings; + } + + /** + * Set the backupSettings property: Backup Settings. + * + * @param backupSettings the backupSettings value to set. + * @return the BackupRequestBase object itself. + */ + public BackupRequestBase withBackupSettings(BackupSettings backupSettings) { + this.backupSettings = backupSettings; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backupSettings", this.backupSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupRequestBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupRequestBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BackupRequestBase. + */ + public static BackupRequestBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupRequestBase deserializedBackupRequestBase = new BackupRequestBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupSettings".equals(fieldName)) { + deserializedBackupRequestBase.backupSettings = BackupSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupRequestBase; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java new file mode 100644 index 000000000000..0569d481d77c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Backup Settings. + */ +@Fluent +public final class BackupSettings implements JsonSerializable { + /* + * The name of the backup. + */ + private String backupName; + + /* + * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE) + */ + private BackupFormat backupFormat; + + /** + * Creates an instance of BackupSettings class. + */ + public BackupSettings() { + } + + /** + * Get the backupName property: The name of the backup. + * + * @return the backupName value. + */ + public String backupName() { + return this.backupName; + } + + /** + * Set the backupName property: The name of the backup. + * + * @param backupName the backupName value to set. + * @return the BackupSettings object itself. + */ + public BackupSettings withBackupName(String backupName) { + this.backupName = backupName; + return this; + } + + /** + * Get the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). + * + * @return the backupFormat value. + */ + public BackupFormat backupFormat() { + return this.backupFormat; + } + + /** + * Set the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). + * + * @param backupFormat the backupFormat value to set. + * @return the BackupSettings object itself. + */ + public BackupSettings withBackupFormat(BackupFormat backupFormat) { + this.backupFormat = backupFormat; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupName", this.backupName); + jsonWriter.writeStringField("backupFormat", this.backupFormat == null ? null : this.backupFormat.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BackupSettings. + */ + public static BackupSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupSettings deserializedBackupSettings = new BackupSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupName".equals(fieldName)) { + deserializedBackupSettings.backupName = reader.getString(); + } else if ("backupFormat".equals(fieldName)) { + deserializedBackupSettings.backupFormat = BackupFormat.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupSettings; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java new file mode 100644 index 000000000000..fb2084a6e29e --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details about the target where the backup content will be stored. + */ +@Immutable +public class BackupStoreDetails implements JsonSerializable { + /* + * Type of the specific object - used for deserializing + */ + private String objectType = "BackupStoreDetails"; + + /** + * Creates an instance of BackupStoreDetails class. + */ + public BackupStoreDetails() { + } + + /** + * Get the objectType property: Type of the specific object - used for deserializing. + * + * @return the objectType value. + */ + public String objectType() { + return this.objectType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupStoreDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupStoreDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupStoreDetails. + */ + public static BackupStoreDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("objectType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FullBackupStoreDetails".equals(discriminatorValue)) { + return FullBackupStoreDetails.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BackupStoreDetails fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupStoreDetails deserializedBackupStoreDetails = new BackupStoreDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedBackupStoreDetails.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupStoreDetails; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java new file mode 100644 index 000000000000..44ddf80a80d3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for BackupType. + */ +public final class BackupType extends ExpandableStringEnum { + /** + * Static value FULL for BackupType. + */ + public static final BackupType FULL = fromString("FULL"); + + /** + * Creates a new instance of BackupType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupType() { + } + + /** + * Creates or finds a BackupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupType. + */ + public static BackupType fromString(String name) { + return fromString(name, BackupType.class); + } + + /** + * Gets known BackupType values. + * + * @return known BackupType values. + */ + public static Collection values() { + return values(BackupType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java index 45ff69d4c2ab..7ed8f0025c4f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -40,6 +40,34 @@ Response getWithResponse(String resourceGroupName, String serverNa */ ServerBackup get(String resourceGroupName, String serverName, String backupName); + /** + * Create backup for a given server with specified backup name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. * @@ -48,7 +76,7 @@ Response getWithResponse(String resourceGroupName, String serverNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation as paginated response with {@link PagedIterable}. */ PagedIterable listByServer(String resourceGroupName, String serverName); @@ -61,7 +89,7 @@ Response getWithResponse(String resourceGroupName, String serverNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a ServerBackup list operation 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/BatchOfMaintenance.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BatchOfMaintenance.java new file mode 100644 index 000000000000..266dd658fae6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BatchOfMaintenance.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The batch of maintenance when enabled the custom managed maintenance window of a server. + */ +public final class BatchOfMaintenance extends ExpandableStringEnum { + /** + * Static value Default for BatchOfMaintenance. + */ + public static final BatchOfMaintenance DEFAULT = fromString("Default"); + + /** + * Static value Batch1 for BatchOfMaintenance. + */ + public static final BatchOfMaintenance BATCH1 = fromString("Batch1"); + + /** + * Static value Batch2 for BatchOfMaintenance. + */ + public static final BatchOfMaintenance BATCH2 = fromString("Batch2"); + + /** + * Creates a new instance of BatchOfMaintenance value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BatchOfMaintenance() { + } + + /** + * Creates or finds a BatchOfMaintenance from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchOfMaintenance. + */ + public static BatchOfMaintenance fromString(String name) { + return fromString(name, BatchOfMaintenance.class); + } + + /** + * Gets known BatchOfMaintenance values. + * + * @return known BatchOfMaintenance values. + */ + public static Collection values() { + return values(BatchOfMaintenance.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java new file mode 100644 index 000000000000..9848cfb6f61c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import java.util.List; + +/** + * An immutable client-side representation of Capability. + */ +public interface Capability { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the supportedGeoBackupRegions property: supported geo backup regions. + * + * @return the supportedGeoBackupRegions value. + */ + List supportedGeoBackupRegions(); + + /** + * Gets the supportedFlexibleServerEditions property: A list of supported flexible server editions. + * + * @return the supportedFlexibleServerEditions value. + */ + List supportedFlexibleServerEditions(); + + /** + * Gets the supportedServerVersions property: A list of supported server versions. + * + * @return the supportedServerVersions value. + */ + List supportedServerVersions(); + + /** + * Gets the supportedFeatures property: A list of supported features. + * + * @return the supportedFeatures value. + */ + List supportedFeatures(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner object. + * + * @return the inner object. + */ + CapabilityInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilityProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilityProperties.java index 6debbda0e46c..f84778cabf99 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 3c9d085474b6..bc6fdd48a866 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -15,7 +15,7 @@ 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 nameAvailabilityRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -29,7 +29,7 @@ Response executeWithResponse(String locationName, NameAvailabi * 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 nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index e37919abb832..da8ebcb72621 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -14,7 +14,7 @@ public interface CheckNameAvailabilityWithoutLocations { /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -26,7 +26,7 @@ public interface CheckNameAvailabilityWithoutLocations { /** * Check the availability of name for server. * - * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param nameAvailabilityRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. 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 index ba51e14d2592..c1e782d99129 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -15,7 +15,7 @@ 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 parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -29,7 +29,7 @@ Response executeWithResponse(String locationNam * 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 parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java index 037b36f883c1..f401b446dfc7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; /** @@ -33,7 +34,7 @@ public interface Configuration { 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. */ @@ -46,6 +47,13 @@ public interface Configuration { */ String value(); + /** + * Gets the currentValue property: Current value of the configuration. + * + * @return the currentValue value. + */ + String currentValue(); + /** * Gets the description property: Description of the configuration. * @@ -53,6 +61,13 @@ public interface Configuration { */ String description(); + /** + * Gets the documentationLink property: The link used to get the document from community or Azure site. + * + * @return the documentationLink value. + */ + String documentationLink(); + /** * Gets the defaultValue property: Default value of the configuration. * @@ -102,10 +117,196 @@ public interface Configuration { */ IsDynamicConfig isDynamicConfig(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner object. * * @return the inner object. */ ConfigurationInner innerModel(); + + /** + * The entirety of the Configuration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Configuration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Configuration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Configuration definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serverName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @return the next definition stage. + */ + WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the Configuration definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithValue, DefinitionStages.WithCurrentValue, DefinitionStages.WithSource { + /** + * Executes the create request. + * + * @return the created resource. + */ + Configuration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Configuration create(Context context); + } + + /** + * The stage of the Configuration definition allowing to specify value. + */ + interface WithValue { + /** + * Specifies the value property: Value of the configuration.. + * + * @param value Value of the configuration. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + + /** + * The stage of the Configuration definition allowing to specify currentValue. + */ + interface WithCurrentValue { + /** + * Specifies the currentValue property: Current value of the configuration.. + * + * @param currentValue Current value of the configuration. + * @return the next definition stage. + */ + WithCreate withCurrentValue(String currentValue); + } + + /** + * The stage of the Configuration definition allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: Source of the configuration.. + * + * @param source Source of the configuration. + * @return the next definition stage. + */ + WithCreate withSource(ConfigurationSource source); + } + } + + /** + * Begins update for the Configuration resource. + * + * @return the stage of resource update. + */ + Configuration.Update update(); + + /** + * The template for Configuration update. + */ + interface Update extends UpdateStages.WithValue, UpdateStages.WithCurrentValue, UpdateStages.WithSource { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Configuration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Configuration apply(Context context); + } + + /** + * The Configuration update stages. + */ + interface UpdateStages { + /** + * The stage of the Configuration update allowing to specify value. + */ + interface WithValue { + /** + * Specifies the value property: Value of the configuration.. + * + * @param value Value of the configuration. + * @return the next definition stage. + */ + Update withValue(String value); + } + + /** + * The stage of the Configuration update allowing to specify currentValue. + */ + interface WithCurrentValue { + /** + * Specifies the currentValue property: Current value of the configuration.. + * + * @param currentValue Current value of the configuration. + * @return the next definition stage. + */ + Update withCurrentValue(String currentValue); + } + + /** + * The stage of the Configuration update allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: Source of the configuration.. + * + * @param source Source of the configuration. + * @return the next definition stage. + */ + Update withSource(ConfigurationSource source); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Configuration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Configuration refresh(Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationForBatchUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationForBatchUpdate.java index e605003c7728..267da100d926 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -108,17 +108,6 @@ public ConfigurationForBatchUpdate withSource(String source) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java index 054b7f696f03..5ba040213af7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -22,6 +22,11 @@ public final class ConfigurationListForBatchUpdate implements JsonSerializable value; + /* + * Whether to reset all server parameters to default. + */ + private ResetAllToDefault resetAllToDefault; + /** * Creates an instance of ConfigurationListForBatchUpdate class. */ @@ -49,14 +54,23 @@ public ConfigurationListForBatchUpdate withValue(List e.validate()); - } + public ConfigurationListForBatchUpdate withResetAllToDefault(ResetAllToDefault resetAllToDefault) { + this.resetAllToDefault = resetAllToDefault; + return this; } /** @@ -66,6 +80,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resetAllToDefault", + this.resetAllToDefault == null ? null : this.resetAllToDefault.toString()); return jsonWriter.writeEndObject(); } @@ -89,6 +105,9 @@ public static ConfigurationListForBatchUpdate fromJson(JsonReader jsonReader) th List value = reader.readArray(reader1 -> ConfigurationForBatchUpdate.fromJson(reader1)); deserializedConfigurationListForBatchUpdate.value = value; + } else if ("resetAllToDefault".equals(fieldName)) { + deserializedConfigurationListForBatchUpdate.resetAllToDefault + = ResetAllToDefault.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListResult.java index 0fd3e2390851..00d6feb75cc0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -12,14 +12,14 @@ */ public interface ConfigurationListResult { /** - * Gets the value property: The list of server configurations. + * Gets the value property: The Configuration items on this page. * * @return the value value. */ List value(); /** - * Gets the nextLink property: The link used to get the next page of operations. + * Gets the nextLink property: The link to the next page of items. * * @return the nextLink value. */ 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 index b68a3da2feb4..e7ad1aeabe06 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java index 51959fa6fc4f..fa343ff48bb6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java @@ -1,76 +1,74 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** * Resource collection API of Configurations. */ public interface Configurations { /** - * Updates a configuration of a server. + * 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 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. + * @return information about a configuration of server along with {@link Response}. */ - Configuration update(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters); + Response getWithResponse(String resourceGroupName, String serverName, String configurationName, + Context context); /** - * Updates a configuration of a server. + * 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 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. + * @return information about a configuration of server. */ - Configuration update(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters, Context context); + Configuration get(String resourceGroupName, String serverName, String configurationName); /** - * Gets information about a configuration of server. + * 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 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}. + * @return the response of a Configuration list operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String serverName, String configurationName, - Context context); + PagedIterable listByServer(String resourceGroupName, String serverName); /** - * Gets information about a configuration of server. + * 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 configurationName The name of the server configuration. + * @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 information about a configuration of server. + * @return the response of a Configuration list operation as paginated response with {@link PagedIterable}. */ - Configuration get(String resourceGroupName, String serverName, String configurationName); + PagedIterable listByServer(String resourceGroupName, String serverName, String tags, String keyword, + Integer page, Integer pageSize, Context context); /** * Update a list of configurations in a given server. @@ -81,7 +79,7 @@ Response getWithResponse(String resourceGroupName, String serverN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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. + * @return the response of a Configuration list operation. */ ConfigurationListResult batchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters); @@ -96,33 +94,39 @@ ConfigurationListResult batchUpdate(String resourceGroupName, String serverName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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. + * @return the response of a Configuration list operation. */ ConfigurationListResult batchUpdate(String resourceGroupName, String serverName, ConfigurationListForBatchUpdate parameters, Context context); /** - * List all the configurations in a given server. + * 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 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 a list of server configurations as paginated response with {@link PagedIterable}. + * @return information about a configuration of server along with {@link Response}. */ - PagedIterable listByServer(String resourceGroupName, String serverName); + Configuration getById(String id); /** - * List all the configurations in a given server. + * 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 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 a list of server configurations as paginated response with {@link PagedIterable}. + * @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. */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + 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 index 68be9ae4c82c..5f47eb5e3115 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 82125e087399..8ded9ac14827 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -151,14 +151,6 @@ public DataEncryption withType(DataEncryptionType type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index a7e37eaa27a6..d8d99dd30190 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java index d65974e46049..cc11da2a22a6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -34,7 +34,7 @@ public interface Database { 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. */ 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 index 42a17cc4ef28..2d53f2e66ffb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -13,57 +13,57 @@ */ public interface Databases { /** - * Deletes a database. + * 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}. */ - void delete(String resourceGroupName, String serverName, String databaseName); + Response getWithResponse(String resourceGroupName, String serverName, String databaseName, + Context context); /** - * Deletes a database. + * 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. */ - void delete(String resourceGroupName, String serverName, String databaseName, Context context); + Database get(String resourceGroupName, String serverName, String databaseName); /** - * Gets information about a database. + * 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 information about a database along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String serverName, String databaseName, - Context context); + void delete(String resourceGroupName, String serverName, String databaseName); /** - * Gets information about a database. + * 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 information about a database. */ - Database get(String resourceGroupName, String serverName, String databaseName); + void delete(String resourceGroupName, String serverName, String databaseName, Context context); /** * List all the databases in a given server. @@ -73,7 +73,7 @@ Response getWithResponse(String resourceGroupName, String serverName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a Database list operation as paginated response with {@link PagedIterable}. */ PagedIterable listByServer(String resourceGroupName, String serverName); @@ -86,7 +86,7 @@ Response getWithResponse(String resourceGroupName, String serverName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @return the response of a Database list operation 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/DelegatedSubnetUsage.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DelegatedSubnetUsage.java index 4a9bff287e71..3a96ceccbe2f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -29,7 +29,7 @@ public final class DelegatedSubnetUsage implements JsonSerializable { + /* + * feature name + */ + private String featureName; + + /* + * feature value + */ + private String featureValue; + + /** + * Creates an instance of FeatureProperty class. + */ + private FeatureProperty() { + } + + /** + * Get the featureName property: feature name. + * + * @return the featureName value. + */ + public String featureName() { + return this.featureName; + } + + /** + * Get the featureValue property: feature value. + * + * @return the featureValue value. + */ + public String featureValue() { + return this.featureValue; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureProperty if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FeatureProperty. + */ + public static FeatureProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureProperty deserializedFeatureProperty = new FeatureProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("featureName".equals(fieldName)) { + deserializedFeatureProperty.featureName = reader.getString(); + } else if ("featureValue".equals(fieldName)) { + deserializedFeatureProperty.featureValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureProperty; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java index 06e69bb6c505..b2c1358f6a87 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -34,7 +34,7 @@ public interface FirewallRule { 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. */ 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/FirewallRules.java index cdf7ff6d7394..3d1be923c325 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/FirewallRules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -13,57 +13,57 @@ */ public interface FirewallRules { /** - * Deletes a firewall rule. + * 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 com.azure.core.management.exception.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}. */ - void delete(String resourceGroupName, String serverName, String firewallRuleName); + Response getWithResponse(String resourceGroupName, String serverName, String firewallRuleName, + Context context); /** - * Deletes a firewall rule. + * 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 com.azure.core.management.exception.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. */ - void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context); + FirewallRule get(String resourceGroupName, String serverName, String firewallRuleName); /** - * Gets information about a server firewall rule. + * Deletes a 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 com.azure.core.management.exception.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 firewallRuleName); /** - * Gets information about a server firewall rule. + * Deletes a 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 com.azure.core.management.exception.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 firewallRuleName, Context context); /** * List all the firewall rules in a given server. @@ -73,7 +73,7 @@ Response getWithResponse(String resourceGroupName, String serverNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a FirewallRule list operation as paginated response with {@link PagedIterable}. */ PagedIterable listByServer(String resourceGroupName, String serverName); @@ -86,7 +86,7 @@ Response getWithResponse(String resourceGroupName, String serverNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a FirewallRule list operation 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/FullBackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java new file mode 100644 index 000000000000..0b78eb55fda3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination. + */ +@Fluent +public final class FullBackupStoreDetails extends BackupStoreDetails { + /* + * Type of the specific object - used for deserializing + */ + private String objectType = "FullBackupStoreDetails"; + + /* + * SASUriList of storage containers where backup data is to be streamed/copied. + */ + private List sasUriList; + + /** + * Creates an instance of FullBackupStoreDetails class. + */ + public FullBackupStoreDetails() { + } + + /** + * Get the objectType property: Type of the specific object - used for deserializing. + * + * @return the objectType value. + */ + @Override + public String objectType() { + return this.objectType; + } + + /** + * Get the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. + * + * @return the sasUriList value. + */ + public List sasUriList() { + return this.sasUriList; + } + + /** + * Set the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. + * + * @param sasUriList the sasUriList value to set. + * @return the FullBackupStoreDetails object itself. + */ + public FullBackupStoreDetails withSasUriList(List sasUriList) { + this.sasUriList = sasUriList; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sasUriList", this.sasUriList, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("objectType", this.objectType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FullBackupStoreDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FullBackupStoreDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FullBackupStoreDetails. + */ + public static FullBackupStoreDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FullBackupStoreDetails deserializedFullBackupStoreDetails = new FullBackupStoreDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUriList".equals(fieldName)) { + List sasUriList = reader.readArray(reader1 -> reader1.getString()); + deserializedFullBackupStoreDetails.sasUriList = sasUriList; + } else if ("objectType".equals(fieldName)) { + deserializedFullBackupStoreDetails.objectType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFullBackupStoreDetails; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixResponse.java index 6fda3883bbf6..70e520c06f9d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 2cf71bcfe5ac..c00f92ab05c2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java index 647d477795ff..68b2f9535ac9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Network related properties of a server. + * High availability properties of a server. */ @Fluent public final class HighAvailability implements JsonSerializable { @@ -86,14 +86,6 @@ public HighAvailability withStandbyAvailabilityZone(String standbyAvailabilityZo return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 28a2ea341f31..8e039f7c94a4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 679d4af4a142..2e77a7366c99 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java new file mode 100644 index 000000000000..e5804a217ce5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; + +/** + * An immutable client-side representation of HighAvailabilityValidationEstimation. + */ +public interface HighAvailabilityValidationEstimation { + /** + * Gets the estimatedDowntime property: Estimated seconds of downtime for the deployment. + * + * @return the estimatedDowntime value. + */ + Integer estimatedDowntime(); + + /** + * Gets the scheduledStandbyAvailabilityZone property: Scheduled Availability zone of the standby server. + * + * @return the scheduledStandbyAvailabilityZone value. + */ + String scheduledStandbyAvailabilityZone(); + + /** + * Gets the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. + * + * @return the expectedStandbyAvailabilityZone value. + */ + String expectedStandbyAvailabilityZone(); + + /** + * Gets the inner + * com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner object. + * + * @return the inner object. + */ + HighAvailabilityValidationEstimationInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java index a799f2769e57..0e85e9b80c59 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -35,7 +35,7 @@ public final class Identity implements JsonSerializable { /* * Metadata of user assigned identity. */ - private Map userAssignedIdentities; + private Map userAssignedIdentities; /** * Creates an instance of Identity class. @@ -86,7 +86,7 @@ public Identity withType(ManagedServiceIdentityType type) { * * @return the userAssignedIdentities value. */ - public Map userAssignedIdentities() { + public Map userAssignedIdentities() { return this.userAssignedIdentities; } @@ -96,19 +96,11 @@ public Map userAssignedIdentities() { * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the Identity object itself. */ - public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + 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() { - } - /** * {@inheritDoc} */ @@ -117,7 +109,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, - (writer, element) -> writer.writeUntyped(element)); + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -143,7 +135,8 @@ public static Identity fromJson(JsonReader jsonReader) throws IOException { } else if ("type".equals(fieldName)) { deserializedIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("userAssignedIdentities".equals(fieldName)) { - Map userAssignedIdentities = reader.readMap(reader1 -> reader1.readUntyped()); + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); deserializedIdentity.userAssignedIdentities = userAssignedIdentities; } else { reader.skipChildren(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java new file mode 100644 index 000000000000..e042f3f0cfac --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * ImportFromStorage Response Properties. + */ +@Immutable +public final class ImportFromStorageResponseType extends OperationProgressResponseType { + /* + * Identifies the type of source operation + */ + private ObjectType objectType = ObjectType.IMPORT_FROM_STORAGE_RESPONSE; + + /* + * The estimated time of operation completion. + */ + private OffsetDateTime estimatedCompletionTime; + + /** + * Creates an instance of ImportFromStorageResponseType class. + */ + private ImportFromStorageResponseType() { + } + + /** + * Get the objectType property: Identifies the type of source operation. + * + * @return the objectType value. + */ + @Override + public ObjectType objectType() { + return this.objectType; + } + + /** + * Get the estimatedCompletionTime property: The estimated time of operation completion. + * + * @return the estimatedCompletionTime value. + */ + public OffsetDateTime estimatedCompletionTime() { + return this.estimatedCompletionTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); + jsonWriter.writeStringField("estimatedCompletionTime", + this.estimatedCompletionTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.estimatedCompletionTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportFromStorageResponseType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportFromStorageResponseType if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImportFromStorageResponseType. + */ + public static ImportFromStorageResponseType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportFromStorageResponseType deserializedImportFromStorageResponseType + = new ImportFromStorageResponseType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedImportFromStorageResponseType.objectType = ObjectType.fromString(reader.getString()); + } else if ("estimatedCompletionTime".equals(fieldName)) { + deserializedImportFromStorageResponseType.estimatedCompletionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedImportFromStorageResponseType; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java new file mode 100644 index 000000000000..eb9b9dd86fe5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Import source related properties. + */ +@Fluent +public final class ImportSourceProperties implements JsonSerializable { + /* + * Storage type of import source. + */ + private ImportSourceStorageType storageType; + + /* + * Uri of the import source storage. + */ + private String storageUrl; + + /* + * Sas token for accessing source storage. Read and list permissions are required for sas token. + */ + private String sasToken; + + /* + * Relative path of data directory in storage. + */ + private String dataDirPath; + + /** + * Creates an instance of ImportSourceProperties class. + */ + public ImportSourceProperties() { + } + + /** + * Get the storageType property: Storage type of import source. + * + * @return the storageType value. + */ + public ImportSourceStorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type of import source. + * + * @param storageType the storageType value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withStorageType(ImportSourceStorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the storageUrl property: Uri of the import source storage. + * + * @return the storageUrl value. + */ + public String storageUrl() { + return this.storageUrl; + } + + /** + * Set the storageUrl property: Uri of the import source storage. + * + * @param storageUrl the storageUrl value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withStorageUrl(String storageUrl) { + this.storageUrl = storageUrl; + return this; + } + + /** + * Get the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas + * token. + * + * @return the sasToken value. + */ + public String sasToken() { + return this.sasToken; + } + + /** + * Set the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas + * token. + * + * @param sasToken the sasToken value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withSasToken(String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * Get the dataDirPath property: Relative path of data directory in storage. + * + * @return the dataDirPath value. + */ + public String dataDirPath() { + return this.dataDirPath; + } + + /** + * Set the dataDirPath property: Relative path of data directory in storage. + * + * @param dataDirPath the dataDirPath value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withDataDirPath(String dataDirPath) { + this.dataDirPath = dataDirPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); + jsonWriter.writeStringField("storageUrl", this.storageUrl); + jsonWriter.writeStringField("sasToken", this.sasToken); + jsonWriter.writeStringField("dataDirPath", this.dataDirPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportSourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportSourceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImportSourceProperties. + */ + public static ImportSourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportSourceProperties deserializedImportSourceProperties = new ImportSourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageType".equals(fieldName)) { + deserializedImportSourceProperties.storageType + = ImportSourceStorageType.fromString(reader.getString()); + } else if ("storageUrl".equals(fieldName)) { + deserializedImportSourceProperties.storageUrl = reader.getString(); + } else if ("sasToken".equals(fieldName)) { + deserializedImportSourceProperties.sasToken = reader.getString(); + } else if ("dataDirPath".equals(fieldName)) { + deserializedImportSourceProperties.dataDirPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImportSourceProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java new file mode 100644 index 000000000000..4c5c4d3d8377 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Storage type of import source. + */ +public final class ImportSourceStorageType extends ExpandableStringEnum { + /** + * Static value AzureBlob for ImportSourceStorageType. + */ + public static final ImportSourceStorageType AZURE_BLOB = fromString("AzureBlob"); + + /** + * Creates a new instance of ImportSourceStorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImportSourceStorageType() { + } + + /** + * Creates or finds a ImportSourceStorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImportSourceStorageType. + */ + public static ImportSourceStorageType fromString(String name) { + return fromString(name, ImportSourceStorageType.class); + } + + /** + * Gets known ImportSourceStorageType values. + * + * @return known ImportSourceStorageType values. + */ + public static Collection values() { + return values(ImportSourceStorageType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsConfigPendingRestart.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsConfigPendingRestart.java index 99c435238a05..8d08c82ff79b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index f03aab6fa2b3..a60ac2d261b4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index cd27d4cb800c..b44b418e9aea 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 36892fdfc38a..c9d2a981505b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java new file mode 100644 index 000000000000..994c8372bacd --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LocationBasedCapabilitySets. + */ +public interface LocationBasedCapabilitySets { + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response}. + */ + Response getWithResponse(String locationName, String capabilitySetName, Context context); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + Capability get(String locationName, String capabilitySetName); + + /** + * 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 new file mode 100644 index 000000000000..1216f3c0e238 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of LogFile. + */ +public interface LogFile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the sizeInKB property: The size in kb of the logFile. + * + * @return the sizeInKB value. + */ + Long sizeInKB(); + + /** + * Gets the createdTime property: Creation timestamp of the log file. + * + * @return the createdTime value. + */ + OffsetDateTime createdTime(); + + /** + * Gets the typePropertiesType property: Type of the log file. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the lastModifiedTime property: Last modified timestamp of the log file. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the url property: The url to download the log file from. + * + * @return the url value. + */ + String url(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner object. + * + * @return the inner object. + */ + LogFileInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java new file mode 100644 index 000000000000..83bb7549fccf --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 the response of a LogFile list operation 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 the response of a LogFile list operation 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/LongRunningBackupOperations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupOperations.java new file mode 100644 index 000000000000..32e9984c1698 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupOperations.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +/** + * Resource collection API of LongRunningBackupOperations. + */ +public interface LongRunningBackupOperations { + /** + * Begins definition for a new ServerBackupV2 resource. + * + * @param name resource name. + * @return the first stage of the new ServerBackupV2 definition. + */ + ServerBackupV2.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java new file mode 100644 index 000000000000..a6b0bd4cb333 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 LongRunningBackups. + */ +public interface LongRunningBackups { + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serverName, String backupName, + Context context); + + /** + * Get backup for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a given server. + */ + ServerBackupV2 get(String resourceGroupName, String serverName, String backupName); + + /** + * List all the backups for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName); + + /** + * List all the backups for a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ServerBackupV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java new file mode 100644 index 000000000000..013a7857b7b3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of Maintenance. + */ +public interface Maintenance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the maintenanceType property: A string defines maintenance type. + * + * @return the maintenanceType value. + */ + MaintenanceType maintenanceType(); + + /** + * Gets the maintenanceState property: A string describes the maintenance status. + * + * @return the maintenanceState value. + */ + MaintenanceState maintenanceState(); + + /** + * Gets the maintenanceStartTime property: The start time for a maintenance. + * + * @return the maintenanceStartTime value. + */ + OffsetDateTime maintenanceStartTime(); + + /** + * Gets the maintenanceEndTime property: The end time for a maintenance. + * + * @return the maintenanceEndTime value. + */ + OffsetDateTime maintenanceEndTime(); + + /** + * Gets the maintenanceExecutionStartTime property: The start time for a maintenance execution. + * + * @return the maintenanceExecutionStartTime value. + */ + OffsetDateTime maintenanceExecutionStartTime(); + + /** + * Gets the maintenanceExecutionEndTime property: The end time for a maintenance execution. + * + * @return the maintenanceExecutionEndTime value. + */ + OffsetDateTime maintenanceExecutionEndTime(); + + /** + * Gets the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. + * + * @return the maintenanceAvailableScheduleMinTime value. + */ + OffsetDateTime maintenanceAvailableScheduleMinTime(); + + /** + * Gets the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. + * + * @return the maintenanceAvailableScheduleMaxTime value. + */ + OffsetDateTime maintenanceAvailableScheduleMaxTime(); + + /** + * Gets the maintenanceTitle property: The maintenance title. + * + * @return the maintenanceTitle value. + */ + String maintenanceTitle(); + + /** + * Gets the maintenanceDescription property: The maintenance description. + * + * @return the maintenanceDescription value. + */ + String maintenanceDescription(); + + /** + * Gets the provisioningState property: Provisioning state of the Maintenance. + * + * @return the provisioningState value. + */ + MaintenanceProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner object. + * + * @return the inner object. + */ + MaintenanceInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenancePolicy.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenancePolicy.java new file mode 100644 index 000000000000..0d0d30f87524 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenancePolicy.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Maintenance policy of a server. + */ +@Fluent +public final class MaintenancePolicy implements JsonSerializable { + /* + * The patch strategy of this server + */ + private PatchStrategy patchStrategy; + + /** + * Creates an instance of MaintenancePolicy class. + */ + public MaintenancePolicy() { + } + + /** + * Get the patchStrategy property: The patch strategy of this server. + * + * @return the patchStrategy value. + */ + public PatchStrategy patchStrategy() { + return this.patchStrategy; + } + + /** + * Set the patchStrategy property: The patch strategy of this server. + * + * @param patchStrategy the patchStrategy value to set. + * @return the MaintenancePolicy object itself. + */ + public MaintenancePolicy withPatchStrategy(PatchStrategy patchStrategy) { + this.patchStrategy = patchStrategy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patchStrategy", this.patchStrategy == null ? null : this.patchStrategy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenancePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenancePolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenancePolicy. + */ + public static MaintenancePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenancePolicy deserializedMaintenancePolicy = new MaintenancePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("patchStrategy".equals(fieldName)) { + deserializedMaintenancePolicy.patchStrategy = PatchStrategy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenancePolicy; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java new file mode 100644 index 000000000000..c7b3dd6e40e9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class MaintenanceProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for MaintenanceProvisioningState. + */ + public static final MaintenanceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for MaintenanceProvisioningState. + */ + public static final MaintenanceProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for MaintenanceProvisioningState. + */ + public static final MaintenanceProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Failed for MaintenanceProvisioningState. + */ + public static final MaintenanceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of MaintenanceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaintenanceProvisioningState() { + } + + /** + * Creates or finds a MaintenanceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaintenanceProvisioningState. + */ + public static MaintenanceProvisioningState fromString(String name) { + return fromString(name, MaintenanceProvisioningState.class); + } + + /** + * Gets known MaintenanceProvisioningState values. + * + * @return known MaintenanceProvisioningState values. + */ + public static Collection values() { + return values(MaintenanceProvisioningState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java new file mode 100644 index 000000000000..7cf2daa9ca9b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current status of this maintenance. + */ +public final class MaintenanceState extends ExpandableStringEnum { + /** + * Static value Scheduled for MaintenanceState. + */ + public static final MaintenanceState SCHEDULED = fromString("Scheduled"); + + /** + * Static value ReScheduled for MaintenanceState. + */ + public static final MaintenanceState RE_SCHEDULED = fromString("ReScheduled"); + + /** + * Static value InPreparation for MaintenanceState. + */ + public static final MaintenanceState IN_PREPARATION = fromString("InPreparation"); + + /** + * Static value Processing for MaintenanceState. + */ + public static final MaintenanceState PROCESSING = fromString("Processing"); + + /** + * Static value Completed for MaintenanceState. + */ + public static final MaintenanceState COMPLETED = fromString("Completed"); + + /** + * Static value Canceled for MaintenanceState. + */ + public static final MaintenanceState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of MaintenanceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaintenanceState() { + } + + /** + * Creates or finds a MaintenanceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaintenanceState. + */ + public static MaintenanceState fromString(String name) { + return fromString(name, MaintenanceState.class); + } + + /** + * Gets known MaintenanceState values. + * + * @return known MaintenanceState values. + */ + public static Collection values() { + return values(MaintenanceState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java new file mode 100644 index 000000000000..b6a6df04ee34 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of this maintenance. + */ +public final class MaintenanceType extends ExpandableStringEnum { + /** + * Static value RoutineMaintenance for MaintenanceType. + */ + public static final MaintenanceType ROUTINE_MAINTENANCE = fromString("RoutineMaintenance"); + + /** + * Static value MinorVersionUpgrade for MaintenanceType. + */ + public static final MaintenanceType MINOR_VERSION_UPGRADE = fromString("MinorVersionUpgrade"); + + /** + * Static value SecurityPatches for MaintenanceType. + */ + public static final MaintenanceType SECURITY_PATCHES = fromString("SecurityPatches"); + + /** + * Static value HotFixes for MaintenanceType. + */ + public static final MaintenanceType HOT_FIXES = fromString("HotFixes"); + + /** + * Creates a new instance of MaintenanceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaintenanceType() { + } + + /** + * Creates or finds a MaintenanceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaintenanceType. + */ + public static MaintenanceType fromString(String name) { + return fromString(name, MaintenanceType.class); + } + + /** + * Gets known MaintenanceType values. + * + * @return known MaintenanceType values. + */ + public static Collection values() { + return values(MaintenanceType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java new file mode 100644 index 000000000000..0c8bf57b0187 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Represents a maintenance update parameter. + */ +@Fluent +public final class MaintenanceUpdate implements JsonSerializable { + /* + * The properties of a maintenance update parameter + */ + private MaintenancePropertiesForUpdate innerProperties; + + /** + * Creates an instance of MaintenanceUpdate class. + */ + public MaintenanceUpdate() { + } + + /** + * Get the innerProperties property: The properties of a maintenance update parameter. + * + * @return the innerProperties value. + */ + private MaintenancePropertiesForUpdate innerProperties() { + return this.innerProperties; + } + + /** + * Get the maintenanceStartTime property: The start time for a maintenance. + * + * @return the maintenanceStartTime value. + */ + public OffsetDateTime maintenanceStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); + } + + /** + * Set the maintenanceStartTime property: The start time for a maintenance. + * + * @param maintenanceStartTime the maintenanceStartTime value to set. + * @return the MaintenanceUpdate object itself. + */ + public MaintenanceUpdate withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { + if (this.innerProperties() == null) { + this.innerProperties = new MaintenancePropertiesForUpdate(); + } + this.innerProperties().withMaintenanceStartTime(maintenanceStartTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceUpdate. + */ + public static MaintenanceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceUpdate deserializedMaintenanceUpdate = new MaintenanceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedMaintenanceUpdate.innerProperties = MaintenancePropertiesForUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceUpdate; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceWindow.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceWindow.java index 84abdacc1d8b..30053a118c07 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -36,6 +36,11 @@ public final class MaintenanceWindow implements JsonSerializable readWithResponse(String resourceGroupName, String serverName, String maintenanceName, + Context context); + + /** + * Read maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + Maintenance read(String resourceGroupName, String serverName, String maintenanceName); + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + Maintenance update(String resourceGroupName, String serverName, String maintenanceName); + + /** + * Update maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param maintenanceName The name of the maintenance. + * @param parameters The required parameters for update maintenance on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a maintenance. + */ + Maintenance update(String resourceGroupName, String serverName, String maintenanceName, + MaintenanceUpdate parameters, Context context); + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName); + + /** + * List maintenances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java index 7927e7b8aa17..38bfacb8e3eb 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java @@ -1,51 +1,46 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Type of managed service identity. */ -public enum ManagedServiceIdentityType { +public final class ManagedServiceIdentityType extends ExpandableStringEnum { /** - * Enum value UserAssigned. + * Static value UserAssigned for ManagedServiceIdentityType. */ - USER_ASSIGNED("UserAssigned"); + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); /** - * The actual serialized value for a ManagedServiceIdentityType instance. + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - ManagedServiceIdentityType(String value) { - this.value = value; + @Deprecated + public ManagedServiceIdentityType() { } /** - * Parses a serialized value to a ManagedServiceIdentityType instance. + * Creates or finds a ManagedServiceIdentityType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ManagedServiceIdentityType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. */ - public static ManagedServiceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ManagedServiceIdentityType[] items = ManagedServiceIdentityType.values(); - for (ManagedServiceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); } /** - * {@inheritDoc} + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. */ - @Override - public String toString() { - return this.value; + 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 index 4265354f5eba..3ce9f1311449 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 446e5e63e846..4cd5ca46a051 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,20 +72,6 @@ public NameAvailabilityRequest withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model NameAvailabilityRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NameAvailabilityRequest.class); - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java index e6e09b09f5d6..9fb7507086fd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -48,6 +48,18 @@ 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. * @@ -88,20 +100,14 @@ public Network withPrivateDnsZoneResourceId(String privateDnsZoneResourceId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); jsonWriter.writeStringField("delegatedSubnetResourceId", this.delegatedSubnetResourceId); jsonWriter.writeStringField("privateDnsZoneResourceId", this.privateDnsZoneResourceId); return jsonWriter.writeEndObject(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java new file mode 100644 index 000000000000..67342d4aa623 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Identifies the type of source operation. + */ +public final class ObjectType extends ExpandableStringEnum { + /** + * Static value BackupAndExportResponse for ObjectType. + */ + public static final ObjectType BACKUP_AND_EXPORT_RESPONSE = fromString("BackupAndExportResponse"); + + /** + * Static value ImportFromStorageResponse for ObjectType. + */ + public static final ObjectType IMPORT_FROM_STORAGE_RESPONSE = fromString("ImportFromStorageResponse"); + + /** + * Creates a new instance of ObjectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ObjectType() { + } + + /** + * Creates or finds a ObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObjectType. + */ + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** + * Gets known ObjectType values. + * + * @return known ObjectType values. + */ + public static Collection values() { + return values(ObjectType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operation.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operation.java index 2014cffcbd63..ce8340ac3ed8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -12,25 +12,27 @@ */ public interface Operation { /** - * Gets the name property: The name of the operation being performed on this particular object. + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ String name(); /** - * Gets the display property: The localized display information for this particular operation or action. + * Gets the display property: Localized display information for this particular operation. * * @return the display value. */ OperationDisplay display(); /** - * Gets the origin property: The intended executor of the operation. + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * * @return the origin value. */ - String origin(); + Origin origin(); /** * Gets the properties property: Additional descriptions for the operation. 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 index 82a6fa6ce5d9..10a96be59698 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,36 +14,40 @@ /** * Display metadata associated with the operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* - * Operation resource provider name. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Resource on which the operation is performed. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Localized friendly name for the operation. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; /* - * Operation description. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ private String description; /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Operation resource provider name. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -52,18 +56,8 @@ public String 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. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -72,18 +66,8 @@ public String 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. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -92,18 +76,8 @@ public String 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. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -111,35 +85,12 @@ 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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); return jsonWriter.writeEndObject(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java new file mode 100644 index 000000000000..abecfb9c5d71 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OperationProgress. + */ +public interface OperationProgress { + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + Response getWithResponse(String locationName, String operationId, Context context); + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + OperationProgressResult get(String locationName, String operationId); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java new file mode 100644 index 000000000000..8fce9dbe7347 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the response properties specific to the operation. + */ +@Immutable +public class OperationProgressResponseType implements JsonSerializable { + /* + * Identifies the type of source operation + */ + private ObjectType objectType = ObjectType.fromString("OperationProgressResponseType"); + + /** + * Creates an instance of OperationProgressResponseType class. + */ + protected OperationProgressResponseType() { + } + + /** + * Get the objectType property: Identifies the type of source operation. + * + * @return the objectType value. + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProgressResponseType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProgressResponseType if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationProgressResponseType. + */ + public static OperationProgressResponseType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("objectType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("BackupAndExportResponse".equals(discriminatorValue)) { + return BackupAndExportResponseType.fromJson(readerToUse.reset()); + } else if ("ImportFromStorageResponse".equals(discriminatorValue)) { + return ImportFromStorageResponseType.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OperationProgressResponseType fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProgressResponseType deserializedOperationProgressResponseType + = new OperationProgressResponseType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectType".equals(fieldName)) { + deserializedOperationProgressResponseType.objectType = ObjectType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProgressResponseType; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java new file mode 100644 index 000000000000..5026dfbc008b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of OperationProgressResult. + */ +public interface OperationProgressResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the properties property: The response properties specific to the operation. + * + * @return the properties value. + */ + OperationProgressResponseType properties(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner object. + * + * @return the inner object. + */ + OperationProgressResultInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java new file mode 100644 index 000000000000..35fbb943adb6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OperationResults. + */ +public interface OperationResults { + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + Response getWithResponse(String locationName, String operationId, Context context); + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + OperationStatusExtendedResult get(String locationName, String operationId); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java new file mode 100644 index 000000000000..feabf5dec4c3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +/** + * The operation status. + */ +public enum OperationStatus { + /** + * The operation has been accepted but hasn't started. + */ + PENDING("Pending"), + + /** + * The operation is running. + */ + IN_PROGRESS("InProgress"), + + /** + * The operation Succeeded. + */ + SUCCEEDED("Succeeded"), + + /** + * The operation Failed. + */ + FAILED("Failed"), + + /** + * The cancellation in progress. + */ + CANCEL_IN_PROGRESS("CancelInProgress"), + + /** + * The operation has been Canceled. + */ + CANCELED("Canceled"); + + /** + * The actual serialized value for a OperationStatus instance. + */ + private final String value; + + OperationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationStatus object, or null if unable to parse. + */ + public static OperationStatus fromString(String value) { + if (value == null) { + return null; + } + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java new file mode 100644 index 000000000000..b0d3c5c426c2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of OperationStatusExtendedResult. + */ +public interface OperationStatusExtendedResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the properties property: The extended properties of Operation Results. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner + * object. + * + * @return the inner object. + */ + OperationStatusExtendedResultInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java new file mode 100644 index 000000000000..04adbf964e9b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Immutable +public class OperationStatusResult implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /** + * Creates an instance of OperationStatusResult class. + */ + protected OperationStatusResult() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withPercentComplete(Double percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @param resourceId the resourceId value to set. + * @return the OperationStatusResult object itself. + */ + OperationStatusResult withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResult. + */ + public static OperationStatusResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResult deserializedOperationStatusResult = new OperationStatusResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResult.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResult.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResult.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResult.percentComplete = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResult.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResult.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); + deserializedOperationStatusResult.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResult.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResult.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResult; + }); + } +} 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 index 8c9c619944c5..6c86c2349f4e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -12,22 +12,24 @@ */ public interface Operations { /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + * @return the static parameters for a resource group based resource as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** - * Lists all of the available REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of resource provider operations as paginated response with {@link PagedIterable}. + * @return the static parameters for a resource group based resource 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/Origin.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Origin.java new file mode 100644 index 000000000000..b63064d1e2f7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PatchStrategy.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PatchStrategy.java new file mode 100644 index 000000000000..8be1e741ee7f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PatchStrategy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to indicate the patch strategy of a server. + */ +public final class PatchStrategy extends ExpandableStringEnum { + /** + * Static value Regular for PatchStrategy. + */ + public static final PatchStrategy REGULAR = fromString("Regular"); + + /** + * Static value VirtualCanary for PatchStrategy. + */ + public static final PatchStrategy VIRTUAL_CANARY = fromString("VirtualCanary"); + + /** + * Creates a new instance of PatchStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchStrategy() { + } + + /** + * Creates or finds a PatchStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchStrategy. + */ + public static PatchStrategy fromString(String name) { + return fromString(name, PatchStrategy.class); + } + + /** + * Gets known PatchStrategy values. + * + * @return known PatchStrategy values. + */ + public static Collection values() { + return values(PatchStrategy.class); + } +} 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..bb9d042ee2bb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The private endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The resource identifier of the private endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The resource identifier of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/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..2468b222c0b8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..2bec8db48235 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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: The PrivateEndpointConnection items on this page. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * 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..bb5dd4697f4d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Connection has been provisioned. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Connection is being created. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Connection is being deleted. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Connection provisioning has failed. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..01d0d7318f57 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * 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 associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serverName, + String privateEndpointConnectionName, 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 associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String serverName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); + + /** + * 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 all private endpoint connections on a server along with {@link Response}. + */ + Response listByServerWithResponse(String resourceGroupName, String serverName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a server. + */ + PrivateEndpointConnectionListResult listByServer(String resourceGroupName, String serverName); + + /** + * 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 a private endpoint connection along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * 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 a private endpoint connection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @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 private endpoint connection with a given name. + * + * @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 PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + 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..3a044273c339 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Connection waiting for approval or rejection. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Connection approved. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Connection Rejected. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResource.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResource.java new file mode 100644 index 000000000000..6956461d00e0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Resource properties. + * + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..c20219632236 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Immutable +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + private PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResources.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResources.java new file mode 100644 index 000000000000..ab7bcd881785 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResources.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * 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}. + */ + 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. + */ + PrivateLinkResource get(String resourceGroupName, String serverName, String groupName); + + /** + * 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 for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * 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 for versions before v6. + * + * This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5 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/PrivateLinkServiceConnectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..a0a2370387ee --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java new file mode 100644 index 000000000000..1853dfbb8cba --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Replicas.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Replicas.java index 4c819d688b00..211e659ad0fa 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -19,7 +19,7 @@ public interface Replicas { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ PagedIterable listByServer(String resourceGroupName, String serverName); @@ -32,7 +32,7 @@ public interface Replicas { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation 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 index ef9857fb07b5..1cde9bf76aef 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 new file mode 100644 index 000000000000..2575077cbdfb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether to reset all server parameters to default. + */ +public final class ResetAllToDefault extends ExpandableStringEnum { + /** + * Static value True for ResetAllToDefault. + */ + public static final ResetAllToDefault TRUE = fromString("True"); + + /** + * Static value False for ResetAllToDefault. + */ + public static final ResetAllToDefault FALSE = fromString("False"); + + /** + * Creates a new instance of ResetAllToDefault value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResetAllToDefault() { + } + + /** + * Creates or finds a ResetAllToDefault from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResetAllToDefault. + */ + public static ResetAllToDefault fromString(String name) { + return fromString(name, ResetAllToDefault.class); + } + + /** + * Gets known ResetAllToDefault values. + * + * @return known ResetAllToDefault values. + */ + public static Collection values() { + return values(ResetAllToDefault.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java index 7b3557f253a0..fb1a827e4e8e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java @@ -1,14 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -65,7 +68,7 @@ public interface Server { Sku sku(); /** - * 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. */ @@ -88,12 +91,19 @@ public interface Server { String administratorLoginPassword(); /** - * Gets the version property: Server version. + * Gets the version property: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. * * @return the version value. */ ServerVersion version(); + /** + * Gets the fullVersion property: Major version and actual engine version. + * + * @return the fullVersion value. + */ + String fullVersion(); + /** * Gets the availabilityZone property: availability Zone information of the server. * @@ -158,6 +168,13 @@ public interface Server { */ String fullyQualifiedDomainName(); + /** + * Gets the databasePort property: The server database port. Can only be specified when the server is being created. + * + * @return the databasePort value. + */ + Integer databasePort(); + /** * Gets the storage property: Storage related properties of a server. * @@ -187,12 +204,34 @@ public interface Server { Network network(); /** - * Gets the maintenanceWindow property: Maintenance window of a server. + * Gets the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the maintenancePolicy property: Maintenance policy of a server. + * + * @return the maintenancePolicy value. + */ + MaintenancePolicy maintenancePolicy(); + + /** + * Gets the maintenanceWindow property: Maintenance window of a server. Known issue: cannot be set during server + * creation or updated with other properties during server update; must be updated separately. * * @return the maintenanceWindow value. */ MaintenanceWindow maintenanceWindow(); + /** + * Gets the importSourceProperties property: Source properties for import from storage. + * + * @return the importSourceProperties value. + */ + ImportSourceProperties importSourceProperties(); + /** * Gets the region of the resource. * @@ -280,8 +319,10 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde 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 { + DefinitionStages.WithReplicationRole, DefinitionStages.WithDataEncryption, + DefinitionStages.WithDatabasePort, DefinitionStages.WithStorage, DefinitionStages.WithBackup, + DefinitionStages.WithHighAvailability, DefinitionStages.WithNetwork, DefinitionStages.WithMaintenancePolicy, + DefinitionStages.WithImportSourceProperties { /** * Executes the create request. * @@ -371,9 +412,10 @@ interface WithAdministratorLoginPassword { */ interface WithVersion { /** - * Specifies the version property: Server version.. + * Specifies the version property: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for + * MySQL 5.7. * - * @param version Server version. + * @param version Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. * @return the next definition stage. */ WithCreate withVersion(ServerVersion version); @@ -459,6 +501,20 @@ interface WithDataEncryption { WithCreate withDataEncryption(DataEncryption dataEncryption); } + /** + * The stage of the Server definition allowing to specify databasePort. + */ + interface WithDatabasePort { + /** + * Specifies the databasePort property: The server database port. Can only be specified when the server is + * being created.. + * + * @param databasePort The server database port. Can only be specified when the server is being created. + * @return the next definition stage. + */ + WithCreate withDatabasePort(Integer databasePort); + } + /** * The stage of the Server definition allowing to specify storage. */ @@ -510,6 +566,32 @@ interface WithNetwork { */ WithCreate withNetwork(Network network); } + + /** + * The stage of the Server definition allowing to specify maintenancePolicy. + */ + interface WithMaintenancePolicy { + /** + * Specifies the maintenancePolicy property: Maintenance policy of a server.. + * + * @param maintenancePolicy Maintenance policy of a server. + * @return the next definition stage. + */ + WithCreate withMaintenancePolicy(MaintenancePolicy maintenancePolicy); + } + + /** + * The stage of the Server definition allowing to specify importSourceProperties. + */ + interface WithImportSourceProperties { + /** + * Specifies the importSourceProperties property: Source properties for import from storage.. + * + * @param importSourceProperties Source properties for import from storage. + * @return the next definition stage. + */ + WithCreate withImportSourceProperties(ImportSourceProperties importSourceProperties); + } } /** @@ -523,9 +605,10 @@ interface WithNetwork { * The template for Server update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, - UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithStorage, UpdateStages.WithBackup, - UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, UpdateStages.WithReplicationRole, - UpdateStages.WithDataEncryption { + UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithVersion, UpdateStages.WithStorage, + UpdateStages.WithBackup, UpdateStages.WithHighAvailability, UpdateStages.WithMaintenancePolicy, + UpdateStages.WithMaintenanceWindow, UpdateStages.WithReplicationRole, UpdateStages.WithDataEncryption, + UpdateStages.WithNetwork { /** * Executes the update request. * @@ -598,6 +681,19 @@ interface WithAdministratorLoginPassword { Update withAdministratorLoginPassword(String administratorLoginPassword); } + /** + * The stage of the Server update allowing to specify version. + */ + interface WithVersion { + /** + * Specifies the version property: Server version.. + * + * @param version Server version. + * @return the next definition stage. + */ + Update withVersion(ServerVersion version); + } + /** * The stage of the Server update allowing to specify storage. */ @@ -637,6 +733,19 @@ interface WithHighAvailability { Update withHighAvailability(HighAvailability highAvailability); } + /** + * The stage of the Server update allowing to specify maintenancePolicy. + */ + interface WithMaintenancePolicy { + /** + * Specifies the maintenancePolicy property: Maintenance policy of a server.. + * + * @param maintenancePolicy Maintenance policy of a server. + * @return the next definition stage. + */ + Update withMaintenancePolicy(MaintenancePolicy maintenancePolicy); + } + /** * The stage of the Server update allowing to specify maintenanceWindow. */ @@ -675,6 +784,19 @@ interface WithDataEncryption { */ Update withDataEncryption(DataEncryption dataEncryption); } + + /** + * The stage of the Server update allowing to specify network. + */ + interface WithNetwork { + /** + * Specifies the network property: Network related properties of a server. + * + * @param network Network related properties of a server. + * @return the next definition stage. + */ + Update withNetwork(Network network); + } } /** @@ -710,6 +832,31 @@ interface WithDataEncryption { */ void failover(Context context); + /** + * Validate a deployment of high availability. + * + * @param parameters The required parameters for validation of high availability deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server along with {@link Response}. + */ + Response validateEstimateHighAvailabilityWithResponse( + HighAvailabilityValidationEstimationInner parameters, Context context); + + /** + * Validate a deployment of high availability. + * + * @param parameters The required parameters for validation of high availability deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server. + */ + HighAvailabilityValidationEstimation + validateEstimateHighAvailability(HighAvailabilityValidationEstimationInner parameters); + /** * Restarts a server. * @@ -766,4 +913,48 @@ interface WithDataEncryption { * @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); + + /** + * Detach VNet on a server. + * + * @param parameters The required parameters for detach vnet 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 response. + */ + Server detachVNet(ServerDetachVNetParameter parameters); + + /** + * Detach VNet on a server. + * + * @param parameters The required parameters for detach vnet 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 response. + */ + Server detachVNet(ServerDetachVNetParameter parameters, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java index ebf551c81cc7..e92223738a30 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -34,7 +34,7 @@ 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. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java new file mode 100644 index 000000000000..7b7ebc8ba485 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of ServerBackupV2. + */ +public interface ServerBackupV2 { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the backupNameV2 property: Backup name. + * + * @return the backupNameV2 value. + */ + String backupNameV2(); + + /** + * Gets the backupType property: The backupType property. + * + * @return the backupType value. + */ + BackupType backupType(); + + /** + * Gets the completedTime property: Backup completed time (ISO8601 format). + * + * @return the completedTime value. + */ + OffsetDateTime completedTime(); + + /** + * Gets the source property: Backup source. + * + * @return the source value. + */ + String source(); + + /** + * Gets the provisioningState property: The provisioning state of backup resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner object. + * + * @return the inner object. + */ + ServerBackupV2Inner innerModel(); + + /** + * The entirety of the ServerBackupV2 definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ServerBackupV2 definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ServerBackupV2 definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ServerBackupV2 definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serverName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @return the next definition stage. + */ + WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the ServerBackupV2 definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithBackupNameV2, DefinitionStages.WithBackupType, + DefinitionStages.WithCompletedTime, DefinitionStages.WithSource { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerBackupV2 create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerBackupV2 create(Context context); + } + + /** + * The stage of the ServerBackupV2 definition allowing to specify backupNameV2. + */ + interface WithBackupNameV2 { + /** + * Specifies the backupNameV2 property: Backup name. + * + * @param backupNameV2 Backup name. + * @return the next definition stage. + */ + WithCreate withBackupNameV2(String backupNameV2); + } + + /** + * The stage of the ServerBackupV2 definition allowing to specify backupType. + */ + interface WithBackupType { + /** + * Specifies the backupType property: The backupType property.. + * + * @param backupType The backupType property. + * @return the next definition stage. + */ + WithCreate withBackupType(BackupType backupType); + } + + /** + * The stage of the ServerBackupV2 definition allowing to specify completedTime. + */ + interface WithCompletedTime { + /** + * Specifies the completedTime property: Backup completed time (ISO8601 format).. + * + * @param completedTime Backup completed time (ISO8601 format). + * @return the next definition stage. + */ + WithCreate withCompletedTime(OffsetDateTime completedTime); + } + + /** + * The stage of the ServerBackupV2 definition allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: Backup source. + * + * @param source Backup source. + * @return the next definition stage. + */ + WithCreate withSource(String source); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerDetachVNetParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerDetachVNetParameter.java new file mode 100644 index 000000000000..95699a92facc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerDetachVNetParameter.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to detach Vnet. + */ +@Fluent +public final class ServerDetachVNetParameter implements JsonSerializable { + /* + * Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet + * integration. + */ + private EnableStatusEnum publicNetworkAccess; + + /** + * Creates an instance of ServerDetachVNetParameter class. + */ + public ServerDetachVNetParameter() { + } + + /** + * 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 ServerDetachVNetParameter object itself. + */ + public ServerDetachVNetParameter withPublicNetworkAccess(EnableStatusEnum publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerDetachVNetParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerDetachVNetParameter if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerDetachVNetParameter. + */ + public static ServerDetachVNetParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerDetachVNetParameter deserializedServerDetachVNetParameter = new ServerDetachVNetParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicNetworkAccess".equals(fieldName)) { + deserializedServerDetachVNetParameter.publicNetworkAccess + = EnableStatusEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServerDetachVNetParameter; + }); + } +} 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 index c25dca8973f3..22e19dfd7225 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -35,7 +35,7 @@ public final class ServerEditionCapability implements JsonSerializable 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java new file mode 100644 index 000000000000..23aace1d3fc3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Server edition capabilities. + */ +@Immutable +public final class ServerEditionCapabilityV2 implements JsonSerializable { + /* + * Server edition name + */ + private String name; + + /* + * Default Sku name + */ + private String defaultSku; + + /* + * Default storage size + */ + private Integer defaultStorageSize; + + /* + * A list of supported storage editions + */ + private List supportedStorageEditions; + + /* + * A list of supported Skus + */ + private List supportedSkus; + + /** + * Creates an instance of ServerEditionCapabilityV2 class. + */ + private ServerEditionCapabilityV2() { + } + + /** + * Get the name property: Server edition name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the defaultSku property: Default Sku name. + * + * @return the defaultSku value. + */ + public String defaultSku() { + return this.defaultSku; + } + + /** + * Get the defaultStorageSize property: Default storage size. + * + * @return the defaultStorageSize value. + */ + public Integer defaultStorageSize() { + return this.defaultStorageSize; + } + + /** + * Get the supportedStorageEditions property: A list of supported storage editions. + * + * @return the supportedStorageEditions value. + */ + public List supportedStorageEditions() { + return this.supportedStorageEditions; + } + + /** + * Get the supportedSkus property: A list of supported Skus. + * + * @return the supportedSkus value. + */ + public List supportedSkus() { + return this.supportedSkus; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerEditionCapabilityV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerEditionCapabilityV2 if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerEditionCapabilityV2. + */ + public static ServerEditionCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerEditionCapabilityV2 deserializedServerEditionCapabilityV2 = new ServerEditionCapabilityV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedServerEditionCapabilityV2.name = reader.getString(); + } else if ("defaultSku".equals(fieldName)) { + deserializedServerEditionCapabilityV2.defaultSku = reader.getString(); + } else if ("defaultStorageSize".equals(fieldName)) { + deserializedServerEditionCapabilityV2.defaultStorageSize = reader.getNullable(JsonReader::getInt); + } else if ("supportedStorageEditions".equals(fieldName)) { + List supportedStorageEditions + = reader.readArray(reader1 -> StorageEditionCapability.fromJson(reader1)); + deserializedServerEditionCapabilityV2.supportedStorageEditions = supportedStorageEditions; + } else if ("supportedSkus".equals(fieldName)) { + List supportedSkus + = reader.readArray(reader1 -> SkuCapabilityV2.fromJson(reader1)); + deserializedServerEditionCapabilityV2.supportedSkus = supportedSkus; + } else { + reader.skipChildren(); + } + } + + return deserializedServerEditionCapabilityV2; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java index 5dbf0c2d6953..1773a14eb49b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -136,6 +136,29 @@ public ServerForUpdate withAdministratorLoginPassword(String administratorLoginP return this; } + /** + * Get the version property: Server version. + * + * @return the version value. + */ + public ServerVersion version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Server version. + * + * @param version the version value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withVersion(ServerVersion version) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withVersion(version); + return this; + } + /** * Get the storage property: Storage related properties of a server. * @@ -205,6 +228,29 @@ public ServerForUpdate withHighAvailability(HighAvailability highAvailability) { return this; } + /** + * Get the maintenancePolicy property: Maintenance policy of a server. + * + * @return the maintenancePolicy value. + */ + public MaintenancePolicy maintenancePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().maintenancePolicy(); + } + + /** + * Set the maintenancePolicy property: Maintenance policy of a server. + * + * @param maintenancePolicy the maintenancePolicy value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withMaintenancePolicy(MaintenancePolicy maintenancePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withMaintenancePolicy(maintenancePolicy); + return this; + } + /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -275,20 +321,26 @@ public ServerForUpdate withDataEncryption(DataEncryption dataEncryption) { } /** - * Validates the instance. + * Get the network property: Network related properties of a server. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the network value. */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); + 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; } /** 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 new file mode 100644 index 000000000000..18d807ee67f4 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Server Gtid set parameters: Replication with Global Transaction Identifiers. + */ +@Fluent +public final class ServerGtidSetParameter implements JsonSerializable { + /* + * The Gtid set of server. + */ + private String gtidSet; + + /** + * Creates an instance of ServerGtidSetParameter class. + */ + public ServerGtidSetParameter() { + } + + /** + * Get the gtidSet property: The Gtid set of server. + * + * @return the gtidSet value. + */ + public String gtidSet() { + return this.gtidSet; + } + + /** + * Set the gtidSet property: The Gtid set of server. + * + * @param gtidSet the gtidSet value to set. + * @return the ServerGtidSetParameter object itself. + */ + public ServerGtidSetParameter withGtidSet(String gtidSet) { + this.gtidSet = gtidSet; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gtidSet", this.gtidSet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerGtidSetParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerGtidSetParameter if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerGtidSetParameter. + */ + public static ServerGtidSetParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerGtidSetParameter deserializedServerGtidSetParameter = new ServerGtidSetParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gtidSet".equals(fieldName)) { + deserializedServerGtidSetParameter.gtidSet = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerGtidSetParameter; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerRestartParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerRestartParameter.java index fdb4b22ff0ca..e5686aec8dfe 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -74,14 +74,6 @@ public ServerRestartParameter withMaxFailoverSeconds(Integer maxFailoverSeconds) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index df1df5484b4a..ed6e3af4e5c9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; 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 index 59033d61e6c4..df56b34424bb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The version of a server. + * The major version of a server. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. */ public final class ServerVersion extends ExpandableStringEnum { /** 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 index 4a00d495dfef..15d6c95d006d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -30,7 +30,7 @@ public final class ServerVersionCapability implements JsonSerializable 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java new file mode 100644 index 000000000000..b704973caadd --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Server version capabilities. + */ +@Immutable +public final class ServerVersionCapabilityV2 implements JsonSerializable { + /* + * server version + */ + private String name; + + /** + * Creates an instance of ServerVersionCapabilityV2 class. + */ + private ServerVersionCapabilityV2() { + } + + /** + * Get the name property: server version. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerVersionCapabilityV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerVersionCapabilityV2 if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerVersionCapabilityV2. + */ + public static ServerVersionCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerVersionCapabilityV2 deserializedServerVersionCapabilityV2 = new ServerVersionCapabilityV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedServerVersionCapabilityV2.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServerVersionCapabilityV2; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java index 5aac88dffc04..3e7bff367729 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java @@ -1,64 +1,65 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; /** * Resource collection API of Servers. */ public interface Servers { /** - * Deletes a server. + * 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}. */ - void deleteByResourceGroup(String resourceGroupName, String serverName); + Response getByResourceGroupWithResponse(String resourceGroupName, String serverName, Context context); /** - * Deletes a server. + * 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. */ - void delete(String resourceGroupName, String serverName, Context context); + Server getByResourceGroup(String resourceGroupName, String serverName); /** - * Gets information about a server. + * 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 information about a server along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String serverName, Context context); + void deleteByResourceGroup(String resourceGroupName, String serverName); /** - * Gets information about a server. + * 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 information about a server. */ - Server getByResourceGroup(String resourceGroupName, String serverName); + void delete(String resourceGroupName, String serverName, Context context); /** * List all the servers in a given resource group. @@ -67,7 +68,7 @@ public interface Servers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -79,7 +80,7 @@ public interface Servers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -88,7 +89,7 @@ public interface Servers { * * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -99,7 +100,7 @@ public interface Servers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 the response of a Server list operation as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -126,6 +127,36 @@ public interface Servers { */ void failover(String resourceGroupName, String serverName, Context context); + /** + * Validate a deployment of high availability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server along with {@link Response}. + */ + Response validateEstimateHighAvailabilityWithResponse( + String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, + Context context); + + /** + * Validate a deployment of high availability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for validation of high availability deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return high availability validation properties of a server. + */ + HighAvailabilityValidationEstimation validateEstimateHighAvailability(String resourceGroupName, String serverName, + HighAvailabilityValidationEstimationInner parameters); + /** * Restarts a server. * @@ -197,6 +228,59 @@ public interface Servers { */ 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); + + /** + * Detach VNet 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 detach vnet 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 response. + */ + Server detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters); + + /** + * Detach VNet 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 detach vnet 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 response. + */ + Server detachVNet(String resourceGroupName, String serverName, ServerDetachVNetParameter parameters, + Context context); + /** * Gets information about a server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java new file mode 100644 index 000000000000..1be549b5f275 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ServersMigrations. + */ +public interface ServersMigrations { + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Server cutoverMigration(String resourceGroupName, String serverName); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Server cutoverMigration(String resourceGroupName, String serverName, Context context); +} 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 index 5efbc5715f43..6250d94e0882 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,22 +72,6 @@ public Sku withTier(SkuTier tier) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); - } - if (tier() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property tier in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); - /** * {@inheritDoc} */ 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 index f450db96557a..cb3c62088607 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -39,7 +39,7 @@ public final class SkuCapability implements JsonSerializable { /** * Creates an instance of SkuCapability class. */ - public SkuCapability() { + private SkuCapability() { } /** @@ -78,14 +78,6 @@ public Long supportedMemoryPerVCoreMB() { return this.supportedMemoryPerVCoreMB; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java new file mode 100644 index 000000000000..32b83fb02860 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Sku capability. + */ +@Immutable +public final class SkuCapabilityV2 implements JsonSerializable { + /* + * vCore name + */ + private String name; + + /* + * supported vCores + */ + private Long vCores; + + /* + * supported IOPS + */ + private Long supportedIops; + + /* + * supported memory per vCore in MB + */ + private Long supportedMemoryPerVCoreMB; + + /* + * Supported zones + */ + private List supportedZones; + + /* + * Supported high availability mode + */ + private List supportedHAMode; + + /** + * Creates an instance of SkuCapabilityV2 class. + */ + private SkuCapabilityV2() { + } + + /** + * Get the name property: vCore name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the vCores property: supported vCores. + * + * @return the vCores value. + */ + public Long vCores() { + return this.vCores; + } + + /** + * Get the supportedIops property: supported IOPS. + * + * @return the supportedIops value. + */ + public Long supportedIops() { + return this.supportedIops; + } + + /** + * Get the supportedMemoryPerVCoreMB property: supported memory per vCore in MB. + * + * @return the supportedMemoryPerVCoreMB value. + */ + public Long supportedMemoryPerVCoreMB() { + return this.supportedMemoryPerVCoreMB; + } + + /** + * Get the supportedZones property: Supported zones. + * + * @return the supportedZones value. + */ + public List supportedZones() { + return this.supportedZones; + } + + /** + * Get the supportedHAMode property: Supported high availability mode. + * + * @return the supportedHAMode value. + */ + public List supportedHAMode() { + return this.supportedHAMode; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuCapabilityV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuCapabilityV2 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SkuCapabilityV2. + */ + public static SkuCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuCapabilityV2 deserializedSkuCapabilityV2 = new SkuCapabilityV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuCapabilityV2.name = reader.getString(); + } else if ("vCores".equals(fieldName)) { + deserializedSkuCapabilityV2.vCores = reader.getNullable(JsonReader::getLong); + } else if ("supportedIops".equals(fieldName)) { + deserializedSkuCapabilityV2.supportedIops = reader.getNullable(JsonReader::getLong); + } else if ("supportedMemoryPerVCoreMB".equals(fieldName)) { + deserializedSkuCapabilityV2.supportedMemoryPerVCoreMB = reader.getNullable(JsonReader::getLong); + } else if ("supportedZones".equals(fieldName)) { + List supportedZones = reader.readArray(reader1 -> reader1.getString()); + deserializedSkuCapabilityV2.supportedZones = supportedZones; + } else if ("supportedHAMode".equals(fieldName)) { + List supportedHAMode = reader.readArray(reader1 -> reader1.getString()); + deserializedSkuCapabilityV2.supportedHAMode = supportedHAMode; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuCapabilityV2; + }); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java index fbd0df4ca90d..e539b76170ce 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java index 7f18171dd862..16cb5e2217a4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -31,11 +31,26 @@ public final class Storage implements JsonSerializable { */ private EnableStatusEnum autoGrow; + /* + * Enable Log On Disk or not. + */ + private EnableStatusEnum logOnDisk; + /* * The sku name of the server storage. */ private String storageSku; + /* + * Enable IO Auto Scaling or not. + */ + private EnableStatusEnum autoIoScaling; + + /* + * The redundant type of the server storage. The parameter is used for server creation. + */ + private StorageRedundancyEnum storageRedundancy; + /** * Creates an instance of Storage class. */ @@ -102,6 +117,26 @@ public Storage withAutoGrow(EnableStatusEnum autoGrow) { return this; } + /** + * Get the logOnDisk property: Enable Log On Disk or not. + * + * @return the logOnDisk value. + */ + public EnableStatusEnum logOnDisk() { + return this.logOnDisk; + } + + /** + * Set the logOnDisk property: Enable Log On Disk or not. + * + * @param logOnDisk the logOnDisk value to set. + * @return the Storage object itself. + */ + public Storage withLogOnDisk(EnableStatusEnum logOnDisk) { + this.logOnDisk = logOnDisk; + return this; + } + /** * Get the storageSku property: The sku name of the server storage. * @@ -112,11 +147,45 @@ public String storageSku() { } /** - * Validates the instance. + * 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; + } + + /** + * Get the storageRedundancy property: The redundant type of the server storage. The parameter is used for server + * creation. + * + * @return the storageRedundancy value. + */ + public StorageRedundancyEnum storageRedundancy() { + return this.storageRedundancy; + } + + /** + * Set the storageRedundancy property: The redundant type of the server storage. The parameter is used for server + * creation. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param storageRedundancy the storageRedundancy value to set. + * @return the Storage object itself. */ - public void validate() { + public Storage withStorageRedundancy(StorageRedundancyEnum storageRedundancy) { + this.storageRedundancy = storageRedundancy; + return this; } /** @@ -128,6 +197,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("storageSizeGB", this.storageSizeGB); jsonWriter.writeNumberField("iops", this.iops); jsonWriter.writeStringField("autoGrow", this.autoGrow == null ? null : this.autoGrow.toString()); + jsonWriter.writeStringField("logOnDisk", this.logOnDisk == null ? null : this.logOnDisk.toString()); + jsonWriter.writeStringField("autoIoScaling", this.autoIoScaling == null ? null : this.autoIoScaling.toString()); + jsonWriter.writeStringField("storageRedundancy", + this.storageRedundancy == null ? null : this.storageRedundancy.toString()); return jsonWriter.writeEndObject(); } @@ -152,8 +225,14 @@ public static Storage fromJson(JsonReader jsonReader) throws IOException { deserializedStorage.iops = reader.getNullable(JsonReader::getInt); } else if ("autoGrow".equals(fieldName)) { deserializedStorage.autoGrow = EnableStatusEnum.fromString(reader.getString()); + } else if ("logOnDisk".equals(fieldName)) { + deserializedStorage.logOnDisk = EnableStatusEnum.fromString(reader.getString()); } else if ("storageSku".equals(fieldName)) { deserializedStorage.storageSku = reader.getString(); + } else if ("autoIoScaling".equals(fieldName)) { + deserializedStorage.autoIoScaling = EnableStatusEnum.fromString(reader.getString()); + } else if ("storageRedundancy".equals(fieldName)) { + deserializedStorage.storageRedundancy = StorageRedundancyEnum.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java index df4a8a04e679..916be5da3f26 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -41,10 +41,20 @@ public final class StorageEditionCapability implements JsonSerializable { + /** + * Static value LocalRedundancy for StorageRedundancyEnum. + */ + public static final StorageRedundancyEnum LOCAL_REDUNDANCY = fromString("LocalRedundancy"); + + /** + * Static value ZoneRedundancy for StorageRedundancyEnum. + */ + public static final StorageRedundancyEnum ZONE_REDUNDANCY = fromString("ZoneRedundancy"); + + /** + * Creates a new instance of StorageRedundancyEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageRedundancyEnum() { + } + + /** + * Creates or finds a StorageRedundancyEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageRedundancyEnum. + */ + public static StorageRedundancyEnum fromString(String name) { + return fromString(name, StorageRedundancyEnum.class); + } + + /** + * Gets known StorageRedundancyEnum values. + * + * @return known StorageRedundancyEnum values. + */ + public static Collection values() { + return values(StorageRedundancyEnum.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/UserAssignedIdentity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..4951f5f58095 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metadata of user assigned identity. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * Principal Id of user assigned identity + */ + private String principalId; + + /* + * Client Id of user assigned identity + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: Principal Id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: Client Id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} 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 new file mode 100644 index 000000000000..70d648d3fb2a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 index b5ff0cc5e7f8..680616a59855 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; @@ -47,14 +47,6 @@ public VirtualNetworkSubnetUsageParameter withVirtualNetworkResourceId(String vi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index c39d163212fb..b0caaab62954 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.models; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/package-info.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/package-info.java index e9345a0492f9..6da05df0e296 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/package-info.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for MySqlManagementClient. + * Package containing the data models for MySql. * 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. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/package-info.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/package-info.java index 0633a59ebc8f..928b356d9bd7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/package-info.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for MySqlManagementClient. + * Package containing the classes for MySql. * 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. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/module-info.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/module-info.java index 1e00e127bfa2..7573507e12be 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/module-info.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.mysqlflexibleserver { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.mysqlflexibleserver.fluent.models to com.azure.core; opens com.azure.resourcemanager.mysqlflexibleserver.models to com.azure.core; + opens com.azure.resourcemanager.mysqlflexibleserver.implementation.models to com.azure.core; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/azure-resourcemanager-mysqlflexibleserver_apiview_properties.json b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/azure-resourcemanager-mysqlflexibleserver_apiview_properties.json new file mode 100644 index 000000000000..3452d293b898 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/azure-resourcemanager-mysqlflexibleserver_apiview_properties.json @@ -0,0 +1,278 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.beginUpdate": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.beginUpdatePut": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.updatePut", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.get": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.getWithResponse": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.list": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.update": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.updatePut": "Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.updatePut", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient": "Microsoft.DBforMySQL.AzureADAdministrators", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.beginCreateOrUpdate": "Microsoft.DBforMySQL.AzureADAdministrators.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.beginDelete": "Microsoft.DBforMySQL.AzureADAdministrators.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.createOrUpdate": "Microsoft.DBforMySQL.AzureADAdministrators.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.delete": "Microsoft.DBforMySQL.AzureADAdministrators.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.get": "Microsoft.DBforMySQL.AzureADAdministrators.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.getWithResponse": "Microsoft.DBforMySQL.AzureADAdministrators.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.listByServer": "Microsoft.DBforMySQL.AzureADAdministrators.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient": "Microsoft.DBforMySQL.BackupAndExport", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.beginCreate": "Microsoft.DBforMySQL.BackupAndExport.create", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.create": "Microsoft.DBforMySQL.BackupAndExport.create", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.validateBackup": "Microsoft.DBforMySQL.BackupAndExport.validateBackup", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.validateBackupWithResponse": "Microsoft.DBforMySQL.BackupAndExport.validateBackup", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient": "Microsoft.DBforMySQL.Backups", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.get": "Microsoft.DBforMySQL.Backups.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.getWithResponse": "Microsoft.DBforMySQL.Backups.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.listByServer": "Microsoft.DBforMySQL.Backups.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.put": "Microsoft.DBforMySQL.Backups.put", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.putWithResponse": "Microsoft.DBforMySQL.Backups.put", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient": "Microsoft.DBforMySQL.CheckNameAvailability", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient.execute": "Microsoft.DBforMySQL.CheckNameAvailability.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient.executeWithResponse": "Microsoft.DBforMySQL.CheckNameAvailability.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient": "Microsoft.DBforMySQL.CheckNameAvailabilityWithoutLocation", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient.execute": "Microsoft.DBforMySQL.CheckNameAvailabilityWithoutLocation.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient.executeWithResponse": "Microsoft.DBforMySQL.CheckNameAvailabilityWithoutLocation.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient": "Microsoft.DBforMySQL.CheckVirtualNetworkSubnetUsage", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient.execute": "Microsoft.DBforMySQL.CheckVirtualNetworkSubnetUsage.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient.executeWithResponse": "Microsoft.DBforMySQL.CheckVirtualNetworkSubnetUsage.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient": "Microsoft.DBforMySQL.Configurations", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.batchUpdate": "Microsoft.DBforMySQL.Configurations.batchUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.beginBatchUpdate": "Microsoft.DBforMySQL.Configurations.batchUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.beginCreateOrUpdate": "Microsoft.DBforMySQL.Configurations.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.beginUpdate": "Microsoft.DBforMySQL.Configurations.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.createOrUpdate": "Microsoft.DBforMySQL.Configurations.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.get": "Microsoft.DBforMySQL.Configurations.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.getWithResponse": "Microsoft.DBforMySQL.Configurations.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.listByServer": "Microsoft.DBforMySQL.Configurations.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.update": "Microsoft.DBforMySQL.Configurations.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient": "Microsoft.DBforMySQL.Databases", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.beginCreateOrUpdate": "Microsoft.DBforMySQL.Databases.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.beginDelete": "Microsoft.DBforMySQL.Databases.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.createOrUpdate": "Microsoft.DBforMySQL.Databases.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.delete": "Microsoft.DBforMySQL.Databases.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.get": "Microsoft.DBforMySQL.Databases.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.getWithResponse": "Microsoft.DBforMySQL.Databases.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.listByServer": "Microsoft.DBforMySQL.Databases.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient": "Microsoft.DBforMySQL.FirewallRules", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.beginCreateOrUpdate": "Microsoft.DBforMySQL.FirewallRules.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.beginDelete": "Microsoft.DBforMySQL.FirewallRules.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.createOrUpdate": "Microsoft.DBforMySQL.FirewallRules.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.delete": "Microsoft.DBforMySQL.FirewallRules.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.get": "Microsoft.DBforMySQL.FirewallRules.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.getWithResponse": "Microsoft.DBforMySQL.FirewallRules.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.listByServer": "Microsoft.DBforMySQL.FirewallRules.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient": "Microsoft.DBforMySQL.GetPrivateDnsZoneSuffix", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient.execute": "Microsoft.DBforMySQL.GetPrivateDnsZoneSuffix.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient.executeWithResponse": "Microsoft.DBforMySQL.GetPrivateDnsZoneSuffix.execute", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient": "Microsoft.DBforMySQL.LocationBasedCapabilities", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient.list": "Microsoft.DBforMySQL.LocationBasedCapabilities.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient": "Microsoft.DBforMySQL.LocationBasedCapabilitySet", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient.get": "Microsoft.DBforMySQL.LocationBasedCapabilitySet.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient.getWithResponse": "Microsoft.DBforMySQL.LocationBasedCapabilitySet.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient.list": "Microsoft.DBforMySQL.LocationBasedCapabilitySet.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient": "Microsoft.DBforMySQL.LogFiles", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient.listByServer": "Microsoft.DBforMySQL.LogFiles.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient": "Microsoft.DBforMySQL.LongRunningBackup", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient.beginCreate": "Microsoft.DBforMySQL.LongRunningBackup.create", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient.create": "Microsoft.DBforMySQL.LongRunningBackup.create", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient": "Microsoft.DBforMySQL.LongRunningBackups", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient.get": "Microsoft.DBforMySQL.LongRunningBackups.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient.getWithResponse": "Microsoft.DBforMySQL.LongRunningBackups.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient.list": "Microsoft.DBforMySQL.LongRunningBackups.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient": "Microsoft.DBforMySQL.Maintenances", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.beginUpdate": "Microsoft.DBforMySQL.Maintenances.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.list": "Microsoft.DBforMySQL.Maintenances.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.read": "Microsoft.DBforMySQL.Maintenances.read", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.readWithResponse": "Microsoft.DBforMySQL.Maintenances.read", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.update": "Microsoft.DBforMySQL.Maintenances.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient": "Microsoft.DBforMySQL", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient": "Microsoft.DBforMySQL.OperationProgress", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient.get": "Microsoft.DBforMySQL.OperationProgress.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient.getWithResponse": "Microsoft.DBforMySQL.OperationProgress.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient": "Microsoft.DBforMySQL.OperationResults", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient.get": "Microsoft.DBforMySQL.OperationResults.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient.getWithResponse": "Microsoft.DBforMySQL.OperationResults.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient": "Microsoft.DBforMySQL.Operations", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient.list": "Microsoft.DBforMySQL.Operations.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient": "Microsoft.DBforMySQL.PrivateEndpointConnections", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.beginCreateOrUpdate": "Microsoft.DBforMySQL.PrivateEndpointConnections.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.beginDelete": "Microsoft.DBforMySQL.PrivateEndpointConnections.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.createOrUpdate": "Microsoft.DBforMySQL.PrivateEndpointConnections.createOrUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.delete": "Microsoft.DBforMySQL.PrivateEndpointConnections.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.get": "Microsoft.DBforMySQL.PrivateEndpointConnections.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.getWithResponse": "Microsoft.DBforMySQL.PrivateEndpointConnections.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.listByServer": "Microsoft.DBforMySQL.PrivateEndpointConnections.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.listByServerWithResponse": "Microsoft.DBforMySQL.PrivateEndpointConnections.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient": "Microsoft.DBforMySQL.PrivateLinkResources", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient.get": "Microsoft.DBforMySQL.PrivateLinkResources.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient.getWithResponse": "Microsoft.DBforMySQL.PrivateLinkResources.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient.listByServer": "Microsoft.DBforMySQL.PrivateLinkResources.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient": "Microsoft.DBforMySQL.Replicas", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient.listByServer": "Microsoft.DBforMySQL.Replicas.listByServer", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient": "Microsoft.DBforMySQL.Servers", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginCreate": "Microsoft.DBforMySQL.Servers.create", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginDelete": "Microsoft.DBforMySQL.Servers.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginDetachVNet": "Microsoft.DBforMySQL.Servers.detachVNet", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginFailover": "Microsoft.DBforMySQL.Servers.failover", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginResetGtid": "Microsoft.DBforMySQL.Servers.resetGtid", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginRestart": "Microsoft.DBforMySQL.Servers.restart", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginStart": "Microsoft.DBforMySQL.Servers.start", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginStop": "Microsoft.DBforMySQL.Servers.stop", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginUpdate": "Microsoft.DBforMySQL.Servers.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.create": "Microsoft.DBforMySQL.Servers.create", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.delete": "Microsoft.DBforMySQL.Servers.delete", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.detachVNet": "Microsoft.DBforMySQL.Servers.detachVNet", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.failover": "Microsoft.DBforMySQL.Servers.failover", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.getByResourceGroup": "Microsoft.DBforMySQL.Servers.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.getByResourceGroupWithResponse": "Microsoft.DBforMySQL.Servers.get", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.list": "Microsoft.DBforMySQL.Servers.list", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.listByResourceGroup": "Microsoft.DBforMySQL.Servers.listByResourceGroup", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.resetGtid": "Microsoft.DBforMySQL.Servers.resetGtid", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.restart": "Microsoft.DBforMySQL.Servers.restart", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.start": "Microsoft.DBforMySQL.Servers.start", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.stop": "Microsoft.DBforMySQL.Servers.stop", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.update": "Microsoft.DBforMySQL.Servers.update", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.validateEstimateHighAvailability": "Microsoft.DBforMySQL.Servers.validateEstimateHighAvailability", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.validateEstimateHighAvailabilityWithResponse": "Microsoft.DBforMySQL.Servers.validateEstimateHighAvailability", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient": "Microsoft.DBforMySQL.ServersMigration", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient.beginCutoverMigration": "Microsoft.DBforMySQL.ServersMigration.cutoverMigration", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient.cutoverMigration": "Microsoft.DBforMySQL.ServersMigration.cutoverMigration", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdministratorProperties": "Microsoft.DBforMySQL.AdministratorProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner": "Microsoft.DBforMySQL.AdvancedThreatProtection", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionProperties": "Microsoft.DBforMySQL.AdvancedThreatProtectionProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties": "Microsoft.DBforMySQL.AdvancedThreatProtectionUpdateProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner": "Microsoft.DBforMySQL.AzureADAdministrator", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner": "Microsoft.DBforMySQL.BackupAndExportResponse", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseProperties": "Microsoft.DBforMySQL.BackupAndExportResponseProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner": "Microsoft.DBforMySQL.Capability", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner": "Microsoft.DBforMySQL.CapabilityProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesV2": "Microsoft.DBforMySQL.CapabilityPropertiesV2", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationForBatchUpdateProperties": "Microsoft.DBforMySQL.ConfigurationForBatchUpdateProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner": "Microsoft.DBforMySQL.Configuration", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner": "Microsoft.DBforMySQL.ConfigurationListResult", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationProperties": "Microsoft.DBforMySQL.ConfigurationProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner": "Microsoft.DBforMySQL.Database", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseProperties": "Microsoft.DBforMySQL.DatabaseProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner": "Microsoft.DBforMySQL.FirewallRule", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleProperties": "Microsoft.DBforMySQL.FirewallRuleProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner": "Microsoft.DBforMySQL.GetPrivateDnsZoneSuffixResponse", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner": "Microsoft.DBforMySQL.HighAvailabilityValidationEstimation", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner": "Microsoft.DBforMySQL.LogFile", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileProperties": "Microsoft.DBforMySQL.LogFileProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner": "Microsoft.DBforMySQL.Maintenance", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceProperties": "Microsoft.DBforMySQL.MaintenanceProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate": "Microsoft.DBforMySQL.MaintenancePropertiesForUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner": "Microsoft.DBforMySQL.NameAvailability", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner": "Microsoft.DBforMySQL.Operation", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner": "Microsoft.DBforMySQL.OperationProgressResult", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner": "Microsoft.DBforMySQL.OperationStatusExtendedResult", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner": "Microsoft.DBforMySQL.PrivateEndpointConnection", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner": "Azure.ResourceManager.ResourceListResult", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner": "Azure.ResourceManager.CommonTypes.PrivateLinkResource", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner": "Microsoft.DBforMySQL.ServerBackup", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupProperties": "Microsoft.DBforMySQL.ServerBackupProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupPropertiesV2": "Microsoft.DBforMySQL.ServerBackupPropertiesV2", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner": "Microsoft.DBforMySQL.ServerBackupV2", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner": "Microsoft.DBforMySQL.Server", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerProperties": "Microsoft.DBforMySQL.ServerProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerPropertiesForUpdate": "Microsoft.DBforMySQL.ServerPropertiesForUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner": "Microsoft.DBforMySQL.ValidateBackupResponse", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseProperties": "Microsoft.DBforMySQL.ValidateBackupResponseProperties", + "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner": "Microsoft.DBforMySQL.VirtualNetworkSubnetUsageResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder": "Microsoft.DBforMySQL", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdministratorListResult": "Microsoft.DBforMySQL.AdministratorListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdvancedThreatProtectionListResult": "Microsoft.DBforMySQL.AdvancedThreatProtectionListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitiesListResult": "Microsoft.DBforMySQL.CapabilitiesListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitySetsList": "Microsoft.DBforMySQL.CapabilitySetsList", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.DatabaseListResult": "Microsoft.DBforMySQL.DatabaseListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.FirewallRuleListResult": "Microsoft.DBforMySQL.FirewallRuleListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.LogFileListResult": "Microsoft.DBforMySQL.LogFileListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.MaintenanceListResult": "Microsoft.DBforMySQL.MaintenanceListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.OperationListResult": "Microsoft.DBforMySQL.OperationListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.PrivateLinkResourceListResult": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResultV5", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupListResult": "Microsoft.DBforMySQL.ServerBackupListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupV2ListResult": "Microsoft.DBforMySQL.ServerBackupV2ListResult", + "com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerListResult": "Microsoft.DBforMySQL.ServerListResult", + "com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName": "Microsoft.DBforMySQL.AdministratorName", + "com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType": "Microsoft.DBforMySQL.AdministratorType", + "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate": "Microsoft.DBforMySQL.AdvancedThreatProtectionForUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName": "Microsoft.DBforMySQL.AdvancedThreatProtectionName", + "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState": "Microsoft.DBforMySQL.AdvancedThreatProtectionProvisioningState", + "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState": "Microsoft.DBforMySQL.AdvancedThreatProtectionState", + "com.azure.resourcemanager.mysqlflexibleserver.models.Backup": "Microsoft.DBforMySQL.Backup", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest": "Microsoft.DBforMySQL.BackupAndExportRequest", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponseType": "Microsoft.DBforMySQL.BackupAndExportResponseType", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat": "Microsoft.DBforMySQL.BackupFormat", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupRequestBase": "Microsoft.DBforMySQL.BackupRequestBase", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings": "Microsoft.DBforMySQL.BackupSettings", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails": "Microsoft.DBforMySQL.BackupStoreDetails", + "com.azure.resourcemanager.mysqlflexibleserver.models.BackupType": "Microsoft.DBforMySQL.BackupType", + "com.azure.resourcemanager.mysqlflexibleserver.models.BatchOfMaintenance": "Microsoft.DBforMySQL.BatchOfMaintenance", + "com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate": "Microsoft.DBforMySQL.ConfigurationForBatchUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate": "Microsoft.DBforMySQL.ConfigurationListForBatchUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource": "Microsoft.DBforMySQL.ConfigurationSource", + "com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode": "Microsoft.DBforMySQL.CreateMode", + "com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption": "Microsoft.DBforMySQL.DataEncryption", + "com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType": "Microsoft.DBforMySQL.DataEncryptionType", + "com.azure.resourcemanager.mysqlflexibleserver.models.DelegatedSubnetUsage": "Microsoft.DBforMySQL.DelegatedSubnetUsage", + "com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum": "Microsoft.DBforMySQL.EnableStatusEnum", + "com.azure.resourcemanager.mysqlflexibleserver.models.FeatureProperty": "Microsoft.DBforMySQL.FeatureProperty", + "com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails": "Microsoft.DBforMySQL.FullBackupStoreDetails", + "com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability": "Microsoft.DBforMySQL.HighAvailability", + "com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode": "Microsoft.DBforMySQL.HighAvailabilityMode", + "com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityState": "Microsoft.DBforMySQL.HighAvailabilityState", + "com.azure.resourcemanager.mysqlflexibleserver.models.Identity": "Microsoft.DBforMySQL.MySQLServerIdentity", + "com.azure.resourcemanager.mysqlflexibleserver.models.ImportFromStorageResponseType": "Microsoft.DBforMySQL.ImportFromStorageResponseType", + "com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties": "Microsoft.DBforMySQL.ImportSourceProperties", + "com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceStorageType": "Microsoft.DBforMySQL.ImportSourceStorageType", + "com.azure.resourcemanager.mysqlflexibleserver.models.IsConfigPendingRestart": "Microsoft.DBforMySQL.IsConfigPendingRestart", + "com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig": "Microsoft.DBforMySQL.IsDynamicConfig", + "com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly": "Microsoft.DBforMySQL.IsReadOnly", + "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenancePolicy": "Microsoft.DBforMySQL.MaintenancePolicy", + "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState": "Microsoft.DBforMySQL.MaintenanceProvisioningState", + "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState": "Microsoft.DBforMySQL.MaintenanceState", + "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType": "Microsoft.DBforMySQL.MaintenanceType", + "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate": "Microsoft.DBforMySQL.MaintenanceUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow": "Microsoft.DBforMySQL.MaintenanceWindow", + "com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType": "Microsoft.DBforMySQL.ManagedServiceIdentityType", + "com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest": "Microsoft.DBforMySQL.NameAvailabilityRequest", + "com.azure.resourcemanager.mysqlflexibleserver.models.Network": "Microsoft.DBforMySQL.Network", + "com.azure.resourcemanager.mysqlflexibleserver.models.ObjectType": "Microsoft.DBforMySQL.ObjectType", + "com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay": "Microsoft.DBforMySQL.OperationDisplay", + "com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType": "Microsoft.DBforMySQL.OperationProgressResponseType", + "com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus": "Microsoft.DBforMySQL.OperationStatus", + "com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "com.azure.resourcemanager.mysqlflexibleserver.models.Origin": "Microsoft.DBforMySQL.Origin", + "com.azure.resourcemanager.mysqlflexibleserver.models.PatchStrategy": "Microsoft.DBforMySQL.PatchStrategy", + "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", + "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", + "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", + "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", + "com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState": "Microsoft.DBforMySQL.ProvisioningState", + "com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole": "Microsoft.DBforMySQL.ReplicationRole", + "com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault": "Microsoft.DBforMySQL.ResetAllToDefault", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter": "Microsoft.DBforMySQL.ServerDetachVNetParameter", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapability": "Microsoft.DBforMySQL.ServerEditionCapability", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2": "Microsoft.DBforMySQL.ServerEditionCapabilityV2", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate": "Microsoft.DBforMySQL.ServerForUpdate", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter": "Microsoft.DBforMySQL.ServerGtidSetParameter", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter": "Microsoft.DBforMySQL.ServerRestartParameter", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerState": "Microsoft.DBforMySQL.ServerState", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion": "Microsoft.DBforMySQL.ServerVersion", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapability": "Microsoft.DBforMySQL.ServerVersionCapability", + "com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2": "Microsoft.DBforMySQL.ServerVersionCapabilityV2", + "com.azure.resourcemanager.mysqlflexibleserver.models.Sku": "Microsoft.DBforMySQL.MySQLServerSku", + "com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapability": "Microsoft.DBforMySQL.SkuCapability", + "com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapabilityV2": "Microsoft.DBforMySQL.SkuCapabilityV2", + "com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier": "Microsoft.DBforMySQL.ServerSkuTier", + "com.azure.resourcemanager.mysqlflexibleserver.models.Storage": "Microsoft.DBforMySQL.Storage", + "com.azure.resourcemanager.mysqlflexibleserver.models.StorageEditionCapability": "Microsoft.DBforMySQL.StorageEditionCapability", + "com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum": "Microsoft.DBforMySQL.StorageRedundancyEnum", + "com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity": "Microsoft.DBforMySQL.UserAssignedIdentity", + "com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter": "Microsoft.DBforMySQL.VirtualNetworkSubnetUsageParameter" + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/azure-resourcemanager-mysqlflexibleserver_metadata.json b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/azure-resourcemanager-mysqlflexibleserver_metadata.json new file mode 100644 index 000000000000..3dec7cea0db2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/azure-resourcemanager-mysqlflexibleserver_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersion":"2024-12-30","crossLanguageDefinitions":{"com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.beginUpdate":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.beginUpdatePut":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.updatePut","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.get":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.getWithResponse":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.list":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.update":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient.updatePut":"Microsoft.DBforMySQL.AdvancedThreatProtectionSettings.updatePut","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient":"Microsoft.DBforMySQL.AzureADAdministrators","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.beginCreateOrUpdate":"Microsoft.DBforMySQL.AzureADAdministrators.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.beginDelete":"Microsoft.DBforMySQL.AzureADAdministrators.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.createOrUpdate":"Microsoft.DBforMySQL.AzureADAdministrators.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.delete":"Microsoft.DBforMySQL.AzureADAdministrators.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.get":"Microsoft.DBforMySQL.AzureADAdministrators.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.getWithResponse":"Microsoft.DBforMySQL.AzureADAdministrators.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient.listByServer":"Microsoft.DBforMySQL.AzureADAdministrators.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient":"Microsoft.DBforMySQL.BackupAndExport","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.beginCreate":"Microsoft.DBforMySQL.BackupAndExport.create","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.create":"Microsoft.DBforMySQL.BackupAndExport.create","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.validateBackup":"Microsoft.DBforMySQL.BackupAndExport.validateBackup","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient.validateBackupWithResponse":"Microsoft.DBforMySQL.BackupAndExport.validateBackup","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient":"Microsoft.DBforMySQL.Backups","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.get":"Microsoft.DBforMySQL.Backups.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.getWithResponse":"Microsoft.DBforMySQL.Backups.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.listByServer":"Microsoft.DBforMySQL.Backups.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.put":"Microsoft.DBforMySQL.Backups.put","com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient.putWithResponse":"Microsoft.DBforMySQL.Backups.put","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient":"Microsoft.DBforMySQL.CheckNameAvailability","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient.execute":"Microsoft.DBforMySQL.CheckNameAvailability.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient.executeWithResponse":"Microsoft.DBforMySQL.CheckNameAvailability.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient":"Microsoft.DBforMySQL.CheckNameAvailabilityWithoutLocation","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient.execute":"Microsoft.DBforMySQL.CheckNameAvailabilityWithoutLocation.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient.executeWithResponse":"Microsoft.DBforMySQL.CheckNameAvailabilityWithoutLocation.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient":"Microsoft.DBforMySQL.CheckVirtualNetworkSubnetUsage","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient.execute":"Microsoft.DBforMySQL.CheckVirtualNetworkSubnetUsage.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckVirtualNetworkSubnetUsagesClient.executeWithResponse":"Microsoft.DBforMySQL.CheckVirtualNetworkSubnetUsage.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient":"Microsoft.DBforMySQL.Configurations","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.batchUpdate":"Microsoft.DBforMySQL.Configurations.batchUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.beginBatchUpdate":"Microsoft.DBforMySQL.Configurations.batchUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.beginCreateOrUpdate":"Microsoft.DBforMySQL.Configurations.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.beginUpdate":"Microsoft.DBforMySQL.Configurations.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.createOrUpdate":"Microsoft.DBforMySQL.Configurations.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.get":"Microsoft.DBforMySQL.Configurations.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.getWithResponse":"Microsoft.DBforMySQL.Configurations.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.listByServer":"Microsoft.DBforMySQL.Configurations.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.ConfigurationsClient.update":"Microsoft.DBforMySQL.Configurations.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient":"Microsoft.DBforMySQL.Databases","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.beginCreateOrUpdate":"Microsoft.DBforMySQL.Databases.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.beginDelete":"Microsoft.DBforMySQL.Databases.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.createOrUpdate":"Microsoft.DBforMySQL.Databases.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.delete":"Microsoft.DBforMySQL.Databases.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.get":"Microsoft.DBforMySQL.Databases.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.getWithResponse":"Microsoft.DBforMySQL.Databases.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.DatabasesClient.listByServer":"Microsoft.DBforMySQL.Databases.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient":"Microsoft.DBforMySQL.FirewallRules","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.beginCreateOrUpdate":"Microsoft.DBforMySQL.FirewallRules.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.beginDelete":"Microsoft.DBforMySQL.FirewallRules.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.createOrUpdate":"Microsoft.DBforMySQL.FirewallRules.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.delete":"Microsoft.DBforMySQL.FirewallRules.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.get":"Microsoft.DBforMySQL.FirewallRules.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.getWithResponse":"Microsoft.DBforMySQL.FirewallRules.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient.listByServer":"Microsoft.DBforMySQL.FirewallRules.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient":"Microsoft.DBforMySQL.GetPrivateDnsZoneSuffix","com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient.execute":"Microsoft.DBforMySQL.GetPrivateDnsZoneSuffix.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient.executeWithResponse":"Microsoft.DBforMySQL.GetPrivateDnsZoneSuffix.execute","com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient":"Microsoft.DBforMySQL.LocationBasedCapabilities","com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient.list":"Microsoft.DBforMySQL.LocationBasedCapabilities.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient":"Microsoft.DBforMySQL.LocationBasedCapabilitySet","com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient.get":"Microsoft.DBforMySQL.LocationBasedCapabilitySet.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient.getWithResponse":"Microsoft.DBforMySQL.LocationBasedCapabilitySet.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient.list":"Microsoft.DBforMySQL.LocationBasedCapabilitySet.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient":"Microsoft.DBforMySQL.LogFiles","com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient.listByServer":"Microsoft.DBforMySQL.LogFiles.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient":"Microsoft.DBforMySQL.LongRunningBackup","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient.beginCreate":"Microsoft.DBforMySQL.LongRunningBackup.create","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupOperationsClient.create":"Microsoft.DBforMySQL.LongRunningBackup.create","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient":"Microsoft.DBforMySQL.LongRunningBackups","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient.get":"Microsoft.DBforMySQL.LongRunningBackups.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient.getWithResponse":"Microsoft.DBforMySQL.LongRunningBackups.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient.list":"Microsoft.DBforMySQL.LongRunningBackups.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient":"Microsoft.DBforMySQL.Maintenances","com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.beginUpdate":"Microsoft.DBforMySQL.Maintenances.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.list":"Microsoft.DBforMySQL.Maintenances.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.read":"Microsoft.DBforMySQL.Maintenances.read","com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.readWithResponse":"Microsoft.DBforMySQL.Maintenances.read","com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient.update":"Microsoft.DBforMySQL.Maintenances.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient":"Microsoft.DBforMySQL","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient":"Microsoft.DBforMySQL.OperationProgress","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient.get":"Microsoft.DBforMySQL.OperationProgress.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient.getWithResponse":"Microsoft.DBforMySQL.OperationProgress.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient":"Microsoft.DBforMySQL.OperationResults","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient.get":"Microsoft.DBforMySQL.OperationResults.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient.getWithResponse":"Microsoft.DBforMySQL.OperationResults.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient":"Microsoft.DBforMySQL.Operations","com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient.list":"Microsoft.DBforMySQL.Operations.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient":"Microsoft.DBforMySQL.PrivateEndpointConnections","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.beginCreateOrUpdate":"Microsoft.DBforMySQL.PrivateEndpointConnections.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.DBforMySQL.PrivateEndpointConnections.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.createOrUpdate":"Microsoft.DBforMySQL.PrivateEndpointConnections.createOrUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.DBforMySQL.PrivateEndpointConnections.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.DBforMySQL.PrivateEndpointConnections.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.DBforMySQL.PrivateEndpointConnections.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.listByServer":"Microsoft.DBforMySQL.PrivateEndpointConnections.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateEndpointConnectionsClient.listByServerWithResponse":"Microsoft.DBforMySQL.PrivateEndpointConnections.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient":"Microsoft.DBforMySQL.PrivateLinkResources","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient.get":"Microsoft.DBforMySQL.PrivateLinkResources.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient.getWithResponse":"Microsoft.DBforMySQL.PrivateLinkResources.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.PrivateLinkResourcesClient.listByServer":"Microsoft.DBforMySQL.PrivateLinkResources.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient":"Microsoft.DBforMySQL.Replicas","com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient.listByServer":"Microsoft.DBforMySQL.Replicas.listByServer","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient":"Microsoft.DBforMySQL.Servers","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginCreate":"Microsoft.DBforMySQL.Servers.create","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginDelete":"Microsoft.DBforMySQL.Servers.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginDetachVNet":"Microsoft.DBforMySQL.Servers.detachVNet","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginFailover":"Microsoft.DBforMySQL.Servers.failover","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginResetGtid":"Microsoft.DBforMySQL.Servers.resetGtid","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginRestart":"Microsoft.DBforMySQL.Servers.restart","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginStart":"Microsoft.DBforMySQL.Servers.start","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginStop":"Microsoft.DBforMySQL.Servers.stop","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.beginUpdate":"Microsoft.DBforMySQL.Servers.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.create":"Microsoft.DBforMySQL.Servers.create","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.delete":"Microsoft.DBforMySQL.Servers.delete","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.detachVNet":"Microsoft.DBforMySQL.Servers.detachVNet","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.failover":"Microsoft.DBforMySQL.Servers.failover","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.getByResourceGroup":"Microsoft.DBforMySQL.Servers.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.getByResourceGroupWithResponse":"Microsoft.DBforMySQL.Servers.get","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.list":"Microsoft.DBforMySQL.Servers.list","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.listByResourceGroup":"Microsoft.DBforMySQL.Servers.listByResourceGroup","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.resetGtid":"Microsoft.DBforMySQL.Servers.resetGtid","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.restart":"Microsoft.DBforMySQL.Servers.restart","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.start":"Microsoft.DBforMySQL.Servers.start","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.stop":"Microsoft.DBforMySQL.Servers.stop","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.update":"Microsoft.DBforMySQL.Servers.update","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.validateEstimateHighAvailability":"Microsoft.DBforMySQL.Servers.validateEstimateHighAvailability","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient.validateEstimateHighAvailabilityWithResponse":"Microsoft.DBforMySQL.Servers.validateEstimateHighAvailability","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient":"Microsoft.DBforMySQL.ServersMigration","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient.beginCutoverMigration":"Microsoft.DBforMySQL.ServersMigration.cutoverMigration","com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient.cutoverMigration":"Microsoft.DBforMySQL.ServersMigration.cutoverMigration","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdministratorProperties":"Microsoft.DBforMySQL.AdministratorProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner":"Microsoft.DBforMySQL.AdvancedThreatProtection","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionProperties":"Microsoft.DBforMySQL.AdvancedThreatProtectionProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties":"Microsoft.DBforMySQL.AdvancedThreatProtectionUpdateProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner":"Microsoft.DBforMySQL.AzureADAdministrator","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner":"Microsoft.DBforMySQL.BackupAndExportResponse","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseProperties":"Microsoft.DBforMySQL.BackupAndExportResponseProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner":"Microsoft.DBforMySQL.Capability","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner":"Microsoft.DBforMySQL.CapabilityProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesV2":"Microsoft.DBforMySQL.CapabilityPropertiesV2","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationForBatchUpdateProperties":"Microsoft.DBforMySQL.ConfigurationForBatchUpdateProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner":"Microsoft.DBforMySQL.Configuration","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner":"Microsoft.DBforMySQL.ConfigurationListResult","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationProperties":"Microsoft.DBforMySQL.ConfigurationProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner":"Microsoft.DBforMySQL.Database","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseProperties":"Microsoft.DBforMySQL.DatabaseProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner":"Microsoft.DBforMySQL.FirewallRule","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleProperties":"Microsoft.DBforMySQL.FirewallRuleProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner":"Microsoft.DBforMySQL.GetPrivateDnsZoneSuffixResponse","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner":"Microsoft.DBforMySQL.HighAvailabilityValidationEstimation","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner":"Microsoft.DBforMySQL.LogFile","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileProperties":"Microsoft.DBforMySQL.LogFileProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner":"Microsoft.DBforMySQL.Maintenance","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceProperties":"Microsoft.DBforMySQL.MaintenanceProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate":"Microsoft.DBforMySQL.MaintenancePropertiesForUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner":"Microsoft.DBforMySQL.NameAvailability","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner":"Microsoft.DBforMySQL.Operation","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner":"Microsoft.DBforMySQL.OperationProgressResult","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner":"Microsoft.DBforMySQL.OperationStatusExtendedResult","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner":"Microsoft.DBforMySQL.PrivateEndpointConnection","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner":"Azure.ResourceManager.CommonTypes.PrivateLinkResource","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner":"Microsoft.DBforMySQL.ServerBackup","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupProperties":"Microsoft.DBforMySQL.ServerBackupProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupPropertiesV2":"Microsoft.DBforMySQL.ServerBackupPropertiesV2","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner":"Microsoft.DBforMySQL.ServerBackupV2","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner":"Microsoft.DBforMySQL.Server","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerProperties":"Microsoft.DBforMySQL.ServerProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerPropertiesForUpdate":"Microsoft.DBforMySQL.ServerPropertiesForUpdate","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner":"Microsoft.DBforMySQL.ValidateBackupResponse","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseProperties":"Microsoft.DBforMySQL.ValidateBackupResponseProperties","com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner":"Microsoft.DBforMySQL.VirtualNetworkSubnetUsageResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder":"Microsoft.DBforMySQL","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdministratorListResult":"Microsoft.DBforMySQL.AdministratorListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdvancedThreatProtectionListResult":"Microsoft.DBforMySQL.AdvancedThreatProtectionListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitiesListResult":"Microsoft.DBforMySQL.CapabilitiesListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitySetsList":"Microsoft.DBforMySQL.CapabilitySetsList","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.DatabaseListResult":"Microsoft.DBforMySQL.DatabaseListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.FirewallRuleListResult":"Microsoft.DBforMySQL.FirewallRuleListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.LogFileListResult":"Microsoft.DBforMySQL.LogFileListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.MaintenanceListResult":"Microsoft.DBforMySQL.MaintenanceListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.OperationListResult":"Microsoft.DBforMySQL.OperationListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.PrivateLinkResourceListResult":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResultV5","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupListResult":"Microsoft.DBforMySQL.ServerBackupListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupV2ListResult":"Microsoft.DBforMySQL.ServerBackupV2ListResult","com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerListResult":"Microsoft.DBforMySQL.ServerListResult","com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName":"Microsoft.DBforMySQL.AdministratorName","com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType":"Microsoft.DBforMySQL.AdministratorType","com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate":"Microsoft.DBforMySQL.AdvancedThreatProtectionForUpdate","com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName":"Microsoft.DBforMySQL.AdvancedThreatProtectionName","com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState":"Microsoft.DBforMySQL.AdvancedThreatProtectionProvisioningState","com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState":"Microsoft.DBforMySQL.AdvancedThreatProtectionState","com.azure.resourcemanager.mysqlflexibleserver.models.Backup":"Microsoft.DBforMySQL.Backup","com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest":"Microsoft.DBforMySQL.BackupAndExportRequest","com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponseType":"Microsoft.DBforMySQL.BackupAndExportResponseType","com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat":"Microsoft.DBforMySQL.BackupFormat","com.azure.resourcemanager.mysqlflexibleserver.models.BackupRequestBase":"Microsoft.DBforMySQL.BackupRequestBase","com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings":"Microsoft.DBforMySQL.BackupSettings","com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails":"Microsoft.DBforMySQL.BackupStoreDetails","com.azure.resourcemanager.mysqlflexibleserver.models.BackupType":"Microsoft.DBforMySQL.BackupType","com.azure.resourcemanager.mysqlflexibleserver.models.BatchOfMaintenance":"Microsoft.DBforMySQL.BatchOfMaintenance","com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate":"Microsoft.DBforMySQL.ConfigurationForBatchUpdate","com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate":"Microsoft.DBforMySQL.ConfigurationListForBatchUpdate","com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource":"Microsoft.DBforMySQL.ConfigurationSource","com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode":"Microsoft.DBforMySQL.CreateMode","com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption":"Microsoft.DBforMySQL.DataEncryption","com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType":"Microsoft.DBforMySQL.DataEncryptionType","com.azure.resourcemanager.mysqlflexibleserver.models.DelegatedSubnetUsage":"Microsoft.DBforMySQL.DelegatedSubnetUsage","com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum":"Microsoft.DBforMySQL.EnableStatusEnum","com.azure.resourcemanager.mysqlflexibleserver.models.FeatureProperty":"Microsoft.DBforMySQL.FeatureProperty","com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails":"Microsoft.DBforMySQL.FullBackupStoreDetails","com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability":"Microsoft.DBforMySQL.HighAvailability","com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode":"Microsoft.DBforMySQL.HighAvailabilityMode","com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityState":"Microsoft.DBforMySQL.HighAvailabilityState","com.azure.resourcemanager.mysqlflexibleserver.models.Identity":"Microsoft.DBforMySQL.MySQLServerIdentity","com.azure.resourcemanager.mysqlflexibleserver.models.ImportFromStorageResponseType":"Microsoft.DBforMySQL.ImportFromStorageResponseType","com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties":"Microsoft.DBforMySQL.ImportSourceProperties","com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceStorageType":"Microsoft.DBforMySQL.ImportSourceStorageType","com.azure.resourcemanager.mysqlflexibleserver.models.IsConfigPendingRestart":"Microsoft.DBforMySQL.IsConfigPendingRestart","com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig":"Microsoft.DBforMySQL.IsDynamicConfig","com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly":"Microsoft.DBforMySQL.IsReadOnly","com.azure.resourcemanager.mysqlflexibleserver.models.MaintenancePolicy":"Microsoft.DBforMySQL.MaintenancePolicy","com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState":"Microsoft.DBforMySQL.MaintenanceProvisioningState","com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState":"Microsoft.DBforMySQL.MaintenanceState","com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType":"Microsoft.DBforMySQL.MaintenanceType","com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate":"Microsoft.DBforMySQL.MaintenanceUpdate","com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow":"Microsoft.DBforMySQL.MaintenanceWindow","com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType":"Microsoft.DBforMySQL.ManagedServiceIdentityType","com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest":"Microsoft.DBforMySQL.NameAvailabilityRequest","com.azure.resourcemanager.mysqlflexibleserver.models.Network":"Microsoft.DBforMySQL.Network","com.azure.resourcemanager.mysqlflexibleserver.models.ObjectType":"Microsoft.DBforMySQL.ObjectType","com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay":"Microsoft.DBforMySQL.OperationDisplay","com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType":"Microsoft.DBforMySQL.OperationProgressResponseType","com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus":"Microsoft.DBforMySQL.OperationStatus","com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult":"Azure.ResourceManager.CommonTypes.OperationStatusResult","com.azure.resourcemanager.mysqlflexibleserver.models.Origin":"Microsoft.DBforMySQL.Origin","com.azure.resourcemanager.mysqlflexibleserver.models.PatchStrategy":"Microsoft.DBforMySQL.PatchStrategy","com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceProperties":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties","com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState":"Microsoft.DBforMySQL.ProvisioningState","com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole":"Microsoft.DBforMySQL.ReplicationRole","com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault":"Microsoft.DBforMySQL.ResetAllToDefault","com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter":"Microsoft.DBforMySQL.ServerDetachVNetParameter","com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapability":"Microsoft.DBforMySQL.ServerEditionCapability","com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2":"Microsoft.DBforMySQL.ServerEditionCapabilityV2","com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate":"Microsoft.DBforMySQL.ServerForUpdate","com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter":"Microsoft.DBforMySQL.ServerGtidSetParameter","com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter":"Microsoft.DBforMySQL.ServerRestartParameter","com.azure.resourcemanager.mysqlflexibleserver.models.ServerState":"Microsoft.DBforMySQL.ServerState","com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion":"Microsoft.DBforMySQL.ServerVersion","com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapability":"Microsoft.DBforMySQL.ServerVersionCapability","com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2":"Microsoft.DBforMySQL.ServerVersionCapabilityV2","com.azure.resourcemanager.mysqlflexibleserver.models.Sku":"Microsoft.DBforMySQL.MySQLServerSku","com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapability":"Microsoft.DBforMySQL.SkuCapability","com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapabilityV2":"Microsoft.DBforMySQL.SkuCapabilityV2","com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier":"Microsoft.DBforMySQL.ServerSkuTier","com.azure.resourcemanager.mysqlflexibleserver.models.Storage":"Microsoft.DBforMySQL.Storage","com.azure.resourcemanager.mysqlflexibleserver.models.StorageEditionCapability":"Microsoft.DBforMySQL.StorageEditionCapability","com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum":"Microsoft.DBforMySQL.StorageRedundancyEnum","com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity":"Microsoft.DBforMySQL.UserAssignedIdentity","com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter":"Microsoft.DBforMySQL.VirtualNetworkSubnetUsageParameter"},"generatedFiles":["src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilitiesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckNameAvailabilityWithoutLocationsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/CheckVirtualNetworkSubnetUsagesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/DatabasesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/FirewallRulesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/GetPrivateDnsZoneSuffixesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupOperationsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ReplicasClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationForBatchUpdateProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationListResultInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/GetPrivateDnsZoneSuffixResponseInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/HighAvailabilityValidationEstimationInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/NameAvailabilityInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionListResultInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/VirtualNetworkSubnetUsageResultInner.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/package-info.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityPropertiesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationListResultImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabaseImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRuleImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixResponseImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupOperationsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/NameAvailabilityImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionListResultImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/VirtualNetworkSubnetUsageResultImpl.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdministratorListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/AdvancedThreatProtectionListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitiesListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/CapabilitySetsList.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/DatabaseListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/FirewallRuleListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/LogFileListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/MaintenanceListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerBackupListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerBackupV2ListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/models/ServerListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/package-info.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BatchOfMaintenance.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilityProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilities.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckNameAvailabilityWithoutLocations.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CheckVirtualNetworkSubnetUsages.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationForBatchUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationSource.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CreateMode.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryption.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DataEncryptionType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Databases.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/DelegatedSubnetUsage.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/EnableStatusEnum.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FeatureProperty.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRules.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixResponse.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/GetPrivateDnsZoneSuffixes.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityMode.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsConfigPendingRestart.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsDynamicConfig.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/IsReadOnly.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilities.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupOperations.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenancePolicy.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceWindow.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/NameAvailabilityRequest.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operation.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Operations.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Origin.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PatchStrategy.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Replicas.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ReplicationRole.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerDetachVNetParameter.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerRestartParameter.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerState.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersion.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageRedundancyEnum.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageParameter.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/VirtualNetworkSubnetUsageResult.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/package-info.java","src/main/java/com/azure/resourcemanager/mysqlflexibleserver/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json index f98084485868..6bf514085c3e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsClientImpl$CheckNameAvailabilityWithoutLocationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckVirtualNetworkSubnetUsagesClientImpl$CheckVirtualNetworkSubnetUsagesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersClientImpl$ServersService"]] \ No newline at end of file +[["com.azure.resourcemanager.mysqlflexibleserver.implementation.AdvancedThreatProtectionSettingsClientImpl$AdvancedThreatProtectionSettingsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsClientImpl$AzureADAdministratorsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsClientImpl$BackupAndExportsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsClientImpl$CheckNameAvailabilityWithoutLocationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckVirtualNetworkSubnetUsagesClientImpl$CheckVirtualNetworkSubnetUsagesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitySetsClientImpl$LocationBasedCapabilitySetsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupOperationsClientImpl$LongRunningBackupOperationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupsClientImpl$LongRunningBackupsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.MaintenancesClientImpl$MaintenancesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationProgressClientImpl$OperationProgressService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationResultsClientImpl$OperationResultsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersClientImpl$ServersService"],["com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersMigrationsClientImpl$ServersMigrationsService"]] \ No newline at end of file diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/azure-resourcemanager-mysqlflexibleserver.properties b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/azure-resourcemanager-mysqlflexibleserver.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/azure-resourcemanager-mysqlflexibleserver.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java new file mode 100644 index 000000000000..87d0fc16f044 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; + +/** + * Samples for AdvancedThreatProtectionSettings Get. + */ +public final class AdvancedThreatProtectionSettingsGetSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsGet.json + */ + /** + * Sample code: Get a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .getWithResponse("threatprotection-6852", "threatprotection-2080", AdvancedThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java new file mode 100644 index 000000000000..3ef30f8d5476 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for AdvancedThreatProtectionSettings List. + */ +public final class AdvancedThreatProtectionSettingsListSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsList.json + */ + /** + * Sample code: Get list of server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getListOfServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .list("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutSamples.java new file mode 100644 index 000000000000..68732e4b34b8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; + +/** + * Samples for AdvancedThreatProtectionSettings UpdatePut. + */ +public final class AdvancedThreatProtectionSettingsUpdatePutSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPutDisabled.json + */ + /** + * Sample code: Disable a server's Advanced Threat Protection settings with all parameters using PUT. + * + * @param manager Entry point to MySqlManager. + */ + public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParametersUsingPUT( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPutEnabled.json + */ + /** + * Sample code: Enable a server's Advanced Threat Protection settings using PUT. + * + * @param manager Entry point to MySqlManager. + */ + public static void enableAServerSAdvancedThreatProtectionSettingsUsingPUT( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.ENABLED), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.java new file mode 100644 index 000000000000..39b3c3839a2d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; + +/** + * Samples for AdvancedThreatProtectionSettings Update. + */ +public final class AdvancedThreatProtectionSettingsUpdateSamples { + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPatchDisabled.json + */ + /** + * Sample code: Disable a server's Advanced Threat Protection settings with all parameters. + * + * @param manager Entry point to MySqlManager. + */ + public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParameters( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-12-30/AdvancedThreatProtectionSettingsPatchEnabled.json + */ + /** + * Sample code: Enable a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void enableAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.advancedThreatProtectionSettings() + .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..c88dd5025664 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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: 2024-12-30/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 new file mode 100644 index 000000000000..20ce6a085f0d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; + +/** + * Samples for AzureADAdministrators Delete. + */ +public final class AzureADAdministratorsDeleteSamples { + /* + * x-ms-original-file: 2024-12-30/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 new file mode 100644 index 000000000000..ea4751ec4a3c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; + +/** + * Samples for AzureADAdministrators Get. + */ +public final class AzureADAdministratorsGetSamples { + /* + * x-ms-original-file: 2024-12-30/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 new file mode 100644 index 000000000000..76765be913de --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for AzureADAdministrators ListByServer. + */ +public final class AzureADAdministratorsListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/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 new file mode 100644 index 000000000000..157e4426d819 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportCreateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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: 2024-12-30/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 new file mode 100644 index 000000000000..fde98e28ae9c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for BackupAndExport ValidateBackup. + */ +public final class BackupAndExportValidateBackupSamples { + /* + * x-ms-original-file: 2024-12-30/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 index e69f2d1d4cea..6889211090bd 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class BackupsGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupGet.json + * x-ms-original-file: 2024-12-30/BackupGet.json */ /** * Sample code: Get a backup for a server. 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 index 2fda2391d15e..cc58597659ea 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,9 +9,7 @@ */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupsListByServer. - * json + * x-ms-original-file: 2024-12-30/BackupsListByServer.json */ /** * Sample code: List backups for a server. 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 new file mode 100644 index 000000000000..6ec75052f182 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for Backups Put. + */ +public final class BackupsPutSamples { + /* + * x-ms-original-file: 2024-12-30/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 index c1b6e2a85f91..11c5e32348d4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,9 +11,7 @@ */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability - * .json + * x-ms-original-file: 2024-12-30/CheckNameAvailability.json */ /** * Sample code: Check name availability. 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 index 95727377b0f0..fee327c3be30 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,9 +11,7 @@ */ public final class CheckNameAvailabilityWithoutLocationExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability - * .json + * x-ms-original-file: 2024-12-30/CheckNameAvailabilityWithoutLocation.json */ /** * Sample code: Check name availability. 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 index 6eaec0498062..abbe31123913 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,8 +11,7 @@ */ public final class CheckVirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: 2024-12-30/CheckVirtualNetworkSubnetUsage.json */ /** * Sample code: CheckVirtualNetworkSubnetUsage. 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 index d369a0d5aff3..23daa29c509d 100644 --- 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; /** @@ -13,8 +14,7 @@ */ public final class ConfigurationsBatchUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ConfigurationsBatchUpdate.json + * x-ms-original-file: 2024-12-30/ConfigurationsBatchUpdate.json */ /** * Sample code: ConfigurationList. @@ -23,10 +23,9 @@ public final class ConfigurationsBatchUpdateSamples { */ public static void configurationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager.configurations() - .batchUpdate("testrg", "mysqltestserver", - new ConfigurationListForBatchUpdate().withValue( - Arrays.asList(new ConfigurationForBatchUpdate().withName("event_scheduler").withValue("OFF"), - new ConfigurationForBatchUpdate().withName("div_precision_increment").withValue("8"))), - com.azure.core.util.Context.NONE); + .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 new file mode 100644 index 000000000000..dd32a32d5a48 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; + +/** + * Samples for Configurations CreateOrUpdate. + */ +public final class ConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-12-30/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 index 38ee9e034c46..9bf7d3b64e6e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationGet.json + * x-ms-original-file: 2024-12-30/ConfigurationGet.json */ /** * Sample code: Get a configuration. 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/ConfigurationsListByServerSamples.java index 69461ced149f..90ae9ca92a3d 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/ConfigurationsListByServerSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ConfigurationsListByServer.json + * x-ms-original-file: 2024-12-30/ConfigurationsListByServer.json */ /** * Sample code: List all configurations for a server. @@ -19,6 +18,7 @@ public final class ConfigurationsListByServerSamples { */ public static void listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations().listByServer("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); + manager.configurations() + .listByServer("testrg", "mysqltestserver", null, null, 1, 8, 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 index cd819ff71cdc..5505489a4b14 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; /** @@ -12,9 +12,7 @@ */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationUpdate. - * json + * x-ms-original-file: 2024-12-30/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. @@ -22,9 +20,9 @@ public final class ConfigurationsUpdateSamples { * @param manager Entry point to MySqlManager. */ public static void updateAUserConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .update("testrg", "testserver", "event_scheduler", - new ConfigurationInner().withValue("on").withSource(ConfigurationSource.USER_OVERRIDE), - com.azure.core.util.Context.NONE); + 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 index 5543d3b765d6..84251f6cee23 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class DatabasesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseCreate.json + * x-ms-original-file: 2024-12-30/DatabaseCreate.json */ /** * Sample code: Create a database. 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 index 0ba85b0be698..5d900271cc49 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseDelete.json + * x-ms-original-file: 2024-12-30/DatabaseDelete.json */ /** * Sample code: Delete a database. 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 index 2096eb51e141..b8d70e99263a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class DatabasesGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseGet.json + * x-ms-original-file: 2024-12-30/DatabaseGet.json */ /** * Sample code: Get a database. 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 index 1d26e9557036..c96fb1fb72d6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,9 +9,7 @@ */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabasesListByServer - * .json + * x-ms-original-file: 2024-12-30/DatabasesListByServer.json */ /** * Sample code: List databases in a server. 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 index c81978d9fbf6..33f9b9c04119 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,9 +9,7 @@ */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleCreate. - * json + * x-ms-original-file: 2024-12-30/FirewallRuleCreate.json */ /** * Sample code: Create a firewall rule. 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 index e7f5c989b689..ca67b081d35f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,9 +9,7 @@ */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleDelete. - * json + * x-ms-original-file: 2024-12-30/FirewallRuleDelete.json */ /** * Sample code: Delete a firewall rule. 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 index ff298c63d432..6a69b0d17433 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleGet.json + * x-ms-original-file: 2024-12-30/FirewallRuleGet.json */ /** * Sample code: Get a firewall rule. 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 index 6aedf1af631b..c596c3ff473f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * FirewallRulesListByServer.json + * x-ms-original-file: 2024-12-30/FirewallRulesListByServer.json */ /** * Sample code: List all firewall rules in a server. 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 index 5c1eb5c6f4ed..42c238134770 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * GetPrivateDnsZoneSuffix.json + * x-ms-original-file: 2024-12-30/GetPrivateDnsZoneSuffix.json */ /** * Sample code: GetPrivateDnsZoneSuffix. 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 index 58d367514e57..d2a2c81e4592 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class LocationBasedCapabilitiesListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * CapabilitiesByLocationList.json + * x-ms-original-file: 2024-12-30/CapabilitiesByLocationList.json */ /** * Sample code: CapabilitiesList. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java new file mode 100644 index 000000000000..c18ba34bf4b5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for LocationBasedCapabilitySet Get. + */ +public final class LocationBasedCapabilitySetGetSamples { + /* + * x-ms-original-file: 2024-12-30/CapabilitySetByLocation.json + */ + /** + * Sample code: CapabilityResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilityResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().getWithResponse("WestUS", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java new file mode 100644 index 000000000000..66dcdb9665f0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for LocationBasedCapabilitySet List. + */ +public final class LocationBasedCapabilitySetListSamples { + /* + * x-ms-original-file: 2024-12-30/CapabilitySetListByLocation.json + */ + /** + * Sample code: CapabilitySetsResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilitySetsResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().list("WestUS", com.azure.core.util.Context.NONE); + } +} 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/LogFilesListByServerSamples.java new file mode 100644 index 000000000000..c54f86283f32 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for LogFiles ListByServer. + */ +public final class LogFilesListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/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); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupOperationCreateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupOperationCreateSamples.java new file mode 100644 index 000000000000..2cb91b6ddde9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupOperationCreateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for LongRunningBackupOperation Create. + */ +public final class LongRunningBackupOperationCreateSamples { + /* + * x-ms-original-file: 2024-12-30/LongRunningBackup.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.longRunningBackupOperations() + .define("testback") + .withExistingFlexibleServer("TestGroup", "mysqltestserver") + .create(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsGetSamples.java new file mode 100644 index 000000000000..2e12e0cf5527 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for LongRunningBackups Get. + */ +public final class LongRunningBackupsGetSamples { + /* + * x-ms-original-file: 2024-12-30/LongRunningBackupGet.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.longRunningBackups() + .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/LongRunningBackupsListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsListSamples.java new file mode 100644 index 000000000000..6b89939264e8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for LongRunningBackups List. + */ +public final class LongRunningBackupsListSamples { + /* + * x-ms-original-file: 2024-12-30/LongRunningBackupsListByServer.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.longRunningBackups().list("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListSamples.java new file mode 100644 index 000000000000..086013de83ab --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for Maintenances List. + */ +public final class MaintenancesListSamples { + /* + * x-ms-original-file: 2024-12-30/MaintenancesListByServer.json + */ + /** + * Sample code: List maintenances on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void listMaintenancesOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.maintenances().list("TestGroup", "testserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadSamples.java new file mode 100644 index 000000000000..d5f1b7d4f054 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for Maintenances Read. + */ +public final class MaintenancesReadSamples { + /* + * x-ms-original-file: 2024-12-30/MaintenanceRead.json + */ + /** + * Sample code: Read a maintenance. + * + * @param manager Entry point to MySqlManager. + */ + public static void readAMaintenance(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.maintenances() + .readWithResponse("TestGroup", "testserver", "_T9Q-TS8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateSamples.java new file mode 100644 index 000000000000..c836986939f2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; +import java.time.OffsetDateTime; + +/** + * Samples for Maintenances Update. + */ +public final class MaintenancesUpdateSamples { + /* + * x-ms-original-file: 2024-12-30/MaintenanceUpdate.json + */ + /** + * Sample code: Update maintenance on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void updateMaintenanceOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.maintenances() + .update("TestGroup", "testserver", "_T9Q-TS8", + new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2024-01-20T00:00:00")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressGetSamples.java new file mode 100644 index 000000000000..a943faee23b6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressGetSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for OperationProgress Get. + */ +public final class OperationProgressGetSamples { + /* + * x-ms-original-file: 2024-12-30/OperationProgress_Get_BackupAndExport.json + */ + /** + * Sample code: OperationProgress_Get BackupAndExport. + * + * @param manager Entry point to MySqlManager. + */ + public static void + operationProgressGetBackupAndExport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operationProgress() + .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-12-30/OperationProgress_Get_ImportFromStorage.json + */ + /** + * Sample code: OperationProgress_Get ImportFromStorage. + * + * @param manager Entry point to MySqlManager. + */ + public static void + operationProgressGetImportFromStorage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operationProgress() + .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationResultsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationResultsGetSamples.java new file mode 100644 index 000000000000..bdce43c91ec0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationResultsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for OperationResults Get. + */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: 2024-12-30/OperationResults_Get.json + */ + /** + * Sample code: OperationResults_Get. + * + * @param manager Entry point to MySqlManager. + */ + public static void operationResultsGet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.operationResults() + .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} 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 index d942d709cbd5..afaf3e9b1201 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/OperationsList.json + * x-ms-original-file: 2024-12-30/OperationsList.json */ /** * Sample code: OperationList. 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..90c511863b3b --- /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) TypeSpec 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: 2024-12-30/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..76ccc633f70c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2024-12-30/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..ca372b124806 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2024-12-30/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..88c5029c07ec --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for PrivateEndpointConnections ListByServer. + */ +public final class PrivateEndpointConnectionsListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/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/PrivateLinkResourcesGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..68a7d22652e0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2024-12-30/PrivateLinkResourcesGet.json + */ + /** + * Sample code: Gets a private link resource for MySQL. + * + * @param manager Entry point to MySqlManager. + */ + public static void + getsAPrivateLinkResourceForMySQL(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + 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/PrivateLinkResourcesListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java new file mode 100644 index 000000000000..f6abe13b416d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for PrivateLinkResources ListByServer. + */ +public final class PrivateLinkResourcesListByServerSamples { + /* + * x-ms-original-file: 2024-12-30/PrivateLinkResourcesList.json + */ + /** + * Sample code: Gets private link resources for MySQL. + * + * @param manager Entry point to MySqlManager. + */ + public static void + getsPrivateLinkResourcesForMySQL(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.privateLinkResources().listByServer("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 index cb3636061675..d9b542ff7d48 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,9 +9,7 @@ */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ReplicasListByServer. - * json + * x-ms-original-file: 2024-12-30/ReplicasListByServer.json */ /** * Sample code: List replicas for a server. 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 index 8892b68fa11e..8a42557b438e 100644 --- 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 @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -19,7 +17,8 @@ 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 com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -29,9 +28,7 @@ */ public final class ServersCreateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateReplica. - * json + * x-ms-original-file: 2024-12-30/ServerCreateReplica.json */ /** * Sample code: Create a replica server. @@ -50,8 +47,41 @@ public static void createAReplicaServer(com.azure.resourcemanager.mysqlflexibles } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreate.json + * x-ms-original-file: 2024-12-30/ServerCreateWithDatabasePort.json + */ + /** + * Sample code: Create a server with non-default database port. + * + * @param manager Entry point to MySqlManager. + */ + public static void + createAServerWithNonDefaultDatabasePort(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) + .withDatabasePort(8888) + .withStorage(new Storage().withStorageSizeGB(100) + .withIops(600) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY)) + .withBackup(new Backup().withBackupRetentionDays(7) + .withBackupIntervalHours(24) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) + .withHighAvailability( + new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) + .create(); + } + + /* + * x-ms-original-file: 2024-12-30/ServerCreate.json */ /** * Sample code: Create a new server. @@ -70,25 +100,27 @@ public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserve .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)) + .withStorage(new Storage().withStorageSizeGB(100) + .withIops(600) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.ZONE_REDUNDANCY)) + .withBackup(new Backup().withBackupRetentionDays(7) + .withBackupIntervalHours(24) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateWithBYOK. - * json + * x-ms-original-file: 2024-12-30/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 { + public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager.servers() .define("mysqltestserver") .withRegion("southeastasia") @@ -97,8 +129,7 @@ public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexible .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)))) + new UserAssignedIdentity()))) .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") @@ -112,16 +143,20 @@ public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexible "/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)) + .withStorage(new Storage().withStorageSizeGB(100) + .withIops(600) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY)) + .withBackup(new Backup().withBackupRetentionDays(7) + .withBackupIntervalHours(24) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ServerCreateWithPointInTimeRestore.json + * x-ms-original-file: 2024-12-30/ServerCreateWithPointInTimeRestore.json */ /** * Sample code: Create a server as a point in time restore. 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 index 5fc5b56534f6..f1ff4957d616 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ServersDeleteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerDelete.json + * x-ms-original-file: 2024-12-30/ServerDelete.json */ /** * Sample code: Delete a server. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDetachVNetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDetachVNetSamples.java new file mode 100644 index 000000000000..64b3978ac1b6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDetachVNetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; + +/** + * Samples for Servers DetachVNet. + */ +public final class ServersDetachVNetSamples { + /* + * x-ms-original-file: 2024-12-30/ServerDetachVNet.json + */ + /** + * Sample code: Detach VNet on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void detachVNetOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.servers() + .detachVNet("TestGroup", "testserver", + new ServerDetachVNetParameter().withPublicNetworkAccess(EnableStatusEnum.ENABLED), + 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 index b53fe6ae9c64..ec36ec9ff37d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ServersFailoverSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerFailover.json + * x-ms-original-file: 2024-12-30/ServerFailover.json */ /** * Sample code: Restart a server. 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 index 422b2f4268a6..5e50bf831180 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,9 +9,7 @@ */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGetWithVnet. - * json + * x-ms-original-file: 2024-12-30/ServerGetWithVnet.json */ /** * Sample code: Get a server with vnet. @@ -23,8 +21,7 @@ public static void getAServerWithVnet(com.azure.resourcemanager.mysqlflexibleser } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGet.json + * x-ms-original-file: 2024-12-30/ServerGet.json */ /** * Sample code: Get a server. 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 index a79205ec23b1..04bfda3cdfb4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ServersListByResourceGroup.json + * x-ms-original-file: 2024-12-30/ServersListByResourceGroup.json */ /** * Sample code: List servers in a resource group. 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 index 9fc89d4e8a5f..0be6f3391be9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ServersListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServersList.json + * x-ms-original-file: 2024-12-30/ServersList.json */ /** * Sample code: List servers in a subscription. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersMigrationCutoverMigrationSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersMigrationCutoverMigrationSamples.java new file mode 100644 index 000000000000..8cde5a107db1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersMigrationCutoverMigrationSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** + * Samples for ServersMigration CutoverMigration. + */ +public final class ServersMigrationCutoverMigrationSamples { + /* + * x-ms-original-file: 2024-12-30/CutoverMigration.json + */ + /** + * Sample code: Cutover migration for MySQL import. + * + * @param manager Entry point to MySqlManager. + */ + public static void + cutoverMigrationForMySQLImport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.serversMigrations().cutoverMigration("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/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 new file mode 100644 index 000000000000..b512ebf53406 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; + +/** + * Samples for Servers ResetGtid. + */ +public final class ServersResetGtidSamples { + /* + * x-ms-original-file: 2024-12-30/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 index 9195ace4e974..5c9cf9a1fc36 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,8 +12,7 @@ */ public final class ServersRestartSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerRestart.json + * x-ms-original-file: 2024-12-30/ServerRestart.json */ /** * Sample code: Restart a server. 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 index dab724281ca4..3861210bd084 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ServersStartSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStart.json + * x-ms-original-file: 2024-12-30/ServerStart.json */ /** * Sample code: Start a server. 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 index 7bcc3d97a49c..159218d3f3e3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -9,8 +9,7 @@ */ public final class ServersStopSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStop.json + * x-ms-original-file: 2024-12-30/ServerStop.json */ /** * Sample code: Stop a server. 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 index 465070c2db89..61221a87b264 100644 --- 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 @@ -1,20 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.BatchOfMaintenance; 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.MaintenancePolicy; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.mysqlflexibleserver.models.Network; +import com.azure.resourcemanager.mysqlflexibleserver.models.PatchStrategy; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import java.io.IOException; +import com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; @@ -23,8 +26,7 @@ */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ - * ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: 2024-12-30/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: Update server customer maintenance window. @@ -40,22 +42,56 @@ public final class ServersUpdateSamples { .withMaintenanceWindow(new MaintenanceWindow().withCustomWindow("Enabled") .withStartHour(8) .withStartMinute(0) - .withDayOfWeek(1)) + .withDayOfWeek(1) + .withBatchOfMaintenance(BatchOfMaintenance.BATCH1)) .apply(); } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdateWithBYOK. - * json + * x-ms-original-file: 2024-12-30/MaintenancePolicyPatchOptInVirtualCanary.json + */ + /** + * Sample code: Update server to opt in virtual canary. + * + * @param manager Entry point to MySqlManager. + */ + public static void + updateServerToOptInVirtualCanary(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + Server resource = manager.servers() + .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withMaintenancePolicy(new MaintenancePolicy().withPatchStrategy(PatchStrategy.VIRTUAL_CANARY)) + .apply(); + } + + /* + * x-ms-original-file: 2024-12-30/MaintenancePolicyPatchOptOutVirtualCanary.json + */ + /** + * Sample code: Update server to opt out virtual canary. + * + * @param manager Entry point to MySqlManager. + */ + public static void + updateServerToOptOutVirtualCanary(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + Server resource = manager.servers() + .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withMaintenancePolicy(new MaintenancePolicy().withPatchStrategy(PatchStrategy.fromString("Default"))) + .apply(); + } + + /* + * x-ms-original-file: 2024-12-30/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 { + public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { Server resource = manager.servers() .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); @@ -63,8 +99,7 @@ public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibles .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)))) + new UserAssignedIdentity()))) .withDataEncryption(new DataEncryption().withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity") .withPrimaryKeyUri("fakeTokenPlaceholder") @@ -76,8 +111,7 @@ public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibles } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdate.json + * x-ms-original-file: 2024-12-30/ServerUpdate.json */ /** * Sample code: Update a server. @@ -89,7 +123,12 @@ public static void updateAServer(com.azure.resourcemanager.mysqlflexibleserver.M .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withStorage(new Storage().withStorageSizeGB(30).withIops(200).withAutoGrow(EnableStatusEnum.DISABLED)) + .withStorage(new Storage().withStorageSizeGB(30) + .withIops(200) + .withAutoGrow(EnableStatusEnum.DISABLED) + .withAutoIoScaling(EnableStatusEnum.DISABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY)) + .withNetwork(new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED)) .apply(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilitySamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilitySamples.java new file mode 100644 index 000000000000..5cc5228062b2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; + +/** + * Samples for Servers ValidateEstimateHighAvailability. + */ +public final class ServersValidateEstimateHighAvailabilitySamples { + /* + * x-ms-original-file: 2024-12-30/ServerValidateEstimateHighAvailability.json + */ + /** + * Sample code: Validate a validation and estimation of high availability. + * + * @param manager Entry point to MySqlManager. + */ + public static void validateAValidationAndEstimationOfHighAvailability( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.servers() + .validateEstimateHighAvailabilityWithResponse("TestGroup", "testserver", + new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("1"), + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..44c2b63029b4 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdministratorListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +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\":\"mkjozkrwf\",\"sid\":\"iodjp\",\"tenantId\":\"w\",\"identityResourceId\":\"dpvwryoqpsoaccta\"},\"id\":\"kljla\",\"name\":\"bcryffdfd\",\"type\":\"sy\"},{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"ojakhmsbzjhcrze\",\"sid\":\"phlxa\",\"tenantId\":\"thqt\",\"identityResourceId\":\"qjbpfzfsin\"},\"id\":\"v\",\"name\":\"cjrwzoxxjtfellu\",\"type\":\"fziton\"},{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"jkjlxofpdvhpfx\",\"sid\":\"pini\",\"tenantId\":\"ayhuy\",\"identityResourceId\":\"kpode\"},\"id\":\"oginuvamiheognar\",\"name\":\"zxtheotusivyevcc\",\"type\":\"qi\"},{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"gbwjzrnf\",\"sid\":\"xgispemvtzfkufu\",\"tenantId\":\"jofxqe\",\"identityResourceId\":\"jaeq\"},\"id\":\"qjbasvms\",\"name\":\"jqul\",\"type\":\"gsntnbybkzgcwr\"}],\"nextLink\":\"lxxwrljdouskc\"}") + .toObject(AdministratorListResult.class); + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); + Assertions.assertEquals("mkjozkrwf", model.value().get(0).login()); + Assertions.assertEquals("iodjp", model.value().get(0).sid()); + Assertions.assertEquals("w", model.value().get(0).tenantId()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.value().get(0).identityResourceId()); + Assertions.assertEquals("lxxwrljdouskc", 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 new file mode 100644 index 000000000000..2536cb577030 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":\"xj\",\"sid\":\"r\",\"tenantId\":\"vcputegj\",\"identityResourceId\":\"mfdatscmdvpj\"}") + .toObject(AdministratorProperties.class); + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); + Assertions.assertEquals("xj", model.login()); + Assertions.assertEquals("r", model.sid()); + Assertions.assertEquals("vcputegj", model.tenantId()); + Assertions.assertEquals("mfdatscmdvpj", model.identityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdministratorProperties model + = new AdministratorProperties().withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) + .withLogin("xj") + .withSid("r") + .withTenantId("vcputegj") + .withIdentityResourceId("mfdatscmdvpj"); + model = BinaryData.fromObject(model).toObject(AdministratorProperties.class); + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); + Assertions.assertEquals("xj", model.login()); + Assertions.assertEquals("r", model.sid()); + Assertions.assertEquals("vcputegj", model.tenantId()); + Assertions.assertEquals("mfdatscmdvpj", model.identityResourceId()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionForUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionForUpdateTests.java new file mode 100644 index 000000000000..b26ca675cb4a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionForUpdateTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedThreatProtectionForUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedThreatProtectionForUpdate model = BinaryData.fromString("{\"properties\":{\"state\":\"Enabled\"}}") + .toObject(AdvancedThreatProtectionForUpdate.class); + Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedThreatProtectionForUpdate model + = new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED); + model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionForUpdate.class); + Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionInnerTests.java new file mode 100644 index 000000000000..d52ef2dd8bed --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedThreatProtectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedThreatProtectionInner model = BinaryData.fromString( + "{\"properties\":{\"creationTime\":\"2021-01-25T12:50:37Z\",\"state\":\"Disabled\",\"provisioningState\":\"Failed\"},\"id\":\"mx\",\"name\":\"gkvtmelmqkrhah\",\"type\":\"ljuahaquhcdh\"}") + .toObject(AdvancedThreatProtectionInner.class); + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedThreatProtectionInner model + = new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED); + model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionInner.class); + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, model.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionListResultTests.java new file mode 100644 index 000000000000..8b711afed252 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.AdvancedThreatProtectionListResult; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedThreatProtectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedThreatProtectionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"creationTime\":\"2021-07-14T10:18:55Z\",\"state\":\"Enabled\",\"provisioningState\":\"Canceled\"},\"id\":\"gvxp\",\"name\":\"gomz\",\"type\":\"fmisg\"},{\"properties\":{\"creationTime\":\"2021-11-20T05:31:55Z\",\"state\":\"Enabled\",\"provisioningState\":\"Canceled\"},\"id\":\"wkz\",\"name\":\"ali\",\"type\":\"urqhaka\"}],\"nextLink\":\"ashsfwxos\"}") + .toObject(AdvancedThreatProtectionListResult.class); + Assertions.assertEquals("ashsfwxos", model.nextLink()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionPropertiesTests.java new file mode 100644 index 000000000000..020c1c7b01ac --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedThreatProtectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedThreatProtectionProperties model = BinaryData + .fromString( + "{\"creationTime\":\"2021-09-30T04:12:01Z\",\"state\":\"Enabled\",\"provisioningState\":\"Succeeded\"}") + .toObject(AdvancedThreatProtectionProperties.class); + Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedThreatProtectionProperties model + = new AdvancedThreatProtectionProperties().withState(AdvancedThreatProtectionState.ENABLED); + model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionProperties.class); + Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1de8ce26a29f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AdvancedThreatProtectionSettingsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"creationTime\":\"2021-02-26T09:14:31Z\",\"state\":\"Enabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"lnzonzlrpiqywn\",\"name\":\"vjtszcofize\",\"type\":\"tdhgbjkvrelj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() + .getWithResponse("vfcdisyirn", "zhczexrxzbujrtrh", AdvancedThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java new file mode 100644 index 000000000000..4524e3438cea --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AdvancedThreatProtectionSettingsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"creationTime\":\"2021-10-21T16:39:12Z\",\"state\":\"Disabled\",\"provisioningState\":\"Updating\"},\"id\":\"uurutlwexxwlalni\",\"name\":\"xzsrzpge\",\"type\":\"q\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.advancedThreatProtectionSettings() + .list("rrwoycqucwyhahn", "mdr", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, response.iterator().next().state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java new file mode 100644 index 000000000000..d357cfb35cad --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AdvancedThreatProtectionSettingsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"creationTime\":\"2021-07-22T16:55:51Z\",\"state\":\"Disabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"cqpbtuo\",\"name\":\"xesz\",\"type\":\"bbelawumuaslzk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() + .update("chxgs", "boldforobwj", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, response.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java new file mode 100644 index 000000000000..2254a0e4120e --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AdvancedThreatProtectionSettingsUpdatePutMockTests { + @Test + public void testUpdatePut() throws Exception { + String responseStr + = "{\"properties\":{\"creationTime\":\"2021-10-20T05:48:16Z\",\"state\":\"Disabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"mkdasv\",\"name\":\"lyhb\",\"type\":\"cu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() + .updatePut("amurvzmlovuan", "shcxlpmjerbdk", AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, response.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java new file mode 100644 index 000000000000..981b46ca6765 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import org.junit.jupiter.api.Assertions; + +public final class AdvancedThreatProtectionUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdvancedThreatProtectionUpdateProperties model = BinaryData.fromString("{\"state\":\"Disabled\"}") + .toObject(AdvancedThreatProtectionUpdateProperties.class); + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdvancedThreatProtectionUpdateProperties model + = new AdvancedThreatProtectionUpdateProperties().withState(AdvancedThreatProtectionState.DISABLED); + model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionUpdateProperties.class); + Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, model.state()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java new file mode 100644 index 000000000000..f4f65aae4127 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":\"ccsnhsjc\",\"sid\":\"ejhkry\",\"tenantId\":\"napczwlokjy\",\"identityResourceId\":\"kkvnipjox\"},\"id\":\"nchgej\",\"name\":\"podmailzydehojwy\",\"type\":\"huxinpmqnj\"}") + .toObject(AzureADAdministratorInner.class); + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); + Assertions.assertEquals("ccsnhsjc", model.login()); + Assertions.assertEquals("ejhkry", model.sid()); + Assertions.assertEquals("napczwlokjy", model.tenantId()); + Assertions.assertEquals("kkvnipjox", model.identityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AzureADAdministratorInner model + = new AzureADAdministratorInner().withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) + .withLogin("ccsnhsjc") + .withSid("ejhkry") + .withTenantId("napczwlokjy") + .withIdentityResourceId("kkvnipjox"); + model = BinaryData.fromObject(model).toObject(AzureADAdministratorInner.class); + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); + Assertions.assertEquals("ccsnhsjc", model.login()); + Assertions.assertEquals("ejhkry", model.sid()); + Assertions.assertEquals("napczwlokjy", model.tenantId()); + Assertions.assertEquals("kkvnipjox", 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 new file mode 100644 index 000000000000..53ccd15e3eae --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureADAdministratorsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"cje\",\"sid\":\"izsh\",\"tenantId\":\"cimpevfg\",\"identityResourceId\":\"lrri\"},\"id\":\"ywdxsmic\",\"name\":\"wrwfscjfnyns\",\"type\":\"qujizdvo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AzureADAdministrator response = manager.azureADAdministrators() + .define(AdministratorName.ACTIVE_DIRECTORY) + .withExistingFlexibleServer("phwzsoldweyuqdu", "vmnnrw") + .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) + .withLogin("talywjhhgdnhxms") + .withSid("fomiloxgg") + .withTenantId("fi") + .withIdentityResourceId("dieuzaofj") + .create(); + + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); + Assertions.assertEquals("cje", response.login()); + Assertions.assertEquals("izsh", response.sid()); + Assertions.assertEquals("cimpevfg", response.tenantId()); + Assertions.assertEquals("lrri", 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 new file mode 100644 index 000000000000..f2ef8beaf9bc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureADAdministratorsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.azureADAdministrators() + .delete("qubkw", "lenrd", 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 new file mode 100644 index 000000000000..1801c63fe1c0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureADAdministratorsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"utacoe\",\"sid\":\"vewzcj\",\"tenantId\":\"m\",\"identityResourceId\":\"pmguaadraufac\"},\"id\":\"ahzovajjziuxxp\",\"name\":\"hneekul\",\"type\":\"gs\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AzureADAdministrator response = manager.azureADAdministrators() + .getWithResponse("kmr", "emvvhm", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); + Assertions.assertEquals("utacoe", response.login()); + Assertions.assertEquals("vewzcj", response.sid()); + Assertions.assertEquals("m", response.tenantId()); + Assertions.assertEquals("pmguaadraufac", 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 new file mode 100644 index 000000000000..216cc213b4d9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; +import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureADAdministratorsListByServerMockTests { + @Test + public void testListByServer() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"xwmygdxpgpqc\",\"sid\":\"sze\",\"tenantId\":\"nb\",\"identityResourceId\":\"rxgibbd\"},\"id\":\"confozauors\",\"name\":\"kokwbqplhlvnu\",\"type\":\"epzl\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.azureADAdministrators() + .listByServer("tujbazpju", "hminyflnorwmduv", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.iterator().next().administratorType()); + Assertions.assertEquals("xwmygdxpgpqc", response.iterator().next().login()); + Assertions.assertEquals("sze", response.iterator().next().sid()); + Assertions.assertEquals("nb", response.iterator().next().tenantId()); + Assertions.assertEquals("rxgibbd", 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 new file mode 100644 index 000000000000..1417d5e14a45 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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\":\"j\",\"backupFormat\":\"CollatedFormat\"}}") + .toObject(BackupAndExportRequest.class); + Assertions.assertEquals("j", 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("j").withBackupFormat(BackupFormat.COLLATED_FORMAT)) + .withTargetDetails(new BackupStoreDetails()); + model = BinaryData.fromObject(model).toObject(BackupAndExportRequest.class); + Assertions.assertEquals("j", 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/BackupAndExportResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java new file mode 100644 index 000000000000..f16a5aa16c49 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":6539165195191138732,\"dataTransferredInBytes\":7483710999223718182,\"backupMetadata\":\"aqsqsycbkbfk\"}") + .toObject(BackupAndExportResponseProperties.class); + Assertions.assertEquals(6539165195191138732L, model.datasourceSizeInBytes()); + Assertions.assertEquals(7483710999223718182L, model.dataTransferredInBytes()); + Assertions.assertEquals("aqsqsycbkbfk", model.backupMetadata()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java new file mode 100644 index 000000000000..6f564fa1c2ad --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponseType; +import org.junit.jupiter.api.Assertions; + +public final class BackupAndExportResponseTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BackupAndExportResponseType model = BinaryData.fromString( + "{\"objectType\":\"BackupAndExportResponse\",\"datasourceSizeInBytes\":8916570711298227997,\"dataTransferredInBytes\":9061974154322303797,\"backupMetadata\":\"xhwgfwsrtaw\"}") + .toObject(BackupAndExportResponseType.class); + Assertions.assertEquals(8916570711298227997L, model.datasourceSizeInBytes()); + Assertions.assertEquals(9061974154322303797L, model.dataTransferredInBytes()); + Assertions.assertEquals("xhwgfwsrtaw", model.backupMetadata()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java new file mode 100644 index 000000000000..8d801960b402 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupAndExportsValidateBackupWithResponseMockTests { + @Test + public void testValidateBackupWithResponse() throws Exception { + String responseStr = "{\"properties\":{\"numberOfContainers\":1867309112}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateBackupResponse response = manager.backupAndExports() + .validateBackupWithResponse("widf", "xsspuunnoxyhk", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1867309112, 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 new file mode 100644 index 000000000000..1b96586e2555 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":\"xobnbdxkqpxok\",\"backupFormat\":\"Raw\"}}") + .toObject(BackupRequestBase.class); + Assertions.assertEquals("xobnbdxkqpxok", model.backupSettings().backupName()); + Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BackupRequestBase model = new BackupRequestBase().withBackupSettings( + new BackupSettings().withBackupName("xobnbdxkqpxok").withBackupFormat(BackupFormat.RAW)); + model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); + Assertions.assertEquals("xobnbdxkqpxok", model.backupSettings().backupName()); + Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java new file mode 100644 index 000000000000..0c34416d5ada --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":\"onpimexgstxg\",\"backupFormat\":\"Raw\"}") + .toObject(BackupSettings.class); + Assertions.assertEquals("onpimexgstxg", model.backupName()); + Assertions.assertEquals(BackupFormat.RAW, model.backupFormat()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BackupSettings model = new BackupSettings().withBackupName("onpimexgstxg").withBackupFormat(BackupFormat.RAW); + model = BinaryData.fromObject(model).toObject(BackupSettings.class); + Assertions.assertEquals("onpimexgstxg", model.backupName()); + Assertions.assertEquals(BackupFormat.RAW, model.backupFormat()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java new file mode 100644 index 000000000000..425cbbaae32d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; + +public final class BackupStoreDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BackupStoreDetails model + = BinaryData.fromString("{\"objectType\":\"BackupStoreDetails\"}").toObject(BackupStoreDetails.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BackupStoreDetails model = new BackupStoreDetails(); + model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java index 580e8f2baf6f..17b30d0433a9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,18 +13,21 @@ public final class BackupTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Backup model = BinaryData.fromString( - "{\"backupRetentionDays\":1950851050,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-01-21T08:28Z\"}") + "{\"backupRetentionDays\":1294203653,\"backupIntervalHours\":1936335434,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-04-28T11:05:16Z\"}") .toObject(Backup.class); - Assertions.assertEquals(1950851050, model.backupRetentionDays()); + Assertions.assertEquals(1294203653, model.backupRetentionDays()); + Assertions.assertEquals(1936335434, model.backupIntervalHours()); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Backup model - = new Backup().withBackupRetentionDays(1950851050).withGeoRedundantBackup(EnableStatusEnum.DISABLED); + Backup model = new Backup().withBackupRetentionDays(1294203653) + .withBackupIntervalHours(1936335434) + .withGeoRedundantBackup(EnableStatusEnum.DISABLED); model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(1950851050, model.backupRetentionDays()); + Assertions.assertEquals(1294203653, model.backupRetentionDays()); + Assertions.assertEquals(1936335434, model.backupIntervalHours()); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java index 796a3b346271..db7871365753 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; @@ -21,21 +21,21 @@ public final class BackupsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"backupType\":\"xdbabphlwr\",\"completedTime\":\"2021-04-06T00:21:45Z\",\"source\":\"tsthsucocm\"},\"id\":\"yazttbtwwrqpue\",\"name\":\"ckzywbiexzfeyue\",\"type\":\"xibxujwbhqwalm\"}"; + = "{\"properties\":{\"backupType\":\"lozapeewchpxlk\",\"completedTime\":\"2021-02-27T13:57:14Z\",\"source\":\"ziycslevufuztck\"},\"id\":\"h\",\"name\":\"tqedcgzulwm\",\"type\":\"rqzz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServerBackup response = manager.backups() - .getWithResponse("tnrsyn", "qidybyx", "zfcl", com.azure.core.util.Context.NONE) + .getWithResponse("vldspa", "tjb", "kdmflvestmjlx", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("xdbabphlwr", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T00:21:45Z"), response.completedTime()); - Assertions.assertEquals("tsthsucocm", response.source()); + Assertions.assertEquals("lozapeewchpxlk", response.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-27T13:57:14Z"), response.completedTime()); + Assertions.assertEquals("ziycslevufuztck", response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java index 4d049487e984..d4eb4b733715 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; @@ -22,21 +22,21 @@ public final class BackupsListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"backupType\":\"wbavxbniwdj\",\"completedTime\":\"2021-04-13T19:54:16Z\",\"source\":\"s\"},\"id\":\"pgn\",\"name\":\"ytxhp\",\"type\":\"xbzpfzab\"}]}"; + = "{\"value\":[{\"properties\":{\"backupType\":\"yawfvjlboxq\",\"completedTime\":\"2021-03-03T17:48:50Z\",\"source\":\"mxho\"},\"id\":\"ynhdwdigum\",\"name\":\"nraauzz\",\"type\":\"tj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.backups().listByServer("zyoxaepdkzjan", "ux", com.azure.core.util.Context.NONE); + = manager.backups().listByServer("pkc", "ayzri", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wbavxbniwdj", response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T19:54:16Z"), + Assertions.assertEquals("yawfvjlboxq", response.iterator().next().backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T17:48:50Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("s", response.iterator().next().source()); + Assertions.assertEquals("mxho", 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 new file mode 100644 index 000000000000..3d167b673176 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupsPutWithResponseMockTests { + @Test + public void testPutWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"backupType\":\"dmovzvfva\",\"completedTime\":\"2021-10-04T03:30Z\",\"source\":\"adflgzu\"},\"id\":\"glae\",\"name\":\"xndticokpvzmlqtm\",\"type\":\"dgxobfircl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ServerBackup response = manager.backups() + .putWithResponse("rjvpglydzgkrvqee", "toepryu", "nwy", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("dmovzvfva", response.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), response.completedTime()); + Assertions.assertEquals("adflgzu", response.source()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java index 105432f72b67..fdea10fedae7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitiesListResult; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitiesListResult; +import org.junit.jupiter.api.Assertions; public final class CapabilitiesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilitiesListResult model = BinaryData.fromString( - "{\"value\":[{\"zone\":\"kexxppof\",\"supportedHAMode\":[\"x\",\"fjpgddtocjjxhvp\",\"o\",\"exhd\"],\"supportedGeoBackupRegions\":[\"bqe\"],\"supportedFlexibleServerEditions\":[{\"name\":\"qbzvddntwnd\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"npzaoq\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"f\",\"supportedStorageEditions\":[{}],\"supportedServerVersions\":[{},{},{}]}]},{\"zone\":\"lmjthjq\",\"supportedHAMode\":[\"yeicxmqciwqvhk\",\"ixuigdtopbobj\"],\"supportedGeoBackupRegions\":[\"m\"],\"supportedFlexibleServerEditions\":[{\"name\":\"m\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{}]}]}],\"nextLink\":\"yvvtpgvdfgio\"}") + "{\"value\":[{\"zone\":\"sibircgpi\",\"supportedHAMode\":[\"imejzanl\",\"zxiavrm\",\"zonokixrjqci\"],\"supportedGeoBackupRegions\":[\"pfrlazsz\",\"nwoiind\"],\"supportedFlexibleServerEditions\":[{\"name\":\"jylwbtlhflsj\",\"supportedStorageEditions\":[{},{}],\"supportedServerVersions\":[{},{},{}]}]}],\"nextLink\":\"jvfbgofelja\"}") .toObject(CapabilitiesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesListResult model = new CapabilitiesListResult(); - model = BinaryData.fromObject(model).toObject(CapabilitiesListResult.class); + Assertions.assertEquals("jvfbgofelja", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java new file mode 100644 index 000000000000..5fe1a69acdfb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; + +public final class CapabilityInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapabilityInner model = BinaryData.fromString( + "{\"properties\":{\"supportedGeoBackupRegions\":[\"cugicjoox\"],\"supportedFlexibleServerEditions\":[{\"name\":\"wpucwwfvovbv\",\"defaultSku\":\"uecivyhz\",\"defaultStorageSize\":1240635196,\"supportedStorageEditions\":[{\"name\":\"jrwjueiotwm\",\"minStorageSize\":7939345805777152857,\"maxStorageSize\":73360408606536342,\"minBackupRetentionDays\":7152724912237369631,\"maxBackupRetentionDays\":4599897838164298418,\"minBackupIntervalHours\":8610191053119914796,\"maxBackupIntervalHours\":5655548323505802664},{\"name\":\"hniskxfbkpyc\",\"minStorageSize\":3207887590068682243,\"maxStorageSize\":4650522274065706998,\"minBackupRetentionDays\":8301108996863671678,\"maxBackupRetentionDays\":8256899685410293664,\"minBackupIntervalHours\":4570571577423952755,\"maxBackupIntervalHours\":8550144632866513257},{\"name\":\"tdhxujznbmpowuwp\",\"minStorageSize\":4938464628745807464,\"maxStorageSize\":3036268179431574452,\"minBackupRetentionDays\":4253810910381406422,\"maxBackupRetentionDays\":834189001666840770,\"minBackupIntervalHours\":5663355853068180050,\"maxBackupIntervalHours\":4407430111323762488},{\"name\":\"cswsrtjri\",\"minStorageSize\":7224326417185039390,\"maxStorageSize\":8997830980671290094,\"minBackupRetentionDays\":6020102037259892671,\"maxBackupRetentionDays\":2699715212989118591,\"minBackupIntervalHours\":2588455731458277259,\"maxBackupIntervalHours\":2828889507520477532}],\"supportedSkus\":[{\"name\":\"v\",\"vCores\":9032907208555956547,\"supportedIops\":4855611501955594368,\"supportedMemoryPerVCoreMB\":3414804703443363087,\"supportedZones\":[\"xiebwwaloayqcg\",\"rtzju\"],\"supportedHAMode\":[\"yzm\",\"txon\",\"mtsavjcbpwxqp\"]},{\"name\":\"knftguvriuh\",\"vCores\":2144176809632708140,\"supportedIops\":6220323322610788577,\"supportedMemoryPerVCoreMB\":6305214480301008748,\"supportedZones\":[\"riwwroy\",\"bexrmcq\",\"bycnojvkn\"],\"supportedHAMode\":[\"qsgzvahapj\",\"zhpvgqzcjrvxd\",\"zlmwlxkvugfhz\"]},{\"name\":\"awjvzunluthnnp\",\"vCores\":6129569663294762606,\"supportedIops\":4723296407909665545,\"supportedMemoryPerVCoreMB\":4608685738946869262,\"supportedZones\":[\"aejxd\",\"ltskzbbtd\",\"umveekgpwozuhkf\"],\"supportedHAMode\":[\"jyofdxluusdtto\",\"waboe\"]}]},{\"name\":\"v\",\"defaultSku\":\"lns\",\"defaultStorageSize\":1207590142,\"supportedStorageEditions\":[{\"name\":\"jsflhhcaalnjix\",\"minStorageSize\":4911333762565955558,\"maxStorageSize\":2849557956834535585,\"minBackupRetentionDays\":6057026935755922237,\"maxBackupRetentionDays\":7612557985021827276,\"minBackupIntervalHours\":3609115423145085728,\"maxBackupIntervalHours\":8733309321655340713},{\"name\":\"dzyexznelixh\",\"minStorageSize\":1794402231326230823,\"maxStorageSize\":995169380729931769,\"minBackupRetentionDays\":5158531315830549218,\"maxBackupRetentionDays\":1275613767570140789,\"minBackupIntervalHours\":6939449275608814243,\"maxBackupIntervalHours\":1453277226974168978},{\"name\":\"ggdtpnapnyiro\",\"minStorageSize\":5108796098292798355,\"maxStorageSize\":5284833703695885613,\"minBackupRetentionDays\":9191271768964579261,\"maxBackupRetentionDays\":6759887731175079504,\"minBackupIntervalHours\":9066000575416708308,\"maxBackupIntervalHours\":8474920494469596797},{\"name\":\"jvc\",\"minStorageSize\":6530746203139727560,\"maxStorageSize\":2572160878205453976,\"minBackupRetentionDays\":1214544725492398973,\"maxBackupRetentionDays\":4123173750069461774,\"minBackupIntervalHours\":6175292015510549076,\"maxBackupIntervalHours\":8312530618702549187}],\"supportedSkus\":[{\"name\":\"napkteoellw\",\"vCores\":7518258673259657394,\"supportedIops\":786174593992845845,\"supportedMemoryPerVCoreMB\":4189677250965468268,\"supportedZones\":[\"ceopzfqrhhuaopp\"],\"supportedHAMode\":[\"eqx\",\"lzdahzxctobgbkdm\"]},{\"name\":\"zpostmgrcfbu\",\"vCores\":2264360285985918261,\"supportedIops\":7345662918450182758,\"supportedMemoryPerVCoreMB\":5831717944489662956,\"supportedZones\":[\"vjymjhxxjyngud\",\"vkr\",\"swbxqz\",\"szjfauvjfdxxivet\"],\"supportedHAMode\":[\"qaqtdoqmcbxvwvxy\",\"lqbhsf\",\"obl\"]},{\"name\":\"k\",\"vCores\":3681757867502856948,\"supportedIops\":7965235858819395640,\"supportedMemoryPerVCoreMB\":2233870853702293034,\"supportedZones\":[\"vrnsvshqjohxc\",\"sbfov\",\"srruvwbhsqfsubcg\",\"birx\"],\"supportedHAMode\":[\"bsrfbj\",\"dtws\",\"otftpvjzbexilz\",\"nfqqnvwp\"]},{\"name\":\"taruoujmkcj\",\"vCores\":6824806013048148325,\"supportedIops\":7113999154166072547,\"supportedMemoryPerVCoreMB\":3343322961355677418,\"supportedZones\":[\"ewgdrjervn\",\"enq\",\"eh\"],\"supportedHAMode\":[\"oygmift\"]}]},{\"name\":\"zdnds\",\"defaultSku\":\"nayqi\",\"defaultStorageSize\":1427716289,\"supportedStorageEditions\":[{\"name\":\"avhqlkth\",\"minStorageSize\":6938078424935169560,\"maxStorageSize\":3047219394143093587,\"minBackupRetentionDays\":7187692745010410985,\"maxBackupRetentionDays\":3264624170163981005,\"minBackupIntervalHours\":766659448073134411,\"maxBackupIntervalHours\":5983692847651607240},{\"name\":\"mvaolps\",\"minStorageSize\":1053709421770726696,\"maxStorageSize\":3084758361383358481,\"minBackupRetentionDays\":245140836582564523,\"maxBackupRetentionDays\":2285407320964329848,\"minBackupIntervalHours\":3156235499243727087,\"maxBackupIntervalHours\":3740135590125473385}],\"supportedSkus\":[{\"name\":\"wyhzdx\",\"vCores\":5645412032437353957,\"supportedIops\":5470431238820396350,\"supportedMemoryPerVCoreMB\":6861155578766594130,\"supportedZones\":[\"n\"],\"supportedHAMode\":[\"od\"]},{\"name\":\"zbn\",\"vCores\":9060277585514790302,\"supportedIops\":3683939108270418339,\"supportedMemoryPerVCoreMB\":2911465256581796215,\"supportedZones\":[\"xsrz\",\"zucerscdntnev\",\"iwjmygtdssls\",\"tmweriofzpyq\"],\"supportedHAMode\":[\"wab\",\"ets\",\"hszhedplvwiwu\",\"mwmbes\"]},{\"name\":\"nkww\",\"vCores\":1561938981364881138,\"supportedIops\":4867738231961070791,\"supportedMemoryPerVCoreMB\":5362271027620040717,\"supportedZones\":[\"konzmnsik\",\"mkqzeqqkdltfzxmh\",\"v\",\"gureodkwobdag\"],\"supportedHAMode\":[\"bqdxbx\",\"akbogqxndlkzgxh\",\"ripl\",\"podxunkb\"]},{\"name\":\"xmubyyntwlrbq\",\"vCores\":8060447161666090820,\"supportedIops\":719850312604044810,\"supportedMemoryPerVCoreMB\":1598554311295204208,\"supportedZones\":[\"rlltmuwlauwzizx\"],\"supportedHAMode\":[\"gcj\",\"fuzmuvpbtt\",\"um\"]}]}],\"supportedServerVersions\":[{\"name\":\"xe\"}],\"supportedFeatures\":[{\"featureName\":\"btbhjpglkfgohd\",\"featureValue\":\"uel\"},{\"featureName\":\"hsd\",\"featureValue\":\"t\"}]},\"id\":\"fikdowwqu\",\"name\":\"v\",\"type\":\"zx\"}") + .toObject(CapabilityInner.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java index 23fabe73fe6c..e3fca386d4f9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class CapabilityPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilityPropertiesInner model = BinaryData.fromString( - "{\"zone\":\"ftutqxlngxlefgu\",\"supportedHAMode\":[\"krxd\",\"mi\"],\"supportedGeoBackupRegions\":[\"hzrvqd\"],\"supportedFlexibleServerEditions\":[{\"name\":\"jybige\",\"supportedStorageEditions\":[{\"name\":\"bowsk\",\"minStorageSize\":4187351799054769848,\"maxStorageSize\":8321881464692032483,\"minBackupRetentionDays\":450756782993701005,\"maxBackupRetentionDays\":5423629655028728584},{\"name\":\"ywgndrv\",\"minStorageSize\":9186245080720246611,\"maxStorageSize\":1284533525863803675,\"minBackupRetentionDays\":4712637840273391271,\"maxBackupRetentionDays\":7340674686507262093}],\"supportedServerVersions\":[{\"name\":\"pec\",\"supportedSkus\":[{}]},{\"name\":\"coofsxlzev\",\"supportedSkus\":[{}]},{\"name\":\"jqabcypmivkwlzuv\",\"supportedSkus\":[{},{}]}]}]}") + "{\"zone\":\"qmqhldvriii\",\"supportedHAMode\":[\"al\",\"hfkvtvsexsowuel\",\"qhhahhxvrhmzkwpj\",\"wws\"],\"supportedGeoBackupRegions\":[\"hftqsxhqxujxukn\",\"xdigrjg\",\"ufzdmsyq\",\"fi\"],\"supportedFlexibleServerEditions\":[{\"name\":\"otzi\",\"supportedStorageEditions\":[{\"name\":\"vppho\",\"minStorageSize\":7727848197027665557,\"maxStorageSize\":7217800876944816191,\"minBackupRetentionDays\":8766216481920061553,\"maxBackupRetentionDays\":5906837724043027810,\"minBackupIntervalHours\":5079612744711830702,\"maxBackupIntervalHours\":7096751901031996251},{\"name\":\"vtbvkayh\",\"minStorageSize\":4589407465923806583,\"maxStorageSize\":2430011697445537445,\"minBackupRetentionDays\":2949816427464265295,\"maxBackupRetentionDays\":1497619530378227200,\"minBackupIntervalHours\":466272215453646942,\"maxBackupIntervalHours\":4733398723878456346},{\"name\":\"a\",\"minStorageSize\":3735077488141547472,\"maxStorageSize\":1280218096280763965,\"minBackupRetentionDays\":6313040866507251264,\"maxBackupRetentionDays\":1066382835931750004,\"minBackupIntervalHours\":7540193600224102350,\"maxBackupIntervalHours\":2530317037833496160},{\"name\":\"lvdnkfx\",\"minStorageSize\":5287231219512960501,\"maxStorageSize\":6647177632922570765,\"minBackupRetentionDays\":6962155894292526184,\"maxBackupRetentionDays\":491327471174007244,\"minBackupIntervalHours\":8224509646361312989,\"maxBackupIntervalHours\":4754254895258048026}],\"supportedServerVersions\":[{\"name\":\"vpsvuoymgcce\",\"supportedSkus\":[{},{}]}]},{\"name\":\"rypqlmfeo\",\"supportedStorageEditions\":[{\"name\":\"wkyhkobopgxe\",\"minStorageSize\":4472082990389410332,\"maxStorageSize\":6326265417967005355,\"minBackupRetentionDays\":1344480624206728635,\"maxBackupRetentionDays\":4561613667511970295,\"minBackupIntervalHours\":8982394731050292529,\"maxBackupIntervalHours\":8172148400531908792},{\"name\":\"vcdwxlpqekftn\",\"minStorageSize\":5918937804164279163,\"maxStorageSize\":768157718472448573,\"minBackupRetentionDays\":8658857252858173876,\"maxBackupRetentionDays\":4181359456803259421,\"minBackupIntervalHours\":3785815942098550285,\"maxBackupIntervalHours\":6035898469586356847}],\"supportedServerVersions\":[{\"name\":\"ypgik\",\"supportedSkus\":[{},{},{}]},{\"name\":\"ywkbirryuzhlhkjo\",\"supportedSkus\":[{},{},{},{}]},{\"name\":\"qaatjinrv\",\"supportedSkus\":[{},{},{}]}]},{\"name\":\"mfiibfggj\",\"supportedStorageEditions\":[{\"name\":\"vrwxkv\",\"minStorageSize\":201556653544263409,\"maxStorageSize\":6051711017837874819,\"minBackupRetentionDays\":1471495737284359378,\"maxBackupRetentionDays\":5744108243382910534,\"minBackupIntervalHours\":1672467417217297932,\"maxBackupIntervalHours\":3149992983135125774},{\"name\":\"vkzuhbxvvyhgso\",\"minStorageSize\":3729777197951027376,\"maxStorageSize\":659192510788744677,\"minBackupRetentionDays\":754056912237486709,\"maxBackupRetentionDays\":2830799497706488811,\"minBackupIntervalHours\":3115230018445319703,\"maxBackupIntervalHours\":8014747037216452315}],\"supportedServerVersions\":[{\"name\":\"l\",\"supportedSkus\":[{},{},{},{}]},{\"name\":\"itvgbmhrixkwm\",\"supportedSkus\":[{},{}]},{\"name\":\"jvegrhbpnaixexcc\",\"supportedSkus\":[{},{},{}]}]},{\"name\":\"ax\",\"supportedStorageEditions\":[{\"name\":\"drrvqahqkght\",\"minStorageSize\":7927841269173580960,\"maxStorageSize\":882899193030330530,\"minBackupRetentionDays\":1896207356770709532,\"maxBackupRetentionDays\":753153192915766448,\"minBackupIntervalHours\":629369756656337555,\"maxBackupIntervalHours\":5977236228549031006},{\"name\":\"wvrvmtg\",\"minStorageSize\":7544016699514237803,\"maxStorageSize\":7932136629726527025,\"minBackupRetentionDays\":2975809370429282530,\"maxBackupRetentionDays\":1317493290230435394,\"minBackupIntervalHours\":3679866876785700659,\"maxBackupIntervalHours\":2319064987356964685},{\"name\":\"sxkm\",\"minStorageSize\":495468390827494168,\"maxStorageSize\":4430982710505158598,\"minBackupRetentionDays\":4753379128237183611,\"maxBackupRetentionDays\":6941142401691423542,\"minBackupIntervalHours\":6999697072420624032,\"maxBackupIntervalHours\":7355366005690821204}],\"supportedServerVersions\":[{\"name\":\"ikkx\",\"supportedSkus\":[{}]},{\"name\":\"lbqpvuzlmvfelf\",\"supportedSkus\":[{},{},{},{}]},{\"name\":\"lcrpw\",\"supportedSkus\":[{},{}]}]}]}") .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/CapabilityPropertiesV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java new file mode 100644 index 000000000000..76c9a9a462c8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesV2; + +public final class CapabilityPropertiesV2Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapabilityPropertiesV2 model = BinaryData.fromString( + "{\"supportedGeoBackupRegions\":[\"ithhqzon\",\"sg\"],\"supportedFlexibleServerEditions\":[{\"name\":\"ohfwds\",\"defaultSku\":\"ka\",\"defaultStorageSize\":215049895,\"supportedStorageEditions\":[{\"name\":\"swacffgdkzz\",\"minStorageSize\":5405818308592426704,\"maxStorageSize\":4567739994281506426,\"minBackupRetentionDays\":3759321515093630418,\"maxBackupRetentionDays\":6888192082920779134,\"minBackupIntervalHours\":301709848939782514,\"maxBackupIntervalHours\":3573007686021676222},{\"name\":\"lrwdmhdlxyj\",\"minStorageSize\":3152420292610519436,\"maxStorageSize\":6836575686513416637,\"minBackupRetentionDays\":4521518402246143019,\"maxBackupRetentionDays\":3356824061163345093,\"minBackupIntervalHours\":3473341415341754337,\"maxBackupIntervalHours\":2722432459544366405},{\"name\":\"fb\",\"minStorageSize\":8611523668888177552,\"maxStorageSize\":648719772488925144,\"minBackupRetentionDays\":6395460850482092633,\"maxBackupRetentionDays\":4392400281438783051,\"minBackupIntervalHours\":4200682603661238799,\"maxBackupIntervalHours\":1691075680469925447},{\"name\":\"dsotbobzd\",\"minStorageSize\":4925429058781882288,\"maxStorageSize\":5687165155098120323,\"minBackupRetentionDays\":8637599636999601474,\"maxBackupRetentionDays\":15326288363695104,\"minBackupIntervalHours\":6522332661969979090,\"maxBackupIntervalHours\":4381038120758231143}],\"supportedSkus\":[{\"name\":\"utwu\",\"vCores\":4150565343365520377,\"supportedIops\":5722379398974283920,\"supportedMemoryPerVCoreMB\":3859577697194270181,\"supportedZones\":[\"qsluicp\",\"ggkzzlvmbmpa\"],\"supportedHAMode\":[\"dfvue\",\"yw\",\"bpfvm\"]},{\"name\":\"hrfou\",\"vCores\":4811650617060953950,\"supportedIops\":5921863254735243053,\"supportedMemoryPerVCoreMB\":7140764207385351369,\"supportedZones\":[\"vqtmnub\",\"xkp\",\"ksmond\"],\"supportedHAMode\":[\"uxvypomgkopkwh\",\"jvp\",\"jqg\"]}]},{\"name\":\"smocmbq\",\"defaultSku\":\"vmkcx\",\"defaultStorageSize\":1061947770,\"supportedStorageEditions\":[{\"name\":\"elxprglyatddck\",\"minStorageSize\":1605920653761823709,\"maxStorageSize\":7850386713816708447,\"minBackupRetentionDays\":3070743576677662051,\"maxBackupRetentionDays\":2629967509256369573,\"minBackupIntervalHours\":3405568102133288247,\"maxBackupIntervalHours\":3019773513658765057},{\"name\":\"sdqrhzoymibmrq\",\"minStorageSize\":5977240495404401854,\"maxStorageSize\":8539790193753290872,\"minBackupRetentionDays\":3859662575119335920,\"maxBackupRetentionDays\":7176903777537856658,\"minBackupIntervalHours\":5665928384383195367,\"maxBackupIntervalHours\":7740523087334543020},{\"name\":\"yyv\",\"minStorageSize\":5748246004762300961,\"maxStorageSize\":3645438525729002905,\"minBackupRetentionDays\":3596857482537932759,\"maxBackupRetentionDays\":1477566052149971065,\"minBackupIntervalHours\":2878415356343371962,\"maxBackupIntervalHours\":6217672492639104016},{\"name\":\"ashrt\",\"minStorageSize\":1151592632214539496,\"maxStorageSize\":3530483379804377024,\"minBackupRetentionDays\":8989578588874797078,\"maxBackupRetentionDays\":3970058282735667200,\"minBackupIntervalHours\":2291924082393091786,\"maxBackupIntervalHours\":4256703090352932350}],\"supportedSkus\":[{\"name\":\"ipqiiobyuqerpq\",\"vCores\":9153525245739477269,\"supportedIops\":8381194936769139880,\"supportedMemoryPerVCoreMB\":8353822306247184184,\"supportedZones\":[\"butauvfb\",\"kuwhh\",\"hykojoxafnndlpic\",\"koymkcd\"],\"supportedHAMode\":[\"pkkpw\",\"reqnovvqfov\",\"jxywsuws\"]},{\"name\":\"s\",\"vCores\":4579993960866529408,\"supportedIops\":164789879294916168,\"supportedMemoryPerVCoreMB\":8488213744236915877,\"supportedZones\":[\"ea\",\"neqn\",\"arrwlquu\",\"jfqka\"],\"supportedHAMode\":[\"iipfpubj\",\"bwwift\"]}]},{\"name\":\"qkvpuvksgplsakn\",\"defaultSku\":\"fsynljphuop\",\"defaultStorageSize\":1015065537,\"supportedStorageEditions\":[{\"name\":\"ynt\",\"minStorageSize\":3707050213775351931,\"maxStorageSize\":2854193743711542243,\"minBackupRetentionDays\":9128276167784679496,\"maxBackupRetentionDays\":1042560535262747024,\"minBackupIntervalHours\":8156843605393884009,\"maxBackupIntervalHours\":6911162126498665936}],\"supportedSkus\":[{\"name\":\"bchckqqzqio\",\"vCores\":5253901469218234433,\"supportedIops\":7391788456233994805,\"supportedMemoryPerVCoreMB\":9110638911765212224,\"supportedZones\":[\"dy\",\"trwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\"],\"supportedHAMode\":[\"orgjhxbldt\",\"wwrlkdmtncv\"]},{\"name\":\"otllxdyhgsyo\",\"vCores\":4877471072225031792,\"supportedIops\":3528662492556478567,\"supportedMemoryPerVCoreMB\":7818158463712312814,\"supportedZones\":[\"adoocrkvc\",\"khnvpam\"],\"supportedHAMode\":[\"qqu\"]}]}],\"supportedServerVersions\":[{\"name\":\"ywggx\"}],\"supportedFeatures\":[{\"featureName\":\"atmelwui\",\"featureValue\":\"ccjzkzivgvv\"}]}") + .toObject(CapabilityPropertiesV2.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java new file mode 100644 index 000000000000..e7e0500836bf --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.CapabilitySetsList; +import org.junit.jupiter.api.Assertions; + +public final class CapabilitySetsListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapabilitySetsList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"supportedGeoBackupRegions\":[\"llrxcyjmoad\",\"uvarmywdmjsjq\",\"jhhyxxrwlycoduhp\"],\"supportedFlexibleServerEditions\":[{\"name\":\"ymareqnajxqugj\",\"defaultSku\":\"ycubeddgs\",\"defaultStorageSize\":1063119881,\"supportedStorageEditions\":[{},{},{},{}],\"supportedSkus\":[{},{},{},{}]},{\"name\":\"alkrmn\",\"defaultSku\":\"jpxac\",\"defaultStorageSize\":208789733,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{},{}]},{\"name\":\"xbaaabjyv\",\"defaultSku\":\"ffimrzrtuzqogsex\",\"defaultStorageSize\":2124595132,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{}]},{\"name\":\"wmewzsyy\",\"defaultSku\":\"uzsoi\",\"defaultStorageSize\":414197490,\"supportedStorageEditions\":[{},{},{}],\"supportedSkus\":[{}]}],\"supportedServerVersions\":[{\"name\":\"thzvaytdwkqbrqu\"},{\"name\":\"axhexiilivp\"},{\"name\":\"iirqtd\"},{\"name\":\"axoruzfgsquy\"}],\"supportedFeatures\":[{\"featureName\":\"xleptramx\",\"featureValue\":\"zwl\"},{\"featureName\":\"wxuqlcvydypatdoo\",\"featureValue\":\"jkniodko\"}]},\"id\":\"bw\",\"name\":\"ujhemmsbvdkcrodt\",\"type\":\"infwjlfltkacjve\"},{\"properties\":{\"supportedGeoBackupRegions\":[\"foakgg\",\"fpagaowpulp\"],\"supportedFlexibleServerEditions\":[{\"name\":\"lsyxkqjnsjervt\",\"defaultSku\":\"gxsds\",\"defaultStorageSize\":6214613,\"supportedStorageEditions\":[{},{},{},{}],\"supportedSkus\":[{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"z\"},{\"name\":\"yvpnqicvinvkjj\"},{\"name\":\"xrbuukzclew\"},{\"name\":\"mlwpazt\"}],\"supportedFeatures\":[{\"featureName\":\"ncckw\",\"featureValue\":\"zqwhxxbuyqaxzfeq\"},{\"featureName\":\"ppriol\",\"featureValue\":\"rjaltolmncw\"},{\"featureName\":\"bqwcsdbnwdcf\",\"featureValue\":\"cqdpfuv\"},{\"featureName\":\"sbjjc\",\"featureValue\":\"vxb\"}]},\"id\":\"vudutncor\",\"name\":\"r\",\"type\":\"xqtvcofu\"}],\"nextLink\":\"lvkgju\"}") + .toObject(CapabilitySetsList.class); + Assertions.assertEquals("lvkgju", model.nextLink()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java index 89d5527c1a45..f891bb759b39 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; @@ -21,22 +21,23 @@ public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"message\":\"mocmbqfqvmk\",\"nameAvailable\":false,\"reason\":\"apvhelxprgly\"}"; + String responseStr = "{\"message\":\"brxkjzwr\",\"nameAvailable\":false,\"reason\":\"mshkwfbkgo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); NameAvailability response = manager.checkNameAvailabilities() - .executeWithResponse("mond", new NameAvailabilityRequest().withName("mquxvypo").withType("kopkwhojvpajqgx"), + .executeWithResponse("kzjv", + new NameAvailabilityRequest().withName("viirhgfgrws").withType("gratzvzbglbyvict"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mocmbqfqvmk", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("apvhelxprgly", response.reason()); + Assertions.assertEquals("brxkjzwr", response.message()); + Assertions.assertFalse(response.nameAvailable()); + Assertions.assertEquals("mshkwfbkgo", response.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java index 8a90eb62c7a4..6ca377a9bfa7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; @@ -21,22 +21,22 @@ public final class CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"message\":\"sdqrhzoymibmrq\",\"nameAvailable\":false,\"reason\":\"hwflu\"}"; + String responseStr = "{\"message\":\"nfsm\",\"nameAvailable\":true,\"reason\":\"uxuuyilflq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); NameAvailability response = manager.checkNameAvailabilityWithoutLocations() - .executeWithResponse(new NameAvailabilityRequest().withName("tddckcb").withType("ejrjxgciqibrho"), + .executeWithResponse(new NameAvailabilityRequest().withName("xwopdbydpizqa").withType("napxbiygnug"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("sdqrhzoymibmrq", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("hwflu", response.reason()); + Assertions.assertEquals("nfsm", response.message()); + Assertions.assertTrue(response.nameAvailable()); + Assertions.assertEquals("uxuuyilflq", response.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java index 38a04e28c3a5..11dbc1dc6768 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; @@ -21,18 +21,18 @@ public final class CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { String responseStr - = "{\"location\":\"gk\",\"subscriptionId\":\"lvmbmpaxmodfvuef\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"pfvmwyhrfou\",\"usage\":4811650617060953950},{\"subnetName\":\"kcpwiy\",\"usage\":3618670144532110213},{\"subnetName\":\"nubexk\",\"usage\":6799001413428276597}]}"; + = "{\"location\":\"lisn\",\"subscriptionId\":\"fl\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"izruwnpqxpxiwfc\",\"usage\":3198963628835972526},{\"subnetName\":\"asi\",\"usage\":9025506804447933074}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); VirtualNetworkSubnetUsageResult response = manager.checkVirtualNetworkSubnetUsages() - .executeWithResponse("khjwn", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("qsluicp"), + .executeWithResponse("fmjnnawtqa", + new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("xuckpggqoweyir"), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java index f20e37171ed8..daa16dce3c79 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,18 +12,18 @@ public final class ConfigurationForBatchUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationForBatchUpdateProperties model - = BinaryData.fromString("{\"value\":\"u\",\"source\":\"krlkhbzhfepg\"}") + = BinaryData.fromString("{\"value\":\"aiuebbaumnyqu\",\"source\":\"deoj\"}") .toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("u", model.value()); - Assertions.assertEquals("krlkhbzhfepg", model.source()); + Assertions.assertEquals("aiuebbaumnyqu", model.value()); + Assertions.assertEquals("deoj", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConfigurationForBatchUpdateProperties model - = new ConfigurationForBatchUpdateProperties().withValue("u").withSource("krlkhbzhfepg"); + = new ConfigurationForBatchUpdateProperties().withValue("aiuebbaumnyqu").withSource("deoj"); model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("u", model.value()); - Assertions.assertEquals("krlkhbzhfepg", model.source()); + Assertions.assertEquals("aiuebbaumnyqu", model.value()); + Assertions.assertEquals("deoj", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java index dd5a85dbf85f..7aaec1662850 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,22 +12,20 @@ public final class ConfigurationForBatchUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationForBatchUpdate model = BinaryData - .fromString( - "{\"name\":\"hurzafblj\",\"properties\":{\"value\":\"btoqcjmkljavbqid\",\"source\":\"ajzyul\"}}") + .fromString("{\"name\":\"xnkjzkdesl\",\"properties\":{\"value\":\"opwi\",\"source\":\"ghxpkdw\"}}") .toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("hurzafblj", model.name()); - Assertions.assertEquals("btoqcjmkljavbqid", model.value()); - Assertions.assertEquals("ajzyul", model.source()); + Assertions.assertEquals("xnkjzkdesl", model.name()); + Assertions.assertEquals("opwi", model.value()); + Assertions.assertEquals("ghxpkdw", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationForBatchUpdate model = new ConfigurationForBatchUpdate().withName("hurzafblj") - .withValue("btoqcjmkljavbqid") - .withSource("ajzyul"); + ConfigurationForBatchUpdate model + = new ConfigurationForBatchUpdate().withName("xnkjzkdesl").withValue("opwi").withSource("ghxpkdw"); model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("hurzafblj", model.name()); - Assertions.assertEquals("btoqcjmkljavbqid", model.value()); - Assertions.assertEquals("ajzyul", model.source()); + Assertions.assertEquals("xnkjzkdesl", model.name()); + Assertions.assertEquals("opwi", model.value()); + Assertions.assertEquals("ghxpkdw", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java index 07fd51c8d22e..f3aba0174de1 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,18 +13,21 @@ public final class ConfigurationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationInner model = BinaryData.fromString( - "{\"properties\":{\"value\":\"ujysvle\",\"description\":\"vfqawrlyxwjkcpr\",\"defaultValue\":\"wbxgjvt\",\"dataType\":\"p\",\"allowedValues\":\"szdnr\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"qfprwzwbn\",\"name\":\"uitnwuiz\",\"type\":\"a\"}") + "{\"properties\":{\"value\":\"csonpclhoco\",\"currentValue\":\"lkevle\",\"description\":\"zfbuhf\",\"documentationLink\":\"faxkffeii\",\"defaultValue\":\"lvmezyvshxmzsbbz\",\"dataType\":\"gigr\",\"allowedValues\":\"burvjxxjnspy\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"knvudwtiukb\",\"name\":\"dng\",\"type\":\"pocipazyxoegu\"}") .toObject(ConfigurationInner.class); - Assertions.assertEquals("ujysvle", model.value()); + Assertions.assertEquals("csonpclhoco", model.value()); + Assertions.assertEquals("lkevle", model.currentValue()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationInner model - = new ConfigurationInner().withValue("ujysvle").withSource(ConfigurationSource.SYSTEM_DEFAULT); + ConfigurationInner model = new ConfigurationInner().withValue("csonpclhoco") + .withCurrentValue("lkevle") + .withSource(ConfigurationSource.SYSTEM_DEFAULT); model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("ujysvle", model.value()); + Assertions.assertEquals("csonpclhoco", model.value()); + Assertions.assertEquals("lkevle", 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 index b9b419db4623..baa9cfb44039 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -14,23 +15,28 @@ public final class ConfigurationListForBatchUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationListForBatchUpdate model = BinaryData.fromString( - "{\"value\":[{\"name\":\"dnsezcxtbzs\",\"properties\":{\"value\":\"c\",\"source\":\"newmdwzjeiachbo\"}},{\"name\":\"flnrosfqpteehzz\",\"properties\":{\"value\":\"yqrimzin\",\"source\":\"swjdkirso\"}},{\"name\":\"qxhcrmn\",\"properties\":{\"value\":\"t\",\"source\":\"whdsoifiyip\"}},{\"name\":\"sqwpgrjb\",\"properties\":{\"value\":\"rcjxvsnbyxqabn\",\"source\":\"cpc\"}}]}") + "{\"value\":[{\"name\":\"uedck\",\"properties\":{\"value\":\"biexzfeyu\",\"source\":\"xibxujwbhqwalm\"}},{\"name\":\"yoxa\",\"properties\":{\"value\":\"kzjancuxrhdwbav\",\"source\":\"niwdjsw\"}},{\"name\":\"s\",\"properties\":{\"value\":\"gnxytxhpzxbz\",\"source\":\"zabglcuhxwt\"}},{\"name\":\"yqiklbbovplwzb\",\"properties\":{\"value\":\"yuguosvmkfssx\",\"source\":\"kkfpl\"}}],\"resetAllToDefault\":\"False\"}") .toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("dnsezcxtbzs", model.value().get(0).name()); - Assertions.assertEquals("c", model.value().get(0).value()); - Assertions.assertEquals("newmdwzjeiachbo", model.value().get(0).source()); + Assertions.assertEquals("uedck", model.value().get(0).name()); + Assertions.assertEquals("biexzfeyu", model.value().get(0).value()); + Assertions.assertEquals("xibxujwbhqwalm", model.value().get(0).source()); + Assertions.assertEquals(ResetAllToDefault.FALSE, model.resetAllToDefault()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConfigurationListForBatchUpdate model = new ConfigurationListForBatchUpdate().withValue(Arrays.asList( - new ConfigurationForBatchUpdate().withName("dnsezcxtbzs").withValue("c").withSource("newmdwzjeiachbo"), - new ConfigurationForBatchUpdate().withName("flnrosfqpteehzz").withValue("yqrimzin").withSource("swjdkirso"), - new ConfigurationForBatchUpdate().withName("qxhcrmn").withValue("t").withSource("whdsoifiyip"), - new ConfigurationForBatchUpdate().withName("sqwpgrjb").withValue("rcjxvsnbyxqabn").withSource("cpc"))); + new ConfigurationForBatchUpdate().withName("uedck").withValue("biexzfeyu").withSource("xibxujwbhqwalm"), + new ConfigurationForBatchUpdate().withName("yoxa").withValue("kzjancuxrhdwbav").withSource("niwdjsw"), + new ConfigurationForBatchUpdate().withName("s").withValue("gnxytxhpzxbz").withSource("zabglcuhxwt"), + new ConfigurationForBatchUpdate().withName("yqiklbbovplwzb") + .withValue("yuguosvmkfssx") + .withSource("kkfpl"))) + .withResetAllToDefault(ResetAllToDefault.FALSE); model = BinaryData.fromObject(model).toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("dnsezcxtbzs", model.value().get(0).name()); - Assertions.assertEquals("c", model.value().get(0).value()); - Assertions.assertEquals("newmdwzjeiachbo", model.value().get(0).source()); + Assertions.assertEquals("uedck", model.value().get(0).name()); + Assertions.assertEquals("biexzfeyu", model.value().get(0).value()); + Assertions.assertEquals("xibxujwbhqwalm", model.value().get(0).source()); + Assertions.assertEquals(ResetAllToDefault.FALSE, 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 index 24ae23ac97f9..d76d22194fef 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java @@ -1,36 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"zloc\",\"description\":\"c\",\"defaultValue\":\"ierhhbcsglummaj\",\"dataType\":\"aodxo\",\"allowedValues\":\"bdxkqpxokaj\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"txgcpodgmaajr\",\"name\":\"vdjwzrlovm\",\"type\":\"lwhijcoejctbzaq\"}],\"nextLink\":\"sycbkbfk\"}") + "{\"value\":[{\"properties\":{\"value\":\"agalpbuxwgipwhon\",\"currentValue\":\"kgshwa\",\"description\":\"ixzbinjeputtmryw\",\"documentationLink\":\"zoqftiyqzrnkcqvy\",\"defaultValue\":\"whzlsicohoq\",\"dataType\":\"wvl\",\"allowedValues\":\"avwhheunm\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"ocukoklyax\",\"name\":\"conuqszfkbeype\",\"type\":\"rmjmwvvjektc\"},{\"properties\":{\"value\":\"nhwlrsffrzpwvl\",\"currentValue\":\"q\",\"description\":\"iqylihkaetck\",\"documentationLink\":\"fcivfsnkym\",\"defaultValue\":\"tqhjfbebrjcx\",\"dataType\":\"fuwutttxf\",\"allowedValues\":\"rbirphxe\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"kyqxjvuujqgidokg\",\"name\":\"ljyoxgvcltb\",\"type\":\"sncghkjeszz\"},{\"properties\":{\"value\":\"jhtxfvgxbfsmxne\",\"currentValue\":\"pvecxgodeb\",\"description\":\"kk\",\"documentationLink\":\"mpukgriw\",\"defaultValue\":\"zlfbxzpuzycispnq\",\"dataType\":\"hmgkbrpyy\",\"allowedValues\":\"ibnuqqkpik\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"buynhijggm\",\"name\":\"bfs\",\"type\":\"arbu\"},{\"properties\":{\"value\":\"vpnazzm\",\"currentValue\":\"runmp\",\"description\":\"tdbhrbnla\",\"documentationLink\":\"xmyskp\",\"defaultValue\":\"enbtkcxywny\",\"dataType\":\"rsyn\",\"allowedValues\":\"idybyxczf\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"p\",\"name\":\"lwrq\",\"type\":\"fkts\"}],\"nextLink\":\"sucocmnyyazttbtw\"}") .toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("zloc", model.value().get(0).value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); - Assertions.assertEquals("sycbkbfk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResultInner model = new ConfigurationListResultInner() - .withValue(Arrays - .asList(new ConfigurationInner().withValue("zloc").withSource(ConfigurationSource.SYSTEM_DEFAULT))) - .withNextLink("sycbkbfk"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("zloc", model.value().get(0).value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); - Assertions.assertEquals("sycbkbfk", model.nextLink()); + Assertions.assertEquals("agalpbuxwgipwhon", model.value().get(0).value()); + Assertions.assertEquals("kgshwa", model.value().get(0).currentValue()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); + Assertions.assertEquals("sucocmnyyazttbtw", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java index 7b32f30543ec..d4157f08259e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,18 +13,21 @@ public final class ConfigurationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationProperties model = BinaryData.fromString( - "{\"value\":\"ufizuckyf\",\"description\":\"rfidfvzwdz\",\"defaultValue\":\"tymw\",\"dataType\":\"dkfthwxmnt\",\"allowedValues\":\"waopvkmijcmmxd\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}") + "{\"value\":\"jnpiucgyg\",\"currentValue\":\"qzntypm\",\"description\":\"p\",\"documentationLink\":\"c\",\"defaultValue\":\"qjsdpydnfyhxdeo\",\"dataType\":\"zi\",\"allowedValues\":\"ifsjttgzfbishcb\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}") .toObject(ConfigurationProperties.class); - Assertions.assertEquals("ufizuckyf", model.value()); + Assertions.assertEquals("jnpiucgyg", model.value()); + Assertions.assertEquals("qzntypm", model.currentValue()); Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationProperties model - = new ConfigurationProperties().withValue("ufizuckyf").withSource(ConfigurationSource.USER_OVERRIDE); + ConfigurationProperties model = new ConfigurationProperties().withValue("jnpiucgyg") + .withCurrentValue("qzntypm") + .withSource(ConfigurationSource.USER_OVERRIDE); model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("ufizuckyf", model.value()); + Assertions.assertEquals("jnpiucgyg", model.value()); + Assertions.assertEquals("qzntypm", 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 index 01de786460d7..39f839a7f1ea 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java @@ -1,19 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; 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.ConfigurationSource; +import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -25,25 +26,29 @@ public final class ConfigurationsBatchUpdateMockTests { @Test public void testBatchUpdate() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"xyawj\",\"description\":\"aq\",\"defaultValue\":\"lyjpk\",\"dataType\":\"dzyexznelixh\",\"allowedValues\":\"ztfolhbnxk\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"dtpnapnyiropuhp\",\"name\":\"gvpgy\",\"type\":\"gqgitxmedjvcsl\"},{\"properties\":{\"value\":\"wwncwzzhxgk\",\"description\":\"mgucna\",\"defaultValue\":\"t\",\"dataType\":\"ellwptfdy\",\"allowedValues\":\"fqbuaceopzf\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"cq\",\"name\":\"qxolzdahzx\",\"type\":\"t\"},{\"properties\":{\"value\":\"bkdmo\",\"description\":\"postmgrcfbunrm\",\"defaultValue\":\"jhhkxbp\",\"dataType\":\"ymjhxxjyngudivkr\",\"allowedValues\":\"wbxqzvszjfau\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"vtcqaqtdo\",\"name\":\"mcbxvwvxysl\",\"type\":\"bhsfxob\"},{\"properties\":{\"value\":\"k\",\"description\":\"mpew\",\"defaultValue\":\"fbkrvrnsvs\",\"dataType\":\"johxcrsb\",\"allowedValues\":\"vasrruvwb\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"birx\",\"name\":\"pybsrfbjfdtw\",\"type\":\"sotftpvj\"}],\"nextLink\":\"exilzznfqqnvwpmq\"}"; + = "{\"value\":[{\"properties\":{\"value\":\"nwiaaomyl\",\"currentValue\":\"azul\",\"description\":\"ethwwnpjhlfz\",\"documentationLink\":\"pchwa\",\"defaultValue\":\"bousn\",\"dataType\":\"pgfewetwlyx\",\"allowedValues\":\"cxy\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"bcxf\",\"name\":\"bcporxvxcjzhqizx\",\"type\":\"pxtgqscjav\"},{\"properties\":{\"value\":\"uhdqazk\",\"currentValue\":\"gg\",\"description\":\"pijrajcivmmghf\",\"documentationLink\":\"iwrxgkn\",\"defaultValue\":\"vyi\",\"dataType\":\"qodfvp\",\"allowedValues\":\"hoxgsgbpf\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"bqvgaqv\",\"name\":\"gafcqu\",\"type\":\"rdve\"},{\"properties\":{\"value\":\"sdtutnwlduyc\",\"currentValue\":\"zhyrmewipmve\",\"description\":\"xukuqgsj\",\"documentationLink\":\"undxgketw\",\"defaultValue\":\"hzjhf\",\"dataType\":\"hvvmuvgpmun\",\"allowedValues\":\"sx\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"hsasbhu\",\"name\":\"ypoh\",\"type\":\"uemsly\"},{\"properties\":{\"value\":\"yrpfoobrlttymsj\",\"currentValue\":\"gqdnfwqzd\",\"description\":\"tilaxh\",\"documentationLink\":\"hqlyvijo\",\"defaultValue\":\"iv\",\"dataType\":\"oyzunbixxr\",\"allowedValues\":\"kvcpwpgclr\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"enxpmyyefr\",\"name\":\"mpdnqqskawa\",\"type\":\"qvmmbn\"}],\"nextLink\":\"fr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ConfigurationListResult response = manager.configurations() - .batchUpdate("wozuhkf", "bsjyofdx", - new ConfigurationListForBatchUpdate() - .withValue(Arrays.asList(new ConfigurationForBatchUpdate().withName("dttouwaboekqvkel") - .withValue("vbxwyjsflhh") - .withSource("aln"))), - com.azure.core.util.Context.NONE); + ConfigurationListResult response + = manager.configurations() + .batchUpdate("toqbeitpkxztmoob", "lftidgfcwqmpim", + new ConfigurationListForBatchUpdate().withValue(Arrays.asList( + new ConfigurationForBatchUpdate().withName("hemjy").withValue("uj").withSource("t"), + new ConfigurationForBatchUpdate().withName("ozzwculkba") + .withValue("ajnjwltlwtjj") + .withSource("ktalhsnvkcdmxz"))) + .withResetAllToDefault(ResetAllToDefault.TRUE), + com.azure.core.util.Context.NONE); - Assertions.assertEquals("xyawj", response.value().get(0).value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.value().get(0).source()); - Assertions.assertEquals("exilzznfqqnvwpmq", response.nextLink()); + Assertions.assertEquals("nwiaaomyl", response.value().get(0).value()); + Assertions.assertEquals("azul", response.value().get(0).currentValue()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.value().get(0).source()); + Assertions.assertEquals("fr", response.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java similarity index 53% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java index 933a5358c446..690fc2b4df2f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; import java.nio.charset.StandardCharsets; @@ -19,25 +18,29 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ConfigurationsUpdateMockTests { +public final class ConfigurationsCreateOrUpdateMockTests { @Test - public void testUpdate() throws Exception { + public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"jkbegibtnmxiebww\",\"description\":\"oayqc\",\"defaultValue\":\"rtzju\",\"dataType\":\"wyzmhtxon\",\"allowedValues\":\"ts\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"srknftguv\",\"name\":\"iuhprwmdyvxqta\",\"type\":\"riwwroy\"}"; + = "{\"properties\":{\"value\":\"kyxvxevblbjedn\",\"currentValue\":\"lageuaulxun\",\"description\":\"jbnkpp\",\"documentationLink\":\"nenlsvxeizzg\",\"defaultValue\":\"lnsrmffe\",\"dataType\":\"xcktpiymerteeamm\",\"allowedValues\":\"iekkkzddrtkgdojb\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"esvecuijpx\",\"name\":\"xs\",\"type\":\"wprtu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Configuration response = manager.configurations() - .update("euecivyhzceuoj", "jrwjueiotwm", "dytdxwitx", - new ConfigurationInner().withValue("awgqwgxhni").withSource(ConfigurationSource.USER_OVERRIDE), - com.azure.core.util.Context.NONE); + .define("qdrfegcealzxwhc") + .withExistingFlexibleServer("qlkzme", "nitgvkxlz") + .withValue("ymo") + .withCurrentValue("hlwigdivbkbxg") + .withSource(ConfigurationSource.USER_OVERRIDE) + .create(); - Assertions.assertEquals("jkbegibtnmxiebww", response.value()); + Assertions.assertEquals("kyxvxevblbjedn", response.value()); + Assertions.assertEquals("lageuaulxun", 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 index 7853ffad70a1..ef4cf7edd66e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; @@ -22,20 +22,21 @@ public final class ConfigurationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"gzva\",\"description\":\"pjyzhpv\",\"defaultValue\":\"zcjrvxdjzlmwlx\",\"dataType\":\"ug\",\"allowedValues\":\"zovawjvz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"nxipeil\",\"name\":\"jzuaejxdultskzbb\",\"type\":\"dzumveekg\"}"; + = "{\"properties\":{\"value\":\"vusfzld\",\"currentValue\":\"zuxylfsbtkadpyso\",\"description\":\"btgkbugrjqctoj\",\"documentationLink\":\"isofieypefojyqd\",\"defaultValue\":\"u\",\"dataType\":\"cp\",\"allowedValues\":\"wkhihihlhzdsqt\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"hfgmvecactxm\",\"name\":\"oteyowc\",\"type\":\"uqovekqvgqouwif\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Configuration response = manager.configurations() - .getWithResponse("bexrmcq", "bycnojvkn", "e", com.azure.core.util.Context.NONE) + .getWithResponse("agy", "wqfbylyrfgiagt", "ojocqwogf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("gzva", response.value()); + Assertions.assertEquals("vusfzld", response.value()); + Assertions.assertEquals("zuxylfsbtkadpyso", response.currentValue()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java index 832008e19121..afe0440fb2db 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; @@ -23,19 +23,21 @@ public final class ConfigurationsListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"wj\",\"description\":\"gdrjervnaenqpe\",\"defaultValue\":\"ndoygmifthnzdnd\",\"dataType\":\"gnayqigynduh\",\"allowedValues\":\"hqlkthumaqo\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"tgccymvaolpss\",\"name\":\"qlfmmdnbb\",\"type\":\"lzpswiydm\"}]}"; + = "{\"value\":[{\"properties\":{\"value\":\"lxubyj\",\"currentValue\":\"fmmfblcqcu\",\"description\":\"gqibrtalmetttw\",\"documentationLink\":\"slqxi\",\"defaultValue\":\"rmooizqse\",\"dataType\":\"xiutcx\",\"allowedValues\":\"zhyrpeto\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"nhl\",\"name\":\"brqnkkzjcjb\",\"type\":\"rgaehvvibrxjj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.configurations().listByServer("aruoujmkcjhwqyt", "r", com.azure.core.util.Context.NONE); + PagedIterable response = manager.configurations() + .listByServer("mpjw", "ivqikfxcvhr", "sphuagrttikteus", "c", 1626546819, 2144343781, + com.azure.core.util.Context.NONE); - Assertions.assertEquals("wj", response.iterator().next().value()); + Assertions.assertEquals("lxubyj", response.iterator().next().value()); + Assertions.assertEquals("fmmfblcqcu", response.iterator().next().currentValue()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.iterator().next().source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java index c136870ba978..e96b8379b464 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,17 +12,17 @@ public final class DatabaseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DatabaseInner model = BinaryData.fromString( - "{\"properties\":{\"charset\":\"zqqedq\",\"collation\":\"bciqfouflm\"},\"id\":\"kzsmodm\",\"name\":\"lougpbkw\",\"type\":\"mutduqktaps\"}") + "{\"properties\":{\"charset\":\"ckhsmtxpsieb\",\"collation\":\"hvpesapskrdqm\"},\"id\":\"jdhtldwkyzxu\",\"name\":\"tkncwsc\",\"type\":\"svlxotogtwrup\"}") .toObject(DatabaseInner.class); - Assertions.assertEquals("zqqedq", model.charset()); - Assertions.assertEquals("bciqfouflm", model.collation()); + Assertions.assertEquals("ckhsmtxpsieb", model.charset()); + Assertions.assertEquals("hvpesapskrdqm", model.collation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("zqqedq").withCollation("bciqfouflm"); + DatabaseInner model = new DatabaseInner().withCharset("ckhsmtxpsieb").withCollation("hvpesapskrdqm"); model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("zqqedq", model.charset()); - Assertions.assertEquals("bciqfouflm", model.collation()); + Assertions.assertEquals("ckhsmtxpsieb", model.charset()); + Assertions.assertEquals("hvpesapskrdqm", model.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java index 9534a12cf1d5..8aa04c4db86e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java @@ -1,34 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.models.DatabaseListResult; 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\":\"ddgmb\",\"collation\":\"ex\"},\"id\":\"bhtqqrolfpfpsa\",\"name\":\"gbquxigj\",\"type\":\"jgzjaoyfhrtx\"}],\"nextLink\":\"n\"}") + "{\"value\":[{\"properties\":{\"charset\":\"fj\",\"collation\":\"njbkcnxdhbttkph\"},\"id\":\"pnvjtoqnermclf\",\"name\":\"lphox\",\"type\":\"scrpabgyepsbjt\"}],\"nextLink\":\"qugxywpmueefjzwf\"}") .toObject(DatabaseListResult.class); - Assertions.assertEquals("ddgmb", model.value().get(0).charset()); - Assertions.assertEquals("ex", model.value().get(0).collation()); - Assertions.assertEquals("n", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = new DatabaseListResult() - .withValue(Arrays.asList(new DatabaseInner().withCharset("ddgmb").withCollation("ex"))) - .withNextLink("n"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("ddgmb", model.value().get(0).charset()); - Assertions.assertEquals("ex", model.value().get(0).collation()); - Assertions.assertEquals("n", model.nextLink()); + Assertions.assertEquals("fj", model.value().get(0).charset()); + Assertions.assertEquals("njbkcnxdhbttkph", model.value().get(0).collation()); + Assertions.assertEquals("qugxywpmueefjzwf", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java index 5d4e07dfa5a0..01ffd8f608da 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,17 +11,17 @@ public final class DatabasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DatabaseProperties model = BinaryData.fromString("{\"charset\":\"gcue\",\"collation\":\"umkdosvqwhbmd\"}") + DatabaseProperties model = BinaryData.fromString("{\"charset\":\"xvnmicykvceov\",\"collation\":\"lo\"}") .toObject(DatabaseProperties.class); - Assertions.assertEquals("gcue", model.charset()); - Assertions.assertEquals("umkdosvqwhbmd", model.collation()); + Assertions.assertEquals("xvnmicykvceov", model.charset()); + Assertions.assertEquals("lo", model.collation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("gcue").withCollation("umkdosvqwhbmd"); + DatabaseProperties model = new DatabaseProperties().withCharset("xvnmicykvceov").withCollation("lo"); model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("gcue", model.charset()); - Assertions.assertEquals("umkdosvqwhbmd", model.collation()); + Assertions.assertEquals("xvnmicykvceov", model.charset()); + Assertions.assertEquals("lo", model.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java index 1559c79cbc77..7e93b3508ca5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.Database; @@ -21,23 +21,23 @@ public final class DatabasesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"charset\":\"qhakauhashsf\",\"collation\":\"osow\"},\"id\":\"cugicjoox\",\"name\":\"j\",\"type\":\"bwpucwwfvovbv\"}"; + = "{\"properties\":{\"charset\":\"ez\",\"collation\":\"hokvbwnh\"},\"id\":\"qlgehg\",\"name\":\"pipifh\",\"type\":\"f\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Database response = manager.databases() - .define("vfadmws") - .withExistingFlexibleServer("hcdhmdual", "exq") - .withCharset("gvxp") - .withCollation("omzlfmi") + .define("knfnwmbtmvpdv") + .withExistingFlexibleServer("whryvycytdcl", "gc") + .withCharset("ttzaefed") + .withCollation("hchrphkmcrjdqn") .create(); - Assertions.assertEquals("qhakauhashsf", response.charset()); - Assertions.assertEquals("osow", response.collation()); + Assertions.assertEquals("ez", response.charset()); + Assertions.assertEquals("hokvbwnh", response.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java index 73d9cf1c8bd6..25d51c75232f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.databases().delete("fjz", "fqkquj", "dsuyonobgla", com.azure.core.util.Context.NONE); + manager.databases().delete("mes", "kdlpa", "zrcxfailcfxwmdbo", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java index ff3abec478ab..3bb2a40366a0 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.Database; @@ -21,19 +21,20 @@ public final class DatabasesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"charset\":\"xy\",\"collation\":\"moyrxvwfudwpz\"},\"id\":\"xhdzhlrqjbhckf\",\"name\":\"lhrxsbkyvpyc\",\"type\":\"n\"}"; + = "{\"properties\":{\"charset\":\"dqbwpypqtgsfja\",\"collation\":\"slhhxudbxv\"},\"id\":\"htnsi\",\"name\":\"ud\",\"type\":\"z\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - Database response - = manager.databases().getWithResponse("cq", "tcc", "g", com.azure.core.util.Context.NONE).getValue(); + Database response = manager.databases() + .getWithResponse("wsawddjibabxvi", "itvtzeexavo", "tfgle", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("xy", response.charset()); - Assertions.assertEquals("moyrxvwfudwpz", response.collation()); + Assertions.assertEquals("dqbwpypqtgsfja", response.charset()); + Assertions.assertEquals("slhhxudbxv", response.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java index 0778ef785294..309f53da552d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.Database; @@ -22,18 +22,19 @@ public final class DatabasesListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"charset\":\"fkuwbcrnwbmehhse\",\"collation\":\"jusrtslhspk\"},\"id\":\"emaofmxagkvt\",\"name\":\"elmqk\",\"type\":\"hahvljuahaq\"}]}"; + = "{\"value\":[{\"properties\":{\"charset\":\"kknhxkizvytnrzv\",\"collation\":\"jraaeranokqguk\"},\"id\":\"qnvb\",\"name\":\"oylaxxul\",\"type\":\"disdosfjbjsvgj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.databases().listByServer("z", "p", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.databases().listByServer("dfgsftufqobrj", "nac", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fkuwbcrnwbmehhse", response.iterator().next().charset()); - Assertions.assertEquals("jusrtslhspk", response.iterator().next().collation()); + Assertions.assertEquals("kknhxkizvytnrzv", response.iterator().next().charset()); + Assertions.assertEquals("jraaeranokqguk", response.iterator().next().collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java index 0935f5fafd9d..9b90fac79c61 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class DelegatedSubnetUsageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DelegatedSubnetUsage model - = BinaryData.fromString("{\"subnetName\":\"ezrkgqhcjrefo\",\"usage\":149589040651836260}") + = BinaryData.fromString("{\"subnetName\":\"ioilqukrydxtq\",\"usage\":4739380056500631916}") .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/FeaturePropertyTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FeaturePropertyTests.java new file mode 100644 index 000000000000..4ae4f78d52af --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FeaturePropertyTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.FeatureProperty; + +public final class FeaturePropertyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FeatureProperty model = BinaryData.fromString("{\"featureName\":\"nyga\",\"featureValue\":\"idb\"}") + .toObject(FeatureProperty.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java index 8e9b401f9cb6..cc227bb8d2a3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,18 +12,17 @@ public final class FirewallRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FirewallRuleInner model = BinaryData.fromString( - "{\"properties\":{\"startIpAddress\":\"kufubljo\",\"endIpAddress\":\"xqeofjaeqjhqjba\"},\"id\":\"msmjqulngsntn\",\"name\":\"ybkzgcwr\",\"type\":\"clxxwrljdo\"}") + "{\"properties\":{\"startIpAddress\":\"kqujidsuyono\",\"endIpAddress\":\"glaocq\"},\"id\":\"ccm\",\"name\":\"yudxytlmoy\",\"type\":\"xv\"}") .toObject(FirewallRuleInner.class); - Assertions.assertEquals("kufubljo", model.startIpAddress()); - Assertions.assertEquals("xqeofjaeqjhqjba", model.endIpAddress()); + Assertions.assertEquals("kqujidsuyono", model.startIpAddress()); + Assertions.assertEquals("glaocq", model.endIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FirewallRuleInner model - = new FirewallRuleInner().withStartIpAddress("kufubljo").withEndIpAddress("xqeofjaeqjhqjba"); + FirewallRuleInner model = new FirewallRuleInner().withStartIpAddress("kqujidsuyono").withEndIpAddress("glaocq"); model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("kufubljo", model.startIpAddress()); - Assertions.assertEquals("xqeofjaeqjhqjba", model.endIpAddress()); + Assertions.assertEquals("kqujidsuyono", model.startIpAddress()); + Assertions.assertEquals("glaocq", model.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java index 581cc87c32e4..6419beadf756 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java @@ -1,37 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.models.FirewallRuleListResult; 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\":\"sainqpjwnzl\",\"endIpAddress\":\"jfm\"},\"id\":\"eebvmgxsab\",\"name\":\"yqduujit\",\"type\":\"jczdzevndh\"},{\"properties\":{\"startIpAddress\":\"rwpdappdsbdkvwrw\",\"endIpAddress\":\"feusnhut\"},\"id\":\"ltmrldh\",\"name\":\"gjzzdatqxhocdg\",\"type\":\"ablgphuticndvk\"},{\"properties\":{\"startIpAddress\":\"ozwyiftyhxhuro\",\"endIpAddress\":\"ftyxolniw\"},\"id\":\"cukjf\",\"name\":\"giawx\",\"type\":\"lryplwckbasyy\"},{\"properties\":{\"startIpAddress\":\"nddhsgcbacph\",\"endIpAddress\":\"jkot\"},\"id\":\"qgoulznd\",\"name\":\"i\",\"type\":\"wyqkgfgibm\"}],\"nextLink\":\"gakeqsr\"}") + "{\"value\":[{\"properties\":{\"startIpAddress\":\"kfrlhrxsbky\",\"endIpAddress\":\"pycanuzbpz\"},\"id\":\"fkuwbcrnwbmehhse\",\"name\":\"v\",\"type\":\"us\"}],\"nextLink\":\"slhs\"}") .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("sainqpjwnzl", model.value().get(0).startIpAddress()); - Assertions.assertEquals("jfm", model.value().get(0).endIpAddress()); - Assertions.assertEquals("gakeqsr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = new FirewallRuleListResult() - .withValue(Arrays.asList(new FirewallRuleInner().withStartIpAddress("sainqpjwnzl").withEndIpAddress("jfm"), - new FirewallRuleInner().withStartIpAddress("rwpdappdsbdkvwrw").withEndIpAddress("feusnhut"), - new FirewallRuleInner().withStartIpAddress("ozwyiftyhxhuro").withEndIpAddress("ftyxolniw"), - new FirewallRuleInner().withStartIpAddress("nddhsgcbacph").withEndIpAddress("jkot"))) - .withNextLink("gakeqsr"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("sainqpjwnzl", model.value().get(0).startIpAddress()); - Assertions.assertEquals("jfm", model.value().get(0).endIpAddress()); - Assertions.assertEquals("gakeqsr", model.nextLink()); + Assertions.assertEquals("kfrlhrxsbky", model.value().get(0).startIpAddress()); + Assertions.assertEquals("pycanuzbpz", model.value().get(0).endIpAddress()); + Assertions.assertEquals("slhs", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java index f1efbd76ba03..92890d52a1e3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,18 +12,18 @@ public final class FirewallRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FirewallRuleProperties model - = BinaryData.fromString("{\"startIpAddress\":\"skcqvkocrcjd\",\"endIpAddress\":\"wtnhxbnjbiksqr\"}") + = BinaryData.fromString("{\"startIpAddress\":\"fudwpznt\",\"endIpAddress\":\"hdzhlrqj\"}") .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("skcqvkocrcjd", model.startIpAddress()); - Assertions.assertEquals("wtnhxbnjbiksqr", model.endIpAddress()); + Assertions.assertEquals("fudwpznt", model.startIpAddress()); + Assertions.assertEquals("hdzhlrqj", model.endIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FirewallRuleProperties model - = new FirewallRuleProperties().withStartIpAddress("skcqvkocrcjd").withEndIpAddress("wtnhxbnjbiksqr"); + = new FirewallRuleProperties().withStartIpAddress("fudwpznt").withEndIpAddress("hdzhlrqj"); model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("skcqvkocrcjd", model.startIpAddress()); - Assertions.assertEquals("wtnhxbnjbiksqr", model.endIpAddress()); + Assertions.assertEquals("fudwpznt", model.startIpAddress()); + Assertions.assertEquals("hdzhlrqj", model.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java index 9b3ee450ed37..14d806a8a160 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; @@ -21,23 +21,23 @@ public final class FirewallRulesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"startIpAddress\":\"nermcl\",\"endIpAddress\":\"plpho\"},\"id\":\"scrpabgyepsbjt\",\"name\":\"zq\",\"type\":\"gxywpmue\"}"; + = "{\"properties\":{\"startIpAddress\":\"tffyaqit\",\"endIpAddress\":\"hheioqaqhvseuf\"},\"id\":\"yrxpdlcgqls\",\"name\":\"smjqfrddgam\",\"type\":\"uhiosrsju\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FirewallRule response = manager.firewallRules() - .define("o") - .withExistingFlexibleServer("cwsvlxotog", "wrupqsxvnmicykvc") - .withStartIpAddress("eil") - .withEndIpAddress("vnotyfjfcnj") + .define("xnmwmqtibxyijddt") + .withExistingFlexibleServer("ebwjscjpahlxvea", "f") + .withStartIpAddress("qcttadijaeukmrsi") + .withEndIpAddress("ekpndzaapmudq") .create(); - Assertions.assertEquals("nermcl", response.startIpAddress()); - Assertions.assertEquals("plpho", response.endIpAddress()); + Assertions.assertEquals("tffyaqit", response.startIpAddress()); + Assertions.assertEquals("hheioqaqhvseuf", response.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java index 31dbe402d1e4..9814a084ff72 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.firewallRules().delete("lcuhxwtctyqiklb", "ovplw", "bhvgy", com.azure.core.util.Context.NONE); + manager.firewallRules().delete("llibphbqzmizak", "kan", "jpdn", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java index d0af043e676d..f23a29a5e504 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; @@ -21,20 +21,20 @@ public final class FirewallRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"startIpAddress\":\"mg\",\"endIpAddress\":\"xnkjzkdesl\"},\"id\":\"lopwiyig\",\"name\":\"xpkd\",\"type\":\"zb\"}"; + = "{\"properties\":{\"startIpAddress\":\"egprhptil\",\"endIpAddress\":\"ucb\"},\"id\":\"tgdqohmcwsldriz\",\"name\":\"tpwb\",\"type\":\"a\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FirewallRule response = manager.firewallRules() - .getWithResponse("gu", "svmkfssxquk", "fpl", com.azure.core.util.Context.NONE) + .getWithResponse("oajvgcxtxjcs", "eafidltugsresm", "ssjhoiftxfkf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mg", response.startIpAddress()); - Assertions.assertEquals("xnkjzkdesl", response.endIpAddress()); + Assertions.assertEquals("egprhptil", response.startIpAddress()); + Assertions.assertEquals("ucb", response.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java index 68aa34daa2b0..5b08d7d892fc 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; @@ -22,19 +22,19 @@ public final class FirewallRulesListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"startIpAddress\":\"txp\",\"endIpAddress\":\"ie\"},\"id\":\"fhvpesaps\",\"name\":\"rdqmhjjdhtldwkyz\",\"type\":\"uutkncw\"}]}"; + = "{\"value\":[{\"properties\":{\"startIpAddress\":\"eecjmeis\",\"endIpAddress\":\"stvasylwxdzaumw\"},\"id\":\"ohguuf\",\"name\":\"zboyjathwt\",\"type\":\"olbaemwmdx\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.firewallRules().listByServer("iuebbaumny", "upedeojnabckhs", com.azure.core.util.Context.NONE); + = manager.firewallRules().listByServer("zhajoylhjlmuo", "xprimrsop", com.azure.core.util.Context.NONE); - Assertions.assertEquals("txp", response.iterator().next().startIpAddress()); - Assertions.assertEquals("ie", response.iterator().next().endIpAddress()); + Assertions.assertEquals("eecjmeis", response.iterator().next().startIpAddress()); + Assertions.assertEquals("stvasylwxdzaumw", 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 new file mode 100644 index 000000000000..4c47d3110669 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":[\"gmaajrm\"]}") + .toObject(FullBackupStoreDetails.class); + Assertions.assertEquals("gmaajrm", model.sasUriList().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FullBackupStoreDetails model = new FullBackupStoreDetails().withSasUriList(Arrays.asList("gmaajrm")); + model = BinaryData.fromObject(model).toObject(FullBackupStoreDetails.class); + Assertions.assertEquals("gmaajrm", model.sasUriList().get(0)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java index d07d80224ed3..06449be56670 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,17 +11,8 @@ public final class GetPrivateDnsZoneSuffixResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model - = BinaryData.fromString("{\"privateDnsZoneSuffix\":\"sounqecanoaeu\"}") - .toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("sounqecanoaeu", model.privateDnsZoneSuffix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model - = new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("sounqecanoaeu"); - model = BinaryData.fromObject(model).toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("sounqecanoaeu", model.privateDnsZoneSuffix()); + GetPrivateDnsZoneSuffixResponseInner model = BinaryData.fromString("{\"privateDnsZoneSuffix\":\"brhu\"}") + .toObject(GetPrivateDnsZoneSuffixResponseInner.class); + Assertions.assertEquals("brhu", model.privateDnsZoneSuffix()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java index 7803691ca982..bc4b9fd457c3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixResponse; @@ -20,18 +20,18 @@ public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"privateDnsZoneSuffix\":\"dtmhrkwofyyvoqa\"}"; + String responseStr = "{\"privateDnsZoneSuffix\":\"mzqwmvtxnjmxmcu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); GetPrivateDnsZoneSuffixResponse response = manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("dtmhrkwofyyvoqa", response.privateDnsZoneSuffix()); + Assertions.assertEquals("mzqwmvtxnjmxmcu", response.privateDnsZoneSuffix()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java index d46c6fb05e39..004337025da2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,18 +13,19 @@ public final class HighAvailabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HighAvailability model = BinaryData - .fromString("{\"mode\":\"ZoneRedundant\",\"state\":\"NotEnabled\",\"standbyAvailabilityZone\":\"cryuan\"}") + .fromString( + "{\"mode\":\"ZoneRedundant\",\"state\":\"RemovingStandby\",\"standbyAvailabilityZone\":\"jzzd\"}") .toObject(HighAvailability.class); Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); - Assertions.assertEquals("cryuan", model.standbyAvailabilityZone()); + Assertions.assertEquals("jzzd", model.standbyAvailabilityZone()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HighAvailability model = new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT) - .withStandbyAvailabilityZone("cryuan"); + HighAvailability model + = new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("jzzd"); model = BinaryData.fromObject(model).toObject(HighAvailability.class); Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); - Assertions.assertEquals("cryuan", model.standbyAvailabilityZone()); + Assertions.assertEquals("jzzd", model.standbyAvailabilityZone()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java new file mode 100644 index 000000000000..9326767faf76 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; +import org.junit.jupiter.api.Assertions; + +public final class HighAvailabilityValidationEstimationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HighAvailabilityValidationEstimationInner model = BinaryData.fromString( + "{\"estimatedDowntime\":1830162271,\"scheduledStandbyAvailabilityZone\":\"pgzgq\",\"expectedStandbyAvailabilityZone\":\"zloc\"}") + .toObject(HighAvailabilityValidationEstimationInner.class); + Assertions.assertEquals("zloc", model.expectedStandbyAvailabilityZone()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HighAvailabilityValidationEstimationInner model + = new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("zloc"); + model = BinaryData.fromObject(model).toObject(HighAvailabilityValidationEstimationInner.class); + Assertions.assertEquals("zloc", model.expectedStandbyAvailabilityZone()); + } +} 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 index e088da35fa14..b6e59d5290f4 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -15,7 +16,7 @@ public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Identity model = BinaryData.fromString( - "{\"principalId\":\"qjnqglhqgnufoooj\",\"tenantId\":\"ifsqesaagdfmg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zntocipaouajps\":\"dataxrifkwmrvkts\"}}") + "{\"principalId\":\"gbquxigj\",\"tenantId\":\"gzjaoyfhrtxilne\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"jvtbvpyss\":{\"principalId\":\"vlejuvfqa\",\"clientId\":\"lyxwjkcprbnwbx\"},\"uitnwuiz\":{\"principalId\":\"nruj\",\"clientId\":\"uhmuouqfprwzwbn\"},\"rfidfvzwdz\":{\"principalId\":\"zxufiz\",\"clientId\":\"kyfi\"}}}") .toObject(Identity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } @@ -23,7 +24,8 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { Identity model = new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("zntocipaouajps", "dataxrifkwmrvkts")); + .withUserAssignedIdentities(mapOf("jvtbvpyss", new UserAssignedIdentity(), "uitnwuiz", + new UserAssignedIdentity(), "rfidfvzwdz", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(Identity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java new file mode 100644 index 000000000000..11594bfc215a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.ImportFromStorageResponseType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ImportFromStorageResponseTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImportFromStorageResponseType model = BinaryData + .fromString( + "{\"objectType\":\"ImportFromStorageResponse\",\"estimatedCompletionTime\":\"2021-05-11T07:59:48Z\"}") + .toObject(ImportFromStorageResponseType.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T07:59:48Z"), model.estimatedCompletionTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java index 16dd179e5c16..02415267b83e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilityProperties; @@ -21,17 +21,17 @@ public final class LocationBasedCapabilitiesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"zone\":\"adbzmnvdfznud\",\"supportedHAMode\":[\"vxzbncb\",\"ylpstdbhhxsrzdz\",\"cers\",\"dntnevf\"],\"supportedGeoBackupRegions\":[\"mygtdssls\",\"tmweriofzpyq\",\"emwabnet\",\"hhszh\"],\"supportedFlexibleServerEditions\":[{\"name\":\"vwiwubmwmbesld\",\"supportedStorageEditions\":[{\"name\":\"tppjflcx\",\"minStorageSize\":3058762238955275057,\"maxStorageSize\":2510700461860168657,\"minBackupRetentionDays\":93220061334436953,\"maxBackupRetentionDays\":2991398819380628456},{\"name\":\"mkqzeqqkdltfzxmh\",\"minStorageSize\":4664695938466420383,\"maxStorageSize\":290569327537915175,\"minBackupRetentionDays\":820800207830190162,\"maxBackupRetentionDays\":5369174747362686105}],\"supportedServerVersions\":[{\"name\":\"xtibqdxbxwakbog\",\"supportedSkus\":[{},{},{}]},{\"name\":\"lkzgxhuriplbp\",\"supportedSkus\":[{},{},{},{}]}]},{\"name\":\"nkbebxmuby\",\"supportedStorageEditions\":[{\"name\":\"lrb\",\"minStorageSize\":8228747938287613437,\"maxStorageSize\":9145634763199835148,\"minBackupRetentionDays\":4523060122413380781,\"maxBackupRetentionDays\":2880173002615591497},{\"name\":\"l\",\"minStorageSize\":4929519207657456173,\"maxStorageSize\":8105546637199671811,\"minBackupRetentionDays\":8220583929714824601,\"maxBackupRetentionDays\":2432465930399611430}],\"supportedServerVersions\":[{\"name\":\"gcj\",\"supportedSkus\":[{}]},{\"name\":\"muvp\",\"supportedSkus\":[{}]},{\"name\":\"um\",\"supportedSkus\":[{}]},{\"name\":\"xe\",\"supportedSkus\":[{},{}]}]},{\"name\":\"btbhjpglkfgohd\",\"supportedStorageEditions\":[{\"name\":\"lfphsdyhtozfikd\",\"minStorageSize\":2120097512911222232,\"maxStorageSize\":891560083261976989,\"minBackupRetentionDays\":2092756450243660051,\"maxBackupRetentionDays\":6214959618688242083}],\"supportedServerVersions\":[{\"name\":\"hqzonosggbhcoh\",\"supportedSkus\":[{},{}]},{\"name\":\"jnkaljutiiswacff\",\"supportedSkus\":[{}]},{\"name\":\"zewk\",\"supportedSkus\":[{},{},{}]},{\"name\":\"crailvpn\",\"supportedSkus\":[{},{},{}]}]},{\"name\":\"flrwd\",\"supportedStorageEditions\":[{\"name\":\"xyjrxsagafcnih\",\"minStorageSize\":3130876298104392093,\"maxStorageSize\":7972426552267245030,\"minBackupRetentionDays\":8610358802606955668,\"maxBackupRetentionDays\":6066782690220181009},{\"name\":\"cvqvpkeqdcv\",\"minStorageSize\":5404644626428061791,\"maxStorageSize\":4054103831441569061,\"minBackupRetentionDays\":3436329358206451649,\"maxBackupRetentionDays\":6797997194848060096}],\"supportedServerVersions\":[{\"name\":\"pcjwv\",\"supportedSkus\":[{},{}]},{\"name\":\"d\",\"supportedSkus\":[{}]},{\"name\":\"cxrslpmutwuoe\",\"supportedSkus\":[{},{}]}]}]}]}"; + = "{\"value\":[{\"zone\":\"birdsvuwcobiegs\",\"supportedHAMode\":[\"inwjizcilngh\",\"shejjtbxqm\"],\"supportedGeoBackupRegions\":[\"xlxqzvn\",\"rsbycucrwn\",\"mikzeb\"],\"supportedFlexibleServerEditions\":[{\"name\":\"mswziq\",\"supportedStorageEditions\":[{\"name\":\"okzrus\",\"minStorageSize\":1298554269715069775,\"maxStorageSize\":9222553191715006506,\"minBackupRetentionDays\":5199519854326701791,\"maxBackupRetentionDays\":5304499923399164472,\"minBackupIntervalHours\":8188906980935877313,\"maxBackupIntervalHours\":653571144085928241}],\"supportedServerVersions\":[{\"name\":\"vumwmxqh\",\"supportedSkus\":[{},{},{}]}]},{\"name\":\"oamld\",\"supportedStorageEditions\":[{\"name\":\"ohdjhhflzok\",\"minStorageSize\":1867355881553192384,\"maxStorageSize\":1100672907696653041,\"minBackupRetentionDays\":5958311403338730339,\"maxBackupRetentionDays\":8142761797538490880,\"minBackupIntervalHours\":2159915633768308562,\"maxBackupIntervalHours\":8104478418656505228},{\"name\":\"ftgz\",\"minStorageSize\":6123043499529132871,\"maxStorageSize\":5239547603354777125,\"minBackupRetentionDays\":3650774650630934451,\"maxBackupRetentionDays\":8041884881158230737,\"minBackupIntervalHours\":4983178459596212758,\"maxBackupIntervalHours\":7073196543042110246},{\"name\":\"m\",\"minStorageSize\":926180935823108880,\"maxStorageSize\":2747344239164426794,\"minBackupRetentionDays\":7225694249988782506,\"maxBackupRetentionDays\":9179068643802450667,\"minBackupIntervalHours\":8743829512964463352,\"maxBackupIntervalHours\":3210872962894477741},{\"name\":\"tfmpcycilrmcayk\",\"minStorageSize\":1278559896090227479,\"maxStorageSize\":7854368110590008856,\"minBackupRetentionDays\":1377741870083987751,\"maxBackupRetentionDays\":645933725582619027,\"minBackupIntervalHours\":6940085023434351835,\"maxBackupIntervalHours\":6212137092519851284}],\"supportedServerVersions\":[{\"name\":\"nthjtwkjaosrxuzv\",\"supportedSkus\":[{},{},{},{}]},{\"name\":\"tcqiosmg\",\"supportedSkus\":[{}]}]},{\"name\":\"gxq\",\"supportedStorageEditions\":[{\"name\":\"tlt\",\"minStorageSize\":5185737430210196834,\"maxStorageSize\":1522364843172111954,\"minBackupRetentionDays\":773093768865892885,\"maxBackupRetentionDays\":2331751686960828607,\"minBackupIntervalHours\":7131832436161976191,\"maxBackupIntervalHours\":560485342476270994},{\"name\":\"qeqala\",\"minStorageSize\":5757680972052260534,\"maxStorageSize\":2285507075880761300,\"minBackupRetentionDays\":9185198515701434959,\"maxBackupRetentionDays\":8910312326776481517,\"minBackupIntervalHours\":144963050942155735,\"maxBackupIntervalHours\":434990106020614048},{\"name\":\"reeudzqavb\",\"minStorageSize\":8831511636690175836,\"maxStorageSize\":1465450309959087886,\"minBackupRetentionDays\":6252857739303914193,\"maxBackupRetentionDays\":2240241891123749255,\"minBackupIntervalHours\":3262041802648537720,\"maxBackupIntervalHours\":7389766894389519511},{\"name\":\"jyuojqtobaxkjeyt\",\"minStorageSize\":7103604818912185763,\"maxStorageSize\":1092833770450672714,\"minBackupRetentionDays\":5043868103508202186,\"maxBackupRetentionDays\":143163252550926951,\"minBackupIntervalHours\":3923529219175299110,\"maxBackupIntervalHours\":390651230016617705}],\"supportedServerVersions\":[{\"name\":\"jqhden\",\"supportedSkus\":[{},{}]},{\"name\":\"kpak\",\"supportedSkus\":[{},{}]}]}]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.locationBasedCapabilities().list("wyhzdx", com.azure.core.util.Context.NONE); + = manager.locationBasedCapabilities().list("du", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java new file mode 100644 index 000000000000..400c18030485 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LocationBasedCapabilitySetsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"supportedGeoBackupRegions\":[\"xkjibnxmy\",\"uxswqrntvl\",\"ijpstte\",\"oqq\"],\"supportedFlexibleServerEditions\":[{\"name\":\"yufmhruncuwmq\",\"defaultSku\":\"kcdqzhlct\",\"defaultStorageSize\":1266865634,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{},{}]},{\"name\":\"fpch\",\"defaultSku\":\"bnjj\",\"defaultStorageSize\":1329002824,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"oxjumvqqo\"},{\"name\":\"hrraiouaubrj\"},{\"name\":\"oq\"}],\"supportedFeatures\":[{\"featureName\":\"jrngif\",\"featureValue\":\"z\"},{\"featureName\":\"sccbiuimzd\",\"featureValue\":\"jdfqwmkyoqufdvr\"},{\"featureName\":\"slzojh\",\"featureValue\":\"tfnmdx\"}]},\"id\":\"ngfdgugeyzihgrky\",\"name\":\"i\",\"type\":\"absnmfpp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Capability response = manager.locationBasedCapabilitySets() + .getWithResponse("yb", "wwpgdakchzyvlixq", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java new file mode 100644 index 000000000000..6480d29f9f93 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LocationBasedCapabilitySetsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"supportedGeoBackupRegions\":[\"gzfc\",\"bgomfgbegl\"],\"supportedFlexibleServerEditions\":[{\"name\":\"o\",\"defaultSku\":\"betnluankrrfxee\",\"defaultStorageSize\":955300686,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{}]},{\"name\":\"vbmqzbqq\",\"defaultSku\":\"aj\",\"defaultStorageSize\":99469711,\"supportedStorageEditions\":[{},{},{}],\"supportedSkus\":[{},{},{}]},{\"name\":\"ehjku\",\"defaultSku\":\"oafgaoql\",\"defaultStorageSize\":1667694351,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{},{}]},{\"name\":\"mfgvxirpghriypo\",\"defaultSku\":\"yhlqhykprlpyznu\",\"defaultStorageSize\":184808617,\"supportedStorageEditions\":[{},{},{}],\"supportedSkus\":[{}]}],\"supportedServerVersions\":[{\"name\":\"tdfuxt\"},{\"name\":\"siibmiybnnustgn\"}],\"supportedFeatures\":[{\"featureName\":\"mgixhcmavmqfou\",\"featureValue\":\"rhc\"},{\"featureName\":\"yprotwyp\",\"featureValue\":\"d\"},{\"featureName\":\"xhugcm\",\"featureValue\":\"avlg\"}]},\"id\":\"bmftpmdt\",\"name\":\"fjltfvnzcyjtotp\",\"type\":\"opv\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.locationBasedCapabilitySets().list("ojeevy", 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 new file mode 100644 index 000000000000..0b104874df43 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":344648925743063561,\"createdTime\":\"2021-02-02T19:48:06Z\",\"type\":\"fsxlzevgbmqjqa\",\"lastModifiedTime\":\"2021-05-28T08:17:24Z\",\"url\":\"mivkwlzuvcc\"},\"id\":\"nfnbacfionlebxe\",\"name\":\"qgtz\",\"type\":\"dpnqbq\"}") + .toObject(LogFileInner.class); + Assertions.assertEquals(344648925743063561L, model.sizeInKB()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T19:48:06Z"), model.createdTime()); + Assertions.assertEquals("fsxlzevgbmqjqa", model.typePropertiesType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T08:17:24Z"), model.lastModifiedTime()); + Assertions.assertEquals("mivkwlzuvcc", 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 new file mode 100644 index 000000000000..21ab74818917 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.LogFileListResult; +import java.time.OffsetDateTime; +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\":4492808256673380449,\"createdTime\":\"2021-05-26T04:34:13Z\",\"type\":\"c\",\"lastModifiedTime\":\"2021-05-24T19:14:27Z\",\"url\":\"ddtocjjxhvp\"},\"id\":\"uexhdzx\",\"name\":\"bqe\",\"type\":\"jnxqbzvddntwn\"},{\"properties\":{\"sizeInKB\":4634265215487541073,\"createdTime\":\"2021-04-25T10:33:03Z\",\"type\":\"pzaoqvuhr\",\"lastModifiedTime\":\"2021-10-26T22:45:48Z\",\"url\":\"cyddglmjthjqk\"},\"id\":\"yeicxmqciwqvhk\",\"name\":\"ixuigdtopbobj\",\"type\":\"ghmewuam\"},{\"properties\":{\"sizeInKB\":5747639335856339043,\"createdTime\":\"2021-02-11T14:54:06Z\",\"type\":\"vtpgvdfgiotkf\",\"lastModifiedTime\":\"2021-07-18T12:38:02Z\",\"url\":\"xlngx\"},\"id\":\"fgugnxkrxdqmid\",\"name\":\"thz\",\"type\":\"vqdra\"},{\"properties\":{\"sizeInKB\":1792328791586876480,\"createdTime\":\"2021-02-21T23:50:40Z\",\"type\":\"h\",\"lastModifiedTime\":\"2021-02-13T15:34:58Z\",\"url\":\"owskanyktz\"},\"id\":\"u\",\"name\":\"y\",\"type\":\"gqywgndrv\"}],\"nextLink\":\"hzgpphrcgyncocpe\"}") + .toObject(LogFileListResult.class); + Assertions.assertEquals(4492808256673380449L, model.value().get(0).sizeInKB()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T04:34:13Z"), model.value().get(0).createdTime()); + Assertions.assertEquals("c", model.value().get(0).typePropertiesType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T19:14:27Z"), model.value().get(0).lastModifiedTime()); + Assertions.assertEquals("ddtocjjxhvp", model.value().get(0).url()); + Assertions.assertEquals("hzgpphrcgyncocpe", 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 new file mode 100644 index 000000000000..fceaf939a309 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":5189225722324922790,\"createdTime\":\"2021-03-10T05:04:31Z\",\"type\":\"al\",\"lastModifiedTime\":\"2021-01-01T22:31:01Z\",\"url\":\"ubisnjampmng\"}") + .toObject(LogFileProperties.class); + Assertions.assertEquals(5189225722324922790L, model.sizeInKB()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T05:04:31Z"), model.createdTime()); + Assertions.assertEquals("al", model.type()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T22:31:01Z"), model.lastModifiedTime()); + Assertions.assertEquals("ubisnjampmng", 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 new file mode 100644 index 000000000000..fac4e92e6419 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LogFilesListByServerMockTests { + @Test + public void testListByServer() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"sizeInKB\":1685798888080605918,\"createdTime\":\"2021-10-11T02:34:35Z\",\"type\":\"geivsiykzkdncj\",\"lastModifiedTime\":\"2021-05-05T17:45:23Z\",\"url\":\"bzo\"},\"id\":\"culapzwyrpgogtq\",\"name\":\"epnylbfu\",\"type\":\"jlyjtlvofq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.logFiles().listByServer("drihpfhoqcaaewda", "mdjvlpj", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(1685798888080605918L, response.iterator().next().sizeInKB()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T02:34:35Z"), response.iterator().next().createdTime()); + Assertions.assertEquals("geivsiykzkdncj", response.iterator().next().typePropertiesType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T17:45:23Z"), + response.iterator().next().lastModifiedTime()); + Assertions.assertEquals("bzo", response.iterator().next().url()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupOperationsCreateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupOperationsCreateMockTests.java new file mode 100644 index 000000000000..b84669fcc3f3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupOperationsCreateMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LongRunningBackupOperationsCreateMockTests { + @Test + public void testCreate() throws Exception { + String responseStr + = "{\"properties\":{\"backupNameV2\":\"faxvxil\",\"backupType\":\"FULL\",\"completedTime\":\"2021-07-08T19:53:14Z\",\"source\":\"nzeyqxtjj\",\"provisioningState\":\"Succeeded\"},\"id\":\"qhycavodggxdbees\",\"name\":\"ieknl\",\"type\":\"ariaawi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ServerBackupV2 response = manager.longRunningBackupOperations() + .define("roud") + .withExistingFlexibleServer("g", "khocxvdfffwaf") + .withBackupNameV2("avehhrvkbunzo") + .withBackupType(BackupType.FULL) + .withCompletedTime(OffsetDateTime.parse("2021-10-22T01:37:19Z")) + .withSource("gkmoyxcdyuibhmfd") + .create(); + + Assertions.assertEquals("faxvxil", response.backupNameV2()); + Assertions.assertEquals(BackupType.FULL, response.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T19:53:14Z"), response.completedTime()); + Assertions.assertEquals("nzeyqxtjj", response.source()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsGetWithResponseMockTests.java new file mode 100644 index 000000000000..3e2d6a274f9d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsGetWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LongRunningBackupsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"backupNameV2\":\"yik\",\"backupType\":\"FULL\",\"completedTime\":\"2021-02-02T17:56:52Z\",\"source\":\"avluwmncs\",\"provisioningState\":\"Failed\"},\"id\":\"fybvpoek\",\"name\":\"sgsgbdhu\",\"type\":\"qgnjdgkynscli\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ServerBackupV2 response = manager.longRunningBackups() + .getWithResponse("zysdzh", "zwwva", "qyuvvfonkp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("yik", response.backupNameV2()); + Assertions.assertEquals(BackupType.FULL, response.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T17:56:52Z"), response.completedTime()); + Assertions.assertEquals("avluwmncs", response.source()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsListMockTests.java new file mode 100644 index 000000000000..b1213aafc891 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsListMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LongRunningBackupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"backupNameV2\":\"hfrbbc\",\"backupType\":\"FULL\",\"completedTime\":\"2021-01-31T02:09:30Z\",\"source\":\"ltd\",\"provisioningState\":\"Creating\"},\"id\":\"qojpy\",\"name\":\"vgtrdcnifmzzs\",\"type\":\"ymbrnysuxmpraf\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.longRunningBackups().list("hzvhxnkomtkubo", "ppnvdxz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("hfrbbc", response.iterator().next().backupNameV2()); + Assertions.assertEquals(BackupType.FULL, response.iterator().next().backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T02:09:30Z"), + response.iterator().next().completedTime()); + Assertions.assertEquals("ltd", response.iterator().next().source()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java new file mode 100644 index 000000000000..c4adc4797d59 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceInner model = BinaryData.fromString( + "{\"properties\":{\"maintenanceType\":\"SecurityPatches\",\"maintenanceState\":\"Completed\",\"maintenanceStartTime\":\"2020-12-21T08:33:57Z\",\"maintenanceEndTime\":\"2021-09-13T15:52:55Z\",\"maintenanceExecutionStartTime\":\"2021-04-22T07:35:58Z\",\"maintenanceExecutionEndTime\":\"2021-01-13T16:19:33Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-05-22T05:07:43Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-11-22T10:46:24Z\",\"maintenanceTitle\":\"dsg\",\"maintenanceDescription\":\"hmk\",\"provisioningState\":\"Failed\"},\"id\":\"auwjuetaebu\",\"name\":\"u\",\"type\":\"dmovsm\"}") + .toObject(MaintenanceInner.class); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T08:33:57Z"), model.maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java new file mode 100644 index 000000000000..9d792c77233c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.MaintenanceListResult; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-10-17T20:39:57Z\",\"maintenanceEndTime\":\"2021-09-05T12:18:35Z\",\"maintenanceExecutionStartTime\":\"2021-05-27T17:39:47Z\",\"maintenanceExecutionEndTime\":\"2021-03-24T11:35:49Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-09-02T10:45:19Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-05-19T12:55:30Z\",\"maintenanceTitle\":\"zkoj\",\"maintenanceDescription\":\"c\",\"provisioningState\":\"Deleting\"},\"id\":\"qouicybxarzgsz\",\"name\":\"foxciq\",\"type\":\"p\"},{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"InPreparation\",\"maintenanceStartTime\":\"2021-11-18T04:50:58Z\",\"maintenanceEndTime\":\"2021-07-02T17:31:40Z\",\"maintenanceExecutionStartTime\":\"2021-11-05T16:40:13Z\",\"maintenanceExecutionEndTime\":\"2021-03-05T14:35:53Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-03-27T21:44:23Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-08-02T02:33:16Z\",\"maintenanceTitle\":\"zbonlwnt\",\"maintenanceDescription\":\"gokdwbwhks\",\"provisioningState\":\"Creating\"},\"id\":\"rvexztvb\",\"name\":\"qgsfraoyzkoow\",\"type\":\"lmnguxaw\"}],\"nextLink\":\"ldsyuuximerqfob\"}") + .toObject(MaintenanceListResult.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T20:39:57Z"), + model.value().get(0).maintenanceStartTime()); + Assertions.assertEquals("ldsyuuximerqfob", model.nextLink()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePolicyTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePolicyTests.java new file mode 100644 index 000000000000..bfa1448250f5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePolicyTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenancePolicy; +import com.azure.resourcemanager.mysqlflexibleserver.models.PatchStrategy; +import org.junit.jupiter.api.Assertions; + +public final class MaintenancePolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenancePolicy model + = BinaryData.fromString("{\"patchStrategy\":\"Regular\"}").toObject(MaintenancePolicy.class); + Assertions.assertEquals(PatchStrategy.REGULAR, model.patchStrategy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenancePolicy model = new MaintenancePolicy().withPatchStrategy(PatchStrategy.REGULAR); + model = BinaryData.fromObject(model).toObject(MaintenancePolicy.class); + Assertions.assertEquals(PatchStrategy.REGULAR, model.patchStrategy()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java new file mode 100644 index 000000000000..2dc1fb5659be --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MaintenancePropertiesForUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenancePropertiesForUpdate model + = BinaryData.fromString("{\"maintenanceStartTime\":\"2021-04-16T00:49:55Z\"}") + .toObject(MaintenancePropertiesForUpdate.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-16T00:49:55Z"), model.maintenanceStartTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenancePropertiesForUpdate model = new MaintenancePropertiesForUpdate() + .withMaintenanceStartTime(OffsetDateTime.parse("2021-04-16T00:49:55Z")); + model = BinaryData.fromObject(model).toObject(MaintenancePropertiesForUpdate.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-16T00:49:55Z"), model.maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java new file mode 100644 index 000000000000..e9b5be87c67a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MaintenancePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceProperties model = BinaryData.fromString( + "{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"InPreparation\",\"maintenanceStartTime\":\"2021-07-14T09:12:45Z\",\"maintenanceEndTime\":\"2021-06-22T12:18:54Z\",\"maintenanceExecutionStartTime\":\"2021-09-19T02:18:46Z\",\"maintenanceExecutionEndTime\":\"2021-08-18T18:08:28Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-11-25T20:27:09Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-11-12T13:25:33Z\",\"maintenanceTitle\":\"u\",\"maintenanceDescription\":\"jmqlgkfb\",\"provisioningState\":\"Creating\"}") + .toObject(MaintenanceProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T09:12:45Z"), model.maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java new file mode 100644 index 000000000000..07aebb20beec --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceUpdate model + = BinaryData.fromString("{\"properties\":{\"maintenanceStartTime\":\"2021-01-15T20:49Z\"}}") + .toObject(MaintenanceUpdate.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T20:49Z"), model.maintenanceStartTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceUpdate model + = new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2021-01-15T20:49Z")); + model = BinaryData.fromObject(model).toObject(MaintenanceUpdate.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T20:49Z"), model.maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java index 2a5f164e4c5f..254d1ad83510 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.BatchOfMaintenance; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import org.junit.jupiter.api.Assertions; @@ -12,24 +13,27 @@ public final class MaintenanceWindowTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaintenanceWindow model = BinaryData.fromString( - "{\"customWindow\":\"ryrtihfxtijbpzv\",\"startHour\":1041467339,\"startMinute\":706884387,\"dayOfWeek\":2084129316}") + "{\"customWindow\":\"f\",\"startHour\":763703494,\"startMinute\":1359237516,\"dayOfWeek\":1510106337,\"batchOfMaintenance\":\"Batch2\"}") .toObject(MaintenanceWindow.class); - Assertions.assertEquals("ryrtihfxtijbpzv", model.customWindow()); - Assertions.assertEquals(1041467339, model.startHour()); - Assertions.assertEquals(706884387, model.startMinute()); - Assertions.assertEquals(2084129316, model.dayOfWeek()); + Assertions.assertEquals("f", model.customWindow()); + Assertions.assertEquals(763703494, model.startHour()); + Assertions.assertEquals(1359237516, model.startMinute()); + Assertions.assertEquals(1510106337, model.dayOfWeek()); + Assertions.assertEquals(BatchOfMaintenance.BATCH2, model.batchOfMaintenance()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("ryrtihfxtijbpzv") - .withStartHour(1041467339) - .withStartMinute(706884387) - .withDayOfWeek(2084129316); + MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("f") + .withStartHour(763703494) + .withStartMinute(1359237516) + .withDayOfWeek(1510106337) + .withBatchOfMaintenance(BatchOfMaintenance.BATCH2); model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("ryrtihfxtijbpzv", model.customWindow()); - Assertions.assertEquals(1041467339, model.startHour()); - Assertions.assertEquals(706884387, model.startMinute()); - Assertions.assertEquals(2084129316, model.dayOfWeek()); + Assertions.assertEquals("f", model.customWindow()); + Assertions.assertEquals(763703494, model.startHour()); + Assertions.assertEquals(1359237516, model.startMinute()); + Assertions.assertEquals(1510106337, model.dayOfWeek()); + Assertions.assertEquals(BatchOfMaintenance.BATCH2, model.batchOfMaintenance()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java new file mode 100644 index 000000000000..74bbaff7d085 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenancesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-06-22T19:10:38Z\",\"maintenanceEndTime\":\"2021-04-16T07:06:36Z\",\"maintenanceExecutionStartTime\":\"2021-10-05T01:07:04Z\",\"maintenanceExecutionEndTime\":\"2021-03-06T02:52:17Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-02-20T13:36:52Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-11-19T16:29:04Z\",\"maintenanceTitle\":\"ap\",\"maintenanceDescription\":\"tf\",\"provisioningState\":\"Failed\"},\"id\":\"wexjkmfxapjwogq\",\"name\":\"nobpudcdabtqwpw\",\"type\":\"awbzasqb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.maintenances().list("pcpil", "hahzvechndbnwi", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T19:10:38Z"), + response.iterator().next().maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java new file mode 100644 index 000000000000..248a763d106a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenancesReadWithResponseMockTests { + @Test + public void testReadWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Scheduled\",\"maintenanceStartTime\":\"2021-03-18T19:42:08Z\",\"maintenanceEndTime\":\"2021-03-22T00:47:49Z\",\"maintenanceExecutionStartTime\":\"2021-01-09T19:50:10Z\",\"maintenanceExecutionEndTime\":\"2021-01-19T20:58:49Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-02-06T04:09:54Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-03-08T08:25:42Z\",\"maintenanceTitle\":\"dxbzlmcmuap\",\"maintenanceDescription\":\"hdbevwqqxeyskon\",\"provisioningState\":\"Deleting\"},\"id\":\"kfkbgbzbowxeqocl\",\"name\":\"mygvkzqkj\",\"type\":\"eokbze\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Maintenance response = manager.maintenances() + .readWithResponse("bdb", "qgqqihedsvqwthmk", "ibcysihsgqc", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T19:42:08Z"), response.maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java new file mode 100644 index 000000000000..fbd0dbfe2aae --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; +import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenancesUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"InPreparation\",\"maintenanceStartTime\":\"2021-04-25T00:58:51Z\",\"maintenanceEndTime\":\"2021-06-12T11:34:11Z\",\"maintenanceExecutionStartTime\":\"2021-04-07T05:14:22Z\",\"maintenanceExecutionEndTime\":\"2021-12-01T10:07:37Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-07-10T16:11Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-11-10T20:05:46Z\",\"maintenanceTitle\":\"ostzelndlatu\",\"maintenanceDescription\":\"zlbiojlvfhrbbpn\",\"provisioningState\":\"Succeeded\"},\"id\":\"wwyyurmoch\",\"name\":\"prprsnmokay\",\"type\":\"ejnhlbkpb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Maintenance response = manager.maintenances() + .update("ezrxcczurtleipqx", "kwv", "gnzvdfbzdixzm", + new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2021-03-19T22:04:23Z")), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T00:58:51Z"), response.maintenanceStartTime()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java index a9986676fa5c..4895ebc4a3ea 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,20 +12,10 @@ public final class NameAvailabilityInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NameAvailabilityInner model - = BinaryData.fromString("{\"message\":\"attpngjcrcczsq\",\"nameAvailable\":true,\"reason\":\"mdajv\"}") + = BinaryData.fromString("{\"message\":\"ffovjzhpj\",\"nameAvailable\":false,\"reason\":\"jmfxumvf\"}") .toObject(NameAvailabilityInner.class); - Assertions.assertEquals("attpngjcrcczsq", model.message()); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("mdajv", model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model - = new NameAvailabilityInner().withMessage("attpngjcrcczsq").withNameAvailable(true).withReason("mdajv"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals("attpngjcrcczsq", model.message()); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("mdajv", model.reason()); + Assertions.assertEquals("ffovjzhpj", model.message()); + Assertions.assertFalse(model.nameAvailable()); + Assertions.assertEquals("jmfxumvf", model.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java index ee624a88a2b0..6b4ef76986c7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,17 +11,17 @@ public final class NameAvailabilityRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NameAvailabilityRequest model - = BinaryData.fromString("{\"name\":\"qsl\",\"type\":\"yvxyqjp\"}").toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("qsl", model.name()); - Assertions.assertEquals("yvxyqjp", model.type()); + NameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"xorgg\",\"type\":\"hyaomtbghhavgr\"}") + .toObject(NameAvailabilityRequest.class); + Assertions.assertEquals("xorgg", model.name()); + Assertions.assertEquals("hyaomtbghhavgr", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NameAvailabilityRequest model = new NameAvailabilityRequest().withName("qsl").withType("yvxyqjp"); + NameAvailabilityRequest model = new NameAvailabilityRequest().withName("xorgg").withType("hyaomtbghhavgr"); model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("qsl", model.name()); - Assertions.assertEquals("yvxyqjp", model.type()); + Assertions.assertEquals("xorgg", model.name()); + Assertions.assertEquals("hyaomtbghhavgr", model.type()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java index 3fbd9a373720..3cda59d97592 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -12,18 +13,21 @@ public final class NetworkTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Network model = BinaryData.fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"delegatedSubnetResourceId\":\"zdxtayrlhmwhf\",\"privateDnsZoneResourceId\":\"rqobmtuk\"}") + "{\"publicNetworkAccess\":\"Disabled\",\"delegatedSubnetResourceId\":\"hocdgeab\",\"privateDnsZoneResourceId\":\"phut\"}") .toObject(Network.class); - Assertions.assertEquals("zdxtayrlhmwhf", model.delegatedSubnetResourceId()); - Assertions.assertEquals("rqobmtuk", model.privateDnsZoneResourceId()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals("hocdgeab", model.delegatedSubnetResourceId()); + Assertions.assertEquals("phut", model.privateDnsZoneResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Network model - = new Network().withDelegatedSubnetResourceId("zdxtayrlhmwhf").withPrivateDnsZoneResourceId("rqobmtuk"); + Network model = new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED) + .withDelegatedSubnetResourceId("hocdgeab") + .withPrivateDnsZoneResourceId("phut"); model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals("zdxtayrlhmwhf", model.delegatedSubnetResourceId()); - Assertions.assertEquals("rqobmtuk", model.privateDnsZoneResourceId()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals("hocdgeab", model.delegatedSubnetResourceId()); + Assertions.assertEquals("phut", model.privateDnsZoneResourceId()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java index ea811568e306..34fb8867bb28 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java @@ -1,35 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"wkuofoskghsauu\",\"resource\":\"jmvxie\",\"operation\":\"ugidyjrr\",\"description\":\"y\"}") + "{\"provider\":\"qhabifpikxwcz\",\"resource\":\"scnpqxuhivy\",\"operation\":\"iwbybrkxvdumjg\",\"description\":\"fwvuk\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("wkuofoskghsauu", model.provider()); - Assertions.assertEquals("jmvxie", model.resource()); - Assertions.assertEquals("ugidyjrr", model.operation()); - Assertions.assertEquals("y", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("wkuofoskghsauu") - .withResource("jmvxie") - .withOperation("ugidyjrr") - .withDescription("y"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("wkuofoskghsauu", model.provider()); - Assertions.assertEquals("jmvxie", model.resource()); - Assertions.assertEquals("ugidyjrr", model.operation()); - Assertions.assertEquals("y", model.description()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java index e6507813cb7e..14fb37039a8a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java @@ -1,58 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"ys\",\"display\":{\"provider\":\"iuxhqyudxorr\",\"resource\":\"b\",\"operation\":\"czvyifq\",\"description\":\"kdvjsll\"},\"origin\":\"vvdfwatkpnpul\",\"properties\":{\"ruwiqzbqjvsov\":\"databczw\",\"hzdobpxjmflbvvnc\":\"datayokacspkw\",\"rsa\":\"datarkcciwwzjuqk\"}}") + "{\"name\":\"fp\",\"display\":{\"provider\":\"obmtukk\",\"resource\":\"yrtih\",\"operation\":\"tijbpzvgnwzsymgl\",\"description\":\"fcyzkohdbihanufh\"},\"origin\":\"user,system\",\"properties\":{\"git\":\"datas\"}}") .toObject(OperationInner.class); - Assertions.assertEquals("ys", model.name()); - Assertions.assertEquals("iuxhqyudxorr", model.display().provider()); - Assertions.assertEquals("b", model.display().resource()); - Assertions.assertEquals("czvyifq", model.display().operation()); - Assertions.assertEquals("kdvjsll", model.display().description()); - Assertions.assertEquals("vvdfwatkpnpul", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("ys") - .withDisplay(new OperationDisplay().withProvider("iuxhqyudxorr") - .withResource("b") - .withOperation("czvyifq") - .withDescription("kdvjsll")) - .withOrigin("vvdfwatkpnpul") - .withProperties( - mapOf("ruwiqzbqjvsov", "databczw", "hzdobpxjmflbvvnc", "datayokacspkw", "rsa", "datarkcciwwzjuqk")); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("ys", model.name()); - Assertions.assertEquals("iuxhqyudxorr", model.display().provider()); - Assertions.assertEquals("b", model.display().resource()); - Assertions.assertEquals("czvyifq", model.display().operation()); - Assertions.assertEquals("kdvjsll", model.display().description()); - Assertions.assertEquals("vvdfwatkpnpul", model.origin()); - } - - // Use "Map.of" if available - @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 index 9662b875c5fb..b03f67aa0591 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java @@ -1,62 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.models.OperationListResult; import org.junit.jupiter.api.Assertions; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"hltrpmopjmcmatuo\",\"display\":{\"provider\":\"fu\",\"resource\":\"aodsfcpkv\",\"operation\":\"dpuozmyz\",\"description\":\"agfuaxbezyiu\"},\"origin\":\"ktwh\",\"properties\":{\"wqsmbsur\":\"datawz\"}}],\"nextLink\":\"imoryocfsfksym\"}") + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"properties\":{\"lrxybqsoq\":\"dataoizh\"}},{\"name\":\"gkdmb\",\"display\":{\"provider\":\"lobcufpdznrbtcq\",\"resource\":\"nq\",\"operation\":\"hqgnufooojywif\",\"description\":\"esaagdfm\"},\"origin\":\"user,system\",\"properties\":{\"rifkwm\":\"dataj\",\"ajpsquc\":\"datavktsizntocipao\"}},{\"name\":\"o\",\"display\":{\"provider\":\"kfo\",\"resource\":\"nygj\",\"operation\":\"jddeqsrdeupewnw\",\"description\":\"itjz\"},\"origin\":\"user,system\",\"properties\":{\"rkdtmlxh\":\"dataarhmofcqhsmy\",\"arcryuanzwuxzdxt\":\"datakuksjtxukcdm\"}}],\"nextLink\":\"rlhm\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).name()); - Assertions.assertEquals("fu", model.value().get(0).display().provider()); - Assertions.assertEquals("aodsfcpkv", model.value().get(0).display().resource()); - Assertions.assertEquals("dpuozmyz", model.value().get(0).display().operation()); - Assertions.assertEquals("agfuaxbezyiu", model.value().get(0).display().description()); - Assertions.assertEquals("ktwh", model.value().get(0).origin()); - Assertions.assertEquals("imoryocfsfksym", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model - = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("hltrpmopjmcmatuo") - .withDisplay(new OperationDisplay().withProvider("fu") - .withResource("aodsfcpkv") - .withOperation("dpuozmyz") - .withDescription("agfuaxbezyiu")) - .withOrigin("ktwh") - .withProperties(mapOf("wqsmbsur", "datawz")))).withNextLink("imoryocfsfksym"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).name()); - Assertions.assertEquals("fu", model.value().get(0).display().provider()); - Assertions.assertEquals("aodsfcpkv", model.value().get(0).display().resource()); - Assertions.assertEquals("dpuozmyz", model.value().get(0).display().operation()); - Assertions.assertEquals("agfuaxbezyiu", model.value().get(0).display().description()); - Assertions.assertEquals("ktwh", model.value().get(0).origin()); - Assertions.assertEquals("imoryocfsfksym", model.nextLink()); - } - - // Use "Map.of" if available - @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; + Assertions.assertEquals("rlhm", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java new file mode 100644 index 000000000000..fd47b55807aa --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; + +public final class OperationProgressResponseTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationProgressResponseType model + = BinaryData.fromString("{\"objectType\":\"OperationProgressResponseType\"}") + .toObject(OperationProgressResponseType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java index a267c54bc1f7..be68f759c9bc 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.Operation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -22,22 +21,16 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"iexpbtgiwbwo\",\"display\":{\"provider\":\"ashrt\",\"resource\":\"kcnqxwbpo\",\"operation\":\"lpiujwaa\",\"description\":\"pqiiobyuqe\"},\"origin\":\"qlpqwcciuq\",\"properties\":{\"kuwhh\":\"databutauvfb\",\"koymkcd\":\"datahykojoxafnndlpic\",\"pkkpw\":\"datah\",\"jxywsuws\":\"datareqnovvqfov\"}}]}"; + = "{\"value\":[{\"name\":\"kh\",\"display\":{\"provider\":\"goo\",\"resource\":\"kqfqjbvl\",\"operation\":\"rfmluiqtq\",\"description\":\"avyvnqqyba\"},\"origin\":\"user\",\"properties\":{\"ernntiewdjcvbquw\":\"datayjkqabqgzslesjcb\",\"f\":\"databehwagohb\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("iexpbtgiwbwo", response.iterator().next().name()); - Assertions.assertEquals("ashrt", response.iterator().next().display().provider()); - Assertions.assertEquals("kcnqxwbpo", response.iterator().next().display().resource()); - Assertions.assertEquals("lpiujwaa", response.iterator().next().display().operation()); - Assertions.assertEquals("pqiiobyuqe", response.iterator().next().display().description()); - Assertions.assertEquals("qlpqwcciuq", response.iterator().next().origin()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..9a1e2ebfca67 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionInnerTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"groupIds\":[\"vkaozwyiftyhxhur\",\"k\"],\"privateEndpoint\":{\"id\":\"xolniwpwcukjfk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"xklrypl\",\"actionsRequired\":\"kbasyypn\"},\"provisioningState\":\"Failed\"},\"id\":\"gcbacphejkot\",\"name\":\"nqgoulzndli\",\"type\":\"wyqkgfgibm\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xklrypl", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("kbasyypn", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionInner model + = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("xklrypl") + .withActionsRequired("kbasyypn")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xklrypl", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("kbasyypn", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionListResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionListResultInnerTests.java new file mode 100644 index 000000000000..06538779c3cd --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionListResultInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionListResultInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupIds\":[\"bykutw\"],\"privateEndpoint\":{\"id\":\"pagmhrskdsnf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"akgtdlmkkzevdlh\",\"actionsRequired\":\"pusdstt\"},\"provisioningState\":\"Deleting\"},\"id\":\"vbbejdcng\",\"name\":\"qmoa\",\"type\":\"ufgmjzrwrdg\"},{\"properties\":{\"groupIds\":[\"enuuzkopbm\",\"nrfdw\"],\"privateEndpoint\":{\"id\":\"hhziuief\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"dmsmlm\",\"actionsRequired\":\"hoftr\"},\"provisioningState\":\"Succeeded\"},\"id\":\"u\",\"name\":\"ah\",\"type\":\"icslfaoq\"}],\"nextLink\":\"iyylhalnswhccsp\"}") + .toObject(PrivateEndpointConnectionListResultInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("akgtdlmkkzevdlh", + model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("pusdstt", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("iyylhalnswhccsp", model.nextLink()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..ed5b565ea76a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"groupIds\":[\"akeqs\",\"xybz\"],\"privateEndpoint\":{\"id\":\"dqytbciqfouflmm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"modmglougpb\",\"actionsRequired\":\"tmut\"},\"provisioningState\":\"Failed\"}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("modmglougpb", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("tmut", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model + = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("modmglougpb") + .withActionsRequired("tmut")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("modmglougpb", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("tmut", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..8e6609878f76 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"fmd\",\"ragegi\",\"vcjfelisdjubggb\"],\"privateEndpoint\":{\"id\":\"kxkbsazgakgacyr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"mspofapvuhryl\",\"actionsRequired\":\"ofrzgb\"},\"provisioningState\":\"Succeeded\"},\"id\":\"mstk\",\"name\":\"nlvxbcuii\",\"type\":\"nktwfansnvpdibmi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .define("vsqltnzoibgsxg") + .withExistingFlexibleServer("gtayxonsupeujlz", "nh") + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("nhe") + .withActionsRequired("qpofvwbc")) + .create(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("mspofapvuhryl", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("ofrzgb", response.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteMockTests.java new file mode 100644 index 000000000000..8d1a532cd896 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.privateEndpointConnections() + .delete("aabzmif", "ygznmmaxrizk", "obgop", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1f68a9c786ec --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"qwazlnqnmcjngzq\",\"qxtbjwgnyf\",\"sf\",\"svtui\"],\"privateEndpoint\":{\"id\":\"ajqglcf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"qryxyn\",\"actionsRequired\":\"zrdpsovwxznptgoe\"},\"provisioningState\":\"Creating\"},\"id\":\"abpfhvfs\",\"name\":\"kvntjlrigjkskyri\",\"type\":\"ovzidsx\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .getWithResponse("clj", "kyexaoguyaipi", "sdaultxij", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("qryxyn", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("zrdpsovwxznptgoe", response.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerWithResponseMockTests.java new file mode 100644 index 000000000000..2d17f632788b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionsListByServerWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListByServerWithResponseMockTests { + @Test + public void testListByServerWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupIds\":[\"tifdwfmvi\"],\"privateEndpoint\":{\"id\":\"qj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"h\",\"actionsRequired\":\"glka\"},\"provisioningState\":\"Failed\"},\"id\":\"qjujeickpzvcp\",\"name\":\"pmxelnwcltyje\",\"type\":\"ex\"},{\"properties\":{\"groupIds\":[\"mkqscaz\"],\"privateEndpoint\":{\"id\":\"xtzx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"wabzxrvxcushsp\",\"actionsRequired\":\"ivmxyasfl\"},\"provisioningState\":\"Failed\"},\"id\":\"zwywako\",\"name\":\"hknsmjbl\",\"type\":\"ljhlnymzotq\"}],\"nextLink\":\"yuzcbmqqvxmvw\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnectionListResult response = manager.privateEndpointConnections() + .listByServerWithResponse("lhslnelxieixyn", "lxecwcrojphslh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + response.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("h", response.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("glka", response.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("yuzcbmqqvxmvw", response.nextLink()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..159611fce92d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"ta\"}").toObject(PrivateEndpoint.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint(); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourceInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..61d4d48cbc91 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourceInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupId\":\"ivwitqscywugg\",\"requiredMembers\":[\"uhczbwemh\",\"i\"],\"requiredZoneNames\":[\"rgzdwmsweyp\"]},\"id\":\"dxggicccnxqhuexm\",\"name\":\"ttlstvlzywemhz\",\"type\":\"ncsdtclusiyp\"}") + .toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("rgzdwmsweyp", model.properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourceListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourceListResultTests.java new file mode 100644 index 000000000000..0e72cae9f947 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourceListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.PrivateLinkResourceListResult; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"racstwity\",\"requiredMembers\":[\"vxccedcp\",\"md\",\"odn\"],\"requiredZoneNames\":[\"ltjcvnhltiugcxna\",\"vwxqibyqunyo\",\"xwlmdjr\"]},\"id\":\"fgbvfvpdbo\",\"name\":\"acizsjqlhkrr\",\"type\":\"bdeibqipqk\"},{\"properties\":{\"groupId\":\"xndzwm\",\"requiredMembers\":[\"fajpjorwk\",\"nyhgbijtji\"],\"requiredZoneNames\":[\"zs\",\"ab\"]},\"id\":\"systawfsdjp\",\"name\":\"kvpbjxbkzbz\",\"type\":\"dvncjabudurgk\"},{\"properties\":{\"groupId\":\"o\",\"requiredMembers\":[\"jjklff\",\"mouwqlgzrfzeey\"],\"requiredZoneNames\":[\"zi\",\"ayuhqlbjbsy\",\"bqwrvtldgm\"]},\"id\":\"gvmpipaslthaqfx\",\"name\":\"smwutwbdsrezpd\",\"type\":\"hneuyowqkd\"}]}") + .toObject(PrivateLinkResourceListResult.class); + Assertions.assertEquals("ltjcvnhltiugcxna", model.value().get(0).properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.java new file mode 100644 index 000000000000..ddecf960a2e9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcePropertiesTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResourceProperties; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceProperties model = BinaryData.fromString( + "{\"groupId\":\"fgytguslfeadcyg\",\"requiredMembers\":[\"yhejhzisxgfp\",\"lolp\",\"vk\"],\"requiredZoneNames\":[\"qvujzraehtwdwrf\",\"swibyr\",\"dl\",\"h\"]}") + .toObject(PrivateLinkResourceProperties.class); + Assertions.assertEquals("qvujzraehtwdwrf", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..ed734026a2f7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"zelfwyfwl\",\"requiredMembers\":[\"wetnpsihc\",\"afzvaylptrs\",\"qwztcmwqkc\"],\"requiredZoneNames\":[\"waxfewzjkj\",\"xfdeqvhpsyl\",\"ksh\"]},\"id\":\"ffmbmxzjrg\",\"name\":\"wwp\",\"type\":\"jx\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.privateLinkResources() + .getWithResponse("ostbzbkiwb", "qnyophzfyls", "crpfbcunez", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("waxfewzjkj", response.properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java new file mode 100644 index 000000000000..8d374d5c77b1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkResourcesListByServerMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesListByServerMockTests { + @Test + public void testListByServer() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"taqutdewem\",\"requiredMembers\":[\"vru\",\"nz\",\"jgehkf\"],\"requiredZoneNames\":[\"rtixokff\"]},\"id\":\"inljqepqwhixmo\",\"name\":\"stshiy\",\"type\":\"gvelfc\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.privateLinkResources().listByServer("nptfujgi", "gaao", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("rtixokff", response.iterator().next().properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..57b8dfa11089 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkServiceConnectionState model = BinaryData + .fromString("{\"status\":\"Approved\",\"description\":\"gcue\",\"actionsRequired\":\"umkdosvqwhbmd\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("gcue", model.description()); + Assertions.assertEquals("umkdosvqwhbmd", model.actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkServiceConnectionState model + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("gcue") + .withActionsRequired("umkdosvqwhbmd"); + model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("gcue", model.description()); + Assertions.assertEquals("umkdosvqwhbmd", model.actionsRequired()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java index 8a80f52278f9..4e5b651de632 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,21 +13,10 @@ public final class ServerBackupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerBackupInner model = BinaryData.fromString( - "{\"properties\":{\"backupType\":\"dpvwryoqpsoaccta\",\"completedTime\":\"2021-06-15T10:03:50Z\",\"source\":\"j\"},\"id\":\"hbcryffdfdosyge\",\"name\":\"paojakhmsbzjh\",\"type\":\"rzevdphlxaol\"}") + "{\"properties\":{\"backupType\":\"c\",\"completedTime\":\"2021-11-12T11:29:02Z\",\"source\":\"ooch\"},\"id\":\"onq\",\"name\":\"pkvlrxn\",\"type\":\"ea\"}") .toObject(ServerBackupInner.class); - Assertions.assertEquals("dpvwryoqpsoaccta", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T10:03:50Z"), model.completedTime()); - Assertions.assertEquals("j", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = new ServerBackupInner().withBackupType("dpvwryoqpsoaccta") - .withCompletedTime(OffsetDateTime.parse("2021-06-15T10:03:50Z")) - .withSource("j"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals("dpvwryoqpsoaccta", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T10:03:50Z"), model.completedTime()); - Assertions.assertEquals("j", model.source()); + Assertions.assertEquals("c", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-12T11:29:02Z"), model.completedTime()); + Assertions.assertEquals("ooch", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java index 3a4db45003ee..7f856126e486 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java @@ -1,42 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.implementation.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\":\"peqfpjkjl\",\"completedTime\":\"2021-11-24T18:52:18Z\",\"source\":\"dvhpfxxypininm\"},\"id\":\"huyb\",\"name\":\"kpode\",\"type\":\"ooginuvamih\"},{\"properties\":{\"backupType\":\"narxzxtheotus\",\"completedTime\":\"2021-05-22T18:50:21Z\",\"source\":\"v\"},\"id\":\"iqihn\",\"name\":\"un\",\"type\":\"bwjzr\"}],\"nextLink\":\"ygxgispemvtz\"}") + "{\"value\":[{\"properties\":{\"backupType\":\"azjpqyegualhbxxh\",\"completedTime\":\"2021-02-21T11:35:33Z\",\"source\":\"zvdudgwdslfhotwm\"},\"id\":\"npwlbjnpg\",\"name\":\"cftadeh\",\"type\":\"nltyfsoppusuesnz\"},{\"properties\":{\"backupType\":\"jbavorxzdm\",\"completedTime\":\"2021-07-20T12:25:55Z\",\"source\":\"bqvudwxdndn\"},\"id\":\"w\",\"name\":\"ujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"properties\":{\"backupType\":\"qweykhmenev\",\"completedTime\":\"2021-06-20T14:57:34Z\",\"source\":\"fwhybcibvy\"},\"id\":\"c\",\"name\":\"it\",\"type\":\"nnaamdectehfiqsc\"},{\"properties\":{\"backupType\":\"pvhez\",\"completedTime\":\"2021-04-02T10:03:16Z\",\"source\":\"hcjrefovgmk\"},\"id\":\"leyyvx\",\"name\":\"qjpkcattpngjcrc\",\"type\":\"zsqpjhvmdajvny\"}],\"nextLink\":\"unqecanoae\"}") .toObject(ServerBackupListResult.class); - Assertions.assertEquals("peqfpjkjl", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T18:52:18Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("dvhpfxxypininm", model.value().get(0).source()); - Assertions.assertEquals("ygxgispemvtz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model = new ServerBackupListResult().withValue(Arrays.asList( - new ServerBackupInner().withBackupType("peqfpjkjl") - .withCompletedTime(OffsetDateTime.parse("2021-11-24T18:52:18Z")) - .withSource("dvhpfxxypininm"), - new ServerBackupInner().withBackupType("narxzxtheotus") - .withCompletedTime(OffsetDateTime.parse("2021-05-22T18:50:21Z")) - .withSource("v"))) - .withNextLink("ygxgispemvtz"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals("peqfpjkjl", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T18:52:18Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("dvhpfxxypininm", model.value().get(0).source()); - Assertions.assertEquals("ygxgispemvtz", model.nextLink()); + Assertions.assertEquals("azjpqyegualhbxxh", model.value().get(0).backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-21T11:35:33Z"), model.value().get(0).completedTime()); + Assertions.assertEquals("zvdudgwdslfhotwm", model.value().get(0).source()); + Assertions.assertEquals("unqecanoae", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java index 976582df54bf..b7aca2cff72a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,21 +13,10 @@ public final class ServerBackupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerBackupProperties model = BinaryData.fromString( - "{\"backupType\":\"qtrgqjbpfzfsinzg\",\"completedTime\":\"2021-07-30T11:45:35Z\",\"source\":\"rwzoxxjtfelluwf\"}") + "{\"backupType\":\"ipheoflokeyyien\",\"completedTime\":\"2021-07-31T14:02:21Z\",\"source\":\"wtgrhpdjpj\"}") .toObject(ServerBackupProperties.class); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T11:45:35Z"), model.completedTime()); - Assertions.assertEquals("rwzoxxjtfelluwf", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = new ServerBackupProperties().withBackupType("qtrgqjbpfzfsinzg") - .withCompletedTime(OffsetDateTime.parse("2021-07-30T11:45:35Z")) - .withSource("rwzoxxjtfelluwf"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T11:45:35Z"), model.completedTime()); - Assertions.assertEquals("rwzoxxjtfelluwf", model.source()); + Assertions.assertEquals("ipheoflokeyyien", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T14:02:21Z"), model.completedTime()); + Assertions.assertEquals("wtgrhpdjpj", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java new file mode 100644 index 000000000000..758d32218cca --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupPropertiesV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ServerBackupPropertiesV2Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServerBackupPropertiesV2 model = BinaryData.fromString( + "{\"backupNameV2\":\"xw\",\"backupType\":\"FULL\",\"completedTime\":\"2021-04-17T05:25:38Z\",\"source\":\"bsureximo\",\"provisioningState\":\"Succeeded\"}") + .toObject(ServerBackupPropertiesV2.class); + Assertions.assertEquals("xw", model.backupNameV2()); + Assertions.assertEquals(BackupType.FULL, model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T05:25:38Z"), model.completedTime()); + Assertions.assertEquals("bsureximo", model.source()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServerBackupPropertiesV2 model = new ServerBackupPropertiesV2().withBackupNameV2("xw") + .withBackupType(BackupType.FULL) + .withCompletedTime(OffsetDateTime.parse("2021-04-17T05:25:38Z")) + .withSource("bsureximo"); + model = BinaryData.fromObject(model).toObject(ServerBackupPropertiesV2.class); + Assertions.assertEquals("xw", model.backupNameV2()); + Assertions.assertEquals(BackupType.FULL, model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T05:25:38Z"), model.completedTime()); + Assertions.assertEquals("bsureximo", model.source()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java new file mode 100644 index 000000000000..4e166cc384df --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ServerBackupV2InnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServerBackupV2Inner model = BinaryData.fromString( + "{\"properties\":{\"backupNameV2\":\"hy\",\"backupType\":\"FULL\",\"completedTime\":\"2021-04-18T06:05:11Z\",\"source\":\"opjmcmatuokthfui\",\"provisioningState\":\"Failed\"},\"id\":\"sfcpkvxodpuozm\",\"name\":\"zydagfuaxbezyiuo\",\"type\":\"ktwh\"}") + .toObject(ServerBackupV2Inner.class); + Assertions.assertEquals("hy", model.backupNameV2()); + Assertions.assertEquals(BackupType.FULL, model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T06:05:11Z"), model.completedTime()); + Assertions.assertEquals("opjmcmatuokthfui", model.source()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServerBackupV2Inner model = new ServerBackupV2Inner().withBackupNameV2("hy") + .withBackupType(BackupType.FULL) + .withCompletedTime(OffsetDateTime.parse("2021-04-18T06:05:11Z")) + .withSource("opjmcmatuokthfui"); + model = BinaryData.fromObject(model).toObject(ServerBackupV2Inner.class); + Assertions.assertEquals("hy", model.backupNameV2()); + Assertions.assertEquals(BackupType.FULL, model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T06:05:11Z"), model.completedTime()); + Assertions.assertEquals("opjmcmatuokthfui", model.source()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java new file mode 100644 index 000000000000..104db1163bb2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.models.ServerBackupV2ListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ServerBackupV2ListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServerBackupV2ListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"backupNameV2\":\"ksymd\",\"backupType\":\"FULL\",\"completedTime\":\"2021-04-07T03:00:59Z\",\"source\":\"iuxhqyudxorr\",\"provisioningState\":\"Canceled\"},\"id\":\"oczvy\",\"name\":\"fqrvkdvjsllrmvvd\",\"type\":\"watkpnpulexxb\"},{\"properties\":{\"backupNameV2\":\"truwiqzb\",\"backupType\":\"FULL\",\"completedTime\":\"2021-10-26T05:51:52Z\",\"source\":\"myokacspkwlh\",\"provisioningState\":\"Creating\"},\"id\":\"pxjmflbvvnchr\",\"name\":\"cciw\",\"type\":\"zjuqkhrsaj\"},{\"properties\":{\"backupNameV2\":\"uo\",\"backupType\":\"FULL\",\"completedTime\":\"2021-06-28T14:02:06Z\",\"source\":\"sauuimj\",\"provisioningState\":\"Succeeded\"},\"id\":\"eduugi\",\"name\":\"yjr\",\"type\":\"f\"}],\"nextLink\":\"aos\"}") + .toObject(ServerBackupV2ListResult.class); + Assertions.assertEquals("ksymd", model.value().get(0).backupNameV2()); + Assertions.assertEquals(BackupType.FULL, model.value().get(0).backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T03:00:59Z"), model.value().get(0).completedTime()); + Assertions.assertEquals("iuxhqyudxorr", model.value().get(0).source()); + Assertions.assertEquals("aos", model.nextLink()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerDetachVNetParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerDetachVNetParameterTests.java new file mode 100644 index 000000000000..622e9a262277 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerDetachVNetParameterTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerDetachVNetParameter; +import org.junit.jupiter.api.Assertions; + +public final class ServerDetachVNetParameterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServerDetachVNetParameter model + = BinaryData.fromString("{\"publicNetworkAccess\":\"Disabled\"}").toObject(ServerDetachVNetParameter.class); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServerDetachVNetParameter model + = new ServerDetachVNetParameter().withPublicNetworkAccess(EnableStatusEnum.DISABLED); + model = BinaryData.fromObject(model).toObject(ServerDetachVNetParameter.class); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java index 921678ccd5a3..594e281c7a4e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class ServerEditionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerEditionCapability model = BinaryData.fromString( - "{\"name\":\"nfnbacfionlebxe\",\"supportedStorageEditions\":[{\"name\":\"zxdpnqbqqw\",\"minStorageSize\":2526678259667108543,\"maxStorageSize\":1458668924048164836,\"minBackupRetentionDays\":383995801038376266,\"maxBackupRetentionDays\":4205827179798225737},{\"name\":\"snjampmng\",\"minStorageSize\":4715477742922953233,\"maxStorageSize\":2627336539557135356,\"minBackupRetentionDays\":4377641915122156936,\"maxBackupRetentionDays\":4315101559151768255}],\"supportedServerVersions\":[{\"name\":\"qvpkvlrxnjeaseip\",\"supportedSkus\":[{\"name\":\"lokeyy\",\"vCores\":1523460255580500378,\"supportedIops\":1246859219124083387,\"supportedMemoryPerVCoreMB\":5538754849059417919},{\"name\":\"hpdjpjumasxa\",\"vCores\":5415411474349090758,\"supportedIops\":791832081608242916,\"supportedMemoryPerVCoreMB\":5443053800820392121}]}]}") + "{\"name\":\"noigbrnjwmwk\",\"supportedStorageEditions\":[{\"name\":\"azej\",\"minStorageSize\":12239624100997197,\"maxStorageSize\":4977696240541977585,\"minBackupRetentionDays\":5604261506532945188,\"maxBackupRetentionDays\":1349265341310840343,\"minBackupIntervalHours\":6143859802750265337,\"maxBackupIntervalHours\":6959519440878263938},{\"name\":\"azpxdtnkdmkqjjl\",\"minStorageSize\":8158175845812387505,\"maxStorageSize\":8102170196891293138,\"minBackupRetentionDays\":1643740308818465085,\"maxBackupRetentionDays\":8672233382010676389,\"minBackupIntervalHours\":1489187528918123443,\"maxBackupIntervalHours\":2438040067593069072},{\"name\":\"ysjkixqtnqttez\",\"minStorageSize\":6158670602245383291,\"maxStorageSize\":3644100748262359557,\"minBackupRetentionDays\":7764702360859121907,\"maxBackupRetentionDays\":3790045830329575500,\"minBackupIntervalHours\":8146753017791851158,\"maxBackupIntervalHours\":3499164667202206083}],\"supportedServerVersions\":[{\"name\":\"ihyeozphvw\",\"supportedSkus\":[{\"name\":\"ncyg\",\"vCores\":2598536109785297193,\"supportedIops\":977765319307781958,\"supportedMemoryPerVCoreMB\":3268839905872976093}]},{\"name\":\"xqupevzhf\",\"supportedSkus\":[{\"name\":\"xhojuj\",\"vCores\":8044445982323182371,\"supportedIops\":1690476720955095356,\"supportedMemoryPerVCoreMB\":8636395279237294027},{\"name\":\"xbjxyfwnylrcools\",\"vCores\":634490199641305059,\"supportedIops\":670412733621668473,\"supportedMemoryPerVCoreMB\":4741930594875467986},{\"name\":\"jrywvtylbfpnc\",\"vCores\":4886902105690813495,\"supportedIops\":1236369078960943953,\"supportedMemoryPerVCoreMB\":7925248510268298278}]},{\"name\":\"ywub\",\"supportedSkus\":[{\"name\":\"h\",\"vCores\":4556205744842776800,\"supportedIops\":3309888278708984086,\"supportedMemoryPerVCoreMB\":7044357688574584453},{\"name\":\"hrdgoihxumwcto\",\"vCores\":1470678711970379311,\"supportedIops\":2225843863841311793,\"supportedMemoryPerVCoreMB\":5498945404155028999},{\"name\":\"wggytsbwtovvt\",\"vCores\":5602007225106690396,\"supportedIops\":3436445107461150909,\"supportedMemoryPerVCoreMB\":8135829400021520728}]}]}") .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/ServerEditionCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java new file mode 100644 index 000000000000..ca3420af2935 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; + +public final class ServerEditionCapabilityV2Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServerEditionCapabilityV2 model = BinaryData.fromString( + "{\"name\":\"ayrhyrnx\",\"defaultSku\":\"ueedndrdvs\",\"defaultStorageSize\":467483193,\"supportedStorageEditions\":[{\"name\":\"chea\",\"minStorageSize\":6465025791585269802,\"maxStorageSize\":643354499607232618,\"minBackupRetentionDays\":6161835567026119648,\"maxBackupRetentionDays\":330039316395651843,\"minBackupIntervalHours\":7254531225524696041,\"maxBackupIntervalHours\":7283451636783863796}],\"supportedSkus\":[{\"name\":\"rtfudxepxg\",\"vCores\":2932477024589855825,\"supportedIops\":8204459365601972318,\"supportedMemoryPerVCoreMB\":4744038705838577883,\"supportedZones\":[\"kghimdblxgwimfnj\",\"fjxwmsz\",\"kfoqreyfkzikfj\"],\"supportedHAMode\":[\"eaivxwczel\"]}]}") + .toObject(ServerEditionCapabilityV2.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java new file mode 100644 index 000000000000..610a90957222 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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\":\"erhhbcsglumm\"}").toObject(ServerGtidSetParameter.class); + Assertions.assertEquals("erhhbcsglumm", model.gtidSet()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServerGtidSetParameter model = new ServerGtidSetParameter().withGtidSet("erhhbcsglumm"); + model = BinaryData.fromObject(model).toObject(ServerGtidSetParameter.class); + Assertions.assertEquals("erhhbcsglumm", model.gtidSet()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java index 8f137360d146..c9453e8239be 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -13,18 +13,18 @@ public final class ServerRestartParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerRestartParameter model - = BinaryData.fromString("{\"restartWithFailover\":\"Disabled\",\"maxFailoverSeconds\":127605943}") + = BinaryData.fromString("{\"restartWithFailover\":\"Enabled\",\"maxFailoverSeconds\":1841580602}") .toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.restartWithFailover()); - Assertions.assertEquals(127605943, model.maxFailoverSeconds()); + Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); + Assertions.assertEquals(1841580602, model.maxFailoverSeconds()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServerRestartParameter model = new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.DISABLED) - .withMaxFailoverSeconds(127605943); + ServerRestartParameter model = new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.ENABLED) + .withMaxFailoverSeconds(1841580602); model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.restartWithFailover()); - Assertions.assertEquals(127605943, model.maxFailoverSeconds()); + Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); + Assertions.assertEquals(1841580602, model.maxFailoverSeconds()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java index 7c69190f0e17..112102be563e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class ServerVersionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerVersionCapability model = BinaryData.fromString( - "{\"name\":\"dslfhotwmcy\",\"supportedSkus\":[{\"name\":\"bjnpg\",\"vCores\":4922956716051761075,\"supportedIops\":6035975843137126951,\"supportedMemoryPerVCoreMB\":3248442344635598539},{\"name\":\"tyfsoppusuesn\",\"vCores\":7855206837791929967,\"supportedIops\":3766133720110583726,\"supportedMemoryPerVCoreMB\":7285729349641498197},{\"name\":\"zdmohctbqvu\",\"vCores\":2681919302417118526,\"supportedIops\":6410833982728127894,\"supportedMemoryPerVCoreMB\":9105261119317264049},{\"name\":\"ujjugwdkcglh\",\"vCores\":8375339089906225801,\"supportedIops\":5666209214569048838,\"supportedMemoryPerVCoreMB\":8619828940500740984}]}") + "{\"name\":\"qknp\",\"supportedSkus\":[{\"name\":\"epttwqmsniff\",\"vCores\":4750049326055605516,\"supportedIops\":1145064057994531415,\"supportedMemoryPerVCoreMB\":2915811233148352130},{\"name\":\"jnkrxf\",\"vCores\":7110344636471598634,\"supportedIops\":4770816984434002230,\"supportedMemoryPerVCoreMB\":8972222722429805497},{\"name\":\"ronasxift\",\"vCores\":5181737987441817400,\"supportedIops\":319144288054659459,\"supportedMemoryPerVCoreMB\":451663804662893565}]}") .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/ServerVersionCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java new file mode 100644 index 000000000000..315dd9dc5782 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; + +public final class ServerVersionCapabilityV2Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServerVersionCapabilityV2 model + = BinaryData.fromString("{\"name\":\"hdgqggeb\"}").toObject(ServerVersionCapabilityV2.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java index 4a7bdb9f85b1..6e60e24f58c5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.servers().delete("osvexcsonpclhoc", "hslkevleggzf", com.azure.core.util.Context.NONE); + manager.servers().delete("fgcviz", "zdwlvwlyoupfgfb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java index 5a4e52dc82b3..16e1ea5feda7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testFailover() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.servers().failover("ypewrmjmwvvjekt", "xsenhwlr", com.azure.core.util.Context.NONE); + manager.servers().failover("gzukxitmm", "tg", 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 new file mode 100644 index 000000000000..866412c462ff --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ServersResetGtidMockTests { + @Test + public void testResetGtid() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.servers() + .resetGtid("t", "gkxnyedabg", new ServerGtidSetParameter().withGtidSet("udtjuewbc"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java index be3a17211608..ee26fce9dc62 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; @@ -27,12 +27,12 @@ public void testRestart() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.servers() - .restart("ffrzpwvlqdqgbiqy", "ihkaetcktvfc", - new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.DISABLED) - .withMaxFailoverSeconds(1960016252), + .restart("ibrxkp", "loazuruocbgoo", + new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.ENABLED) + .withMaxFailoverSeconds(1028878744), com.azure.core.util.Context.NONE); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java index 6b012c3414e8..7edeb0820b68 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testStart() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.servers().start("kymuctqhjfbebr", "cxerf", com.azure.core.util.Context.NONE); + manager.servers().start("ybfhjxa", "vvjgslor", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java index fd74fd39d1f9..3dcd311c0e68 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testStop() throws Exception { MySqlManager manager = MySqlManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.servers().stop("wutttxfvjrbi", "phxepcyvahf", com.azure.core.util.Context.NONE); + manager.servers().stop("il", "yw", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java new file mode 100644 index 000000000000..c43aada97bed --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ServersValidateEstimateHighAvailabilityWithResponseMockTests { + @Test + public void testValidateEstimateHighAvailabilityWithResponse() throws Exception { + String responseStr + = "{\"estimatedDowntime\":1169093946,\"scheduledStandbyAvailabilityZone\":\"opidkqqfkuv\",\"expectedStandbyAvailabilityZone\":\"xkdmligo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MySqlManager manager = MySqlManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HighAvailabilityValidationEstimation response = manager.servers() + .validateEstimateHighAvailabilityWithResponse("qqxhrnxrxcpj", "isavok", + new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("tbajlkatn"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xkdmligo", response.expectedStandbyAvailabilityZone()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java index 12dcb21991f1..774af17c6677 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class SkuCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapability model = BinaryData.fromString( - "{\"name\":\"jixhbk\",\"vCores\":2989333129531555970,\"supportedIops\":833770082997190597,\"supportedMemoryPerVCoreMB\":8440294910944943050}") + "{\"name\":\"gogczhonnxkrlgny\",\"vCores\":4825751811993692044,\"supportedIops\":3260661609689361022,\"supportedMemoryPerVCoreMB\":5675818129522047029}") .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/SkuCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java new file mode 100644 index 000000000000..f87d68aa7137 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapabilityV2; + +public final class SkuCapabilityV2Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuCapabilityV2 model = BinaryData.fromString( + "{\"name\":\"uaanozjosphy\",\"vCores\":487400948243062118,\"supportedIops\":7214539270534698967,\"supportedMemoryPerVCoreMB\":1403052715618857548,\"supportedZones\":[\"vimjwos\",\"tx\",\"tcs\",\"fcktqumiekke\"],\"supportedHAMode\":[\"khly\"]}") + .toObject(SkuCapabilityV2.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java index e37325a0488d..d2a365e82ca2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -12,16 +12,16 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"ucmpoyfd\",\"tier\":\"GeneralPurpose\"}").toObject(Sku.class); - Assertions.assertEquals("ucmpoyfd", model.name()); - Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); + Sku model = BinaryData.fromString("{\"name\":\"i\",\"tier\":\"MemoryOptimized\"}").toObject(Sku.class); + Assertions.assertEquals("i", model.name()); + Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.tier()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withName("ucmpoyfd").withTier(SkuTier.GENERAL_PURPOSE); + Sku model = new Sku().withName("i").withTier(SkuTier.MEMORY_OPTIMIZED); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("ucmpoyfd", model.name()); - Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); + Assertions.assertEquals("i", model.name()); + Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.tier()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java index 15861ebb6456..e6dab86ace48 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class StorageEditionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StorageEditionCapability model = BinaryData.fromString( - "{\"name\":\"b\",\"minStorageSize\":4998269354671391171,\"maxStorageSize\":7180856606235016018,\"minBackupRetentionDays\":246259275856309822,\"maxBackupRetentionDays\":1303050182193014003}") + "{\"name\":\"irels\",\"minStorageSize\":7687952206141869241,\"maxStorageSize\":8375822631316588857,\"minBackupRetentionDays\":6225068900260031070,\"maxBackupRetentionDays\":1313618193928876084,\"minBackupIntervalHours\":5606379961327556346,\"maxBackupIntervalHours\":3710000815111343591}") .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 index 9d8b72a57eb0..1c4f6438535f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java @@ -1,33 +1,43 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.mysqlflexibleserver.models.StorageRedundancyEnum; 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\":337855308,\"iops\":419341930,\"autoGrow\":\"Disabled\",\"storageSku\":\"k\"}") + Storage model = BinaryData.fromString( + "{\"storageSizeGB\":1700892403,\"iops\":968287955,\"autoGrow\":\"Enabled\",\"logOnDisk\":\"Disabled\",\"storageSku\":\"dsbdkvwrwjf\",\"autoIoScaling\":\"Enabled\",\"storageRedundancy\":\"LocalRedundancy\"}") .toObject(Storage.class); - Assertions.assertEquals(337855308, model.storageSizeGB()); - Assertions.assertEquals(419341930, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); + Assertions.assertEquals(1700892403, model.storageSizeGB()); + Assertions.assertEquals(968287955, model.iops()); + Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoGrow()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.logOnDisk()); + Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); + Assertions.assertEquals(StorageRedundancyEnum.LOCAL_REDUNDANCY, model.storageRedundancy()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Storage model - = new Storage().withStorageSizeGB(337855308).withIops(419341930).withAutoGrow(EnableStatusEnum.DISABLED); + Storage model = new Storage().withStorageSizeGB(1700892403) + .withIops(968287955) + .withAutoGrow(EnableStatusEnum.ENABLED) + .withLogOnDisk(EnableStatusEnum.DISABLED) + .withAutoIoScaling(EnableStatusEnum.ENABLED) + .withStorageRedundancy(StorageRedundancyEnum.LOCAL_REDUNDANCY); model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(337855308, model.storageSizeGB()); - Assertions.assertEquals(419341930, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); + Assertions.assertEquals(1700892403, model.storageSizeGB()); + Assertions.assertEquals(968287955, model.iops()); + Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoGrow()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.logOnDisk()); + Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); + Assertions.assertEquals(StorageRedundancyEnum.LOCAL_REDUNDANCY, model.storageRedundancy()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/UserAssignedIdentityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..582d05d428a8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/UserAssignedIdentityTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"tymw\",\"clientId\":\"dkfthwxmnt\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} 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 new file mode 100644 index 000000000000..84220d7dbfdf --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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\":395689109}}") + .toObject(ValidateBackupResponseInner.class); + Assertions.assertEquals(395689109, 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 new file mode 100644 index 000000000000..95858b1d0051 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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\":1840754340}") + .toObject(ValidateBackupResponseProperties.class); + Assertions.assertEquals(1840754340, model.numberOfContainers()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java index 9121a347ffce..4e32798e2f89 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,16 +11,17 @@ public final class VirtualNetworkSubnetUsageParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = BinaryData.fromString("{\"virtualNetworkResourceId\":\"n\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("n", model.virtualNetworkResourceId()); + VirtualNetworkSubnetUsageParameter model + = BinaryData.fromString("{\"virtualNetworkResourceId\":\"rrghxjbdhqxvcxgf\"}") + .toObject(VirtualNetworkSubnetUsageParameter.class); + Assertions.assertEquals("rrghxjbdhqxvcxgf", model.virtualNetworkResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { VirtualNetworkSubnetUsageParameter model - = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("n"); + = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("rrghxjbdhqxvcxgf"); model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("n", model.virtualNetworkResourceId()); + Assertions.assertEquals("rrghxjbdhqxvcxgf", model.virtualNetworkResourceId()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java index 590c9ece63f3..bc2fdf29d51f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.mysqlflexibleserver.generated; @@ -11,13 +11,7 @@ public final class VirtualNetworkSubnetUsageResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkSubnetUsageResultInner model = BinaryData.fromString( - "{\"location\":\"fyexfwhy\",\"subscriptionId\":\"i\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"dcsi\",\"usage\":8188348657353643150},{\"subnetName\":\"amdecte\",\"usage\":485478669807006997},{\"subnetName\":\"cj\",\"usage\":5437486908155623563}]}") + "{\"location\":\"dsofbshrns\",\"subscriptionId\":\"uswdv\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"ycnunvjsrtk\",\"usage\":5827336550153628888},{\"subnetName\":\"pqgik\",\"usage\":3559673454895327460},{\"subnetName\":\"xdyuxzejnt\",\"usage\":7113445488264308925}]}") .toObject(VirtualNetworkSubnetUsageResultInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/tsp-location.yaml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/tsp-location.yaml new file mode 100644 index 000000000000..abc5eb790e96 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers +commit: 91e3aca0bfa4b59a9f578959d0b214a26b90df40 +repo: Azure/azure-rest-api-specs +additionalDirectories: