From 467679d76dccf05aa9a3d0e6bfaab8c4e009d862 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 9 May 2023 05:28:05 +0000 Subject: [PATCH] CodeGen from PR 23839 in Azure/azure-rest-api-specs add network when updating server (#23839) * add network when updating server * fix linter --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 217 ++++++-- .../pom.xml | 2 +- .../mysqlflexibleserver/MySqlManager.java | 48 +- .../fluent/BackupAndExportsClient.java | 107 ++++ .../fluent/ConfigurationsClient.java | 74 +++ .../fluent/MySqlManagementClient.java | 28 +- .../fluent/ServersClient.java | 59 ++ .../models/BackupAndExportResponseInner.java | 253 +++++++++ .../BackupAndExportResponseProperties.java | 104 ++++ .../fluent/models/ConfigurationInner.java | 32 ++ .../models/ConfigurationProperties.java | 41 ++ .../models/ServerPropertiesForUpdate.java | 30 + .../models/ValidateBackupResponseInner.java | 67 +++ .../ValidateBackupResponseProperties.java | 52 ++ .../AzureADAdministratorsClientImpl.java | 36 +- .../BackupAndExportResponseImpl.java | 76 +++ .../BackupAndExportsClientImpl.java | 511 ++++++++++++++++++ .../implementation/BackupAndExportsImpl.java | 84 +++ .../implementation/BackupsClientImpl.java | 27 +- .../CheckNameAvailabilitiesClientImpl.java | 9 +- ...vailabilityWithoutLocationsClientImpl.java | 6 +- ...kVirtualNetworkSubnetUsagesClientImpl.java | 9 +- .../implementation/ConfigurationImpl.java | 123 ++++- .../ConfigurationsClientImpl.java | 366 ++++++++++++- .../implementation/ConfigurationsImpl.java | 86 ++- .../implementation/DatabasesClientImpl.java | 36 +- .../FirewallRulesClientImpl.java | 36 +- .../GetPrivateDnsZoneSuffixesClientImpl.java | 7 +- .../LocationBasedCapabilitiesClientImpl.java | 12 +- .../implementation/LogFilesClientImpl.java | 9 +- .../MySqlManagementClientImpl.java | 53 +- .../implementation/OperationsClientImpl.java | 7 +- .../implementation/ReplicasClientImpl.java | 9 +- .../implementation/ServerImpl.java | 18 +- .../implementation/ServersClientImpl.java | 372 +++++++++++-- .../implementation/ServersImpl.java | 10 + .../ValidateBackupResponseImpl.java | 33 ++ .../models/BackupAndExportRequest.java | 70 +++ .../models/BackupAndExportResponse.java | 99 ++++ .../models/BackupAndExports.java | 65 +++ .../models/BackupFormat.java | 47 ++ .../models/BackupRequestBase.java | 61 +++ .../models/BackupSettings.java | 84 +++ .../models/BackupStoreDetails.java | 33 ++ .../models/Configuration.java | 166 ++++++ .../models/Configurations.java | 67 ++- .../models/FullBackupStoreDetails.java | 66 +++ .../mysqlflexibleserver/models/Identity.java | 2 +- .../models/ManagedServiceIdentityType.java | 52 +- .../mysqlflexibleserver/models/Network.java | 14 +- .../models/OperationStatus.java | 63 +++ .../mysqlflexibleserver/models/Server.java | 34 +- .../models/ServerForUpdate.java | 23 + .../models/ServerGtidSetParameter.java | 50 ++ .../mysqlflexibleserver/models/Servers.java | 25 + .../mysqlflexibleserver/models/Storage.java | 26 + .../models/ValidateBackupResponse.java | 25 + ...ADAdministratorsCreateOrUpdateSamples.java | 2 +- .../AzureADAdministratorsDeleteSamples.java | 2 +- .../AzureADAdministratorsGetSamples.java | 2 +- ...reADAdministratorsListByServerSamples.java | 2 +- .../BackupAndExportCreateSamples.java | 34 ++ .../BackupAndExportValidateBackupSamples.java | 22 + .../generated/BackupsGetSamples.java | 2 +- .../generated/BackupsListByServerSamples.java | 2 +- .../generated/BackupsPutSamples.java | 2 +- .../CheckNameAvailabilityExecuteSamples.java | 2 +- ...labilityWithoutLocationExecuteSamples.java | 2 +- ...rtualNetworkSubnetUsageExecuteSamples.java | 2 +- .../ConfigurationsBatchUpdateSamples.java | 2 +- .../ConfigurationsCreateOrUpdateSamples.java | 28 + .../generated/ConfigurationsGetSamples.java | 2 +- .../ConfigurationsListByServerSamples.java | 2 +- .../ConfigurationsUpdateSamples.java | 18 +- .../DatabasesCreateOrUpdateSamples.java | 2 +- .../generated/DatabasesDeleteSamples.java | 2 +- .../generated/DatabasesGetSamples.java | 2 +- .../DatabasesListByServerSamples.java | 2 +- .../FirewallRulesCreateOrUpdateSamples.java | 2 +- .../generated/FirewallRulesDeleteSamples.java | 2 +- .../generated/FirewallRulesGetSamples.java | 2 +- .../FirewallRulesListByServerSamples.java | 2 +- ...GetPrivateDnsZoneSuffixExecuteSamples.java | 2 +- .../LocationBasedCapabilitiesListSamples.java | 2 +- .../LogFilesListByServerSamples.java | 2 +- .../generated/OperationsListSamples.java | 2 +- .../ReplicasListByServerSamples.java | 2 +- .../generated/ServersCreateSamples.java | 8 +- .../generated/ServersDeleteSamples.java | 2 +- .../generated/ServersFailoverSamples.java | 2 +- .../ServersGetByResourceGroupSamples.java | 4 +- .../ServersListByResourceGroupSamples.java | 2 +- .../generated/ServersListSamples.java | 2 +- .../generated/ServersResetGtidSamples.java | 28 + .../generated/ServersRestartSamples.java | 2 +- .../generated/ServersStartSamples.java | 2 +- .../generated/ServersStopSamples.java | 2 +- .../generated/ServersUpdateSamples.java | 6 +- .../AdministratorListResultTests.java | 58 -- .../AdministratorPropertiesTests.java | 43 -- .../AzureADAdministratorInnerTests.java | 43 -- ...AdministratorsCreateOrUpdateMockTests.java | 82 --- .../AzureADAdministratorsDeleteMockTests.java | 64 --- ...dministratorsGetWithResponseMockTests.java | 80 --- ...ADAdministratorsListByServerMockTests.java | 73 --- .../generated/BackupTests.java | 31 -- .../BackupsGetWithResponseMockTests.java | 72 --- .../BackupsListByServerMockTests.java | 71 --- .../BackupsPutWithResponseMockTests.java | 72 --- .../CapabilitiesListResultTests.java | 25 - .../CapabilityPropertiesInnerTests.java | 25 - ...abilitiesExecuteWithResponseMockTests.java | 75 --- ...LocationsExecuteWithResponseMockTests.java | 74 --- ...netUsagesExecuteWithResponseMockTests.java | 71 --- ...gurationForBatchUpdatePropertiesTests.java | 30 - .../ConfigurationForBatchUpdateTests.java | 32 -- .../generated/ConfigurationInnerTests.java | 32 -- .../ConfigurationListForBatchUpdateTests.java | 50 -- .../ConfigurationListResultInnerTests.java | 47 -- .../ConfigurationPropertiesTests.java | 32 -- .../ConfigurationsBatchUpdateMockTests.java | 85 --- ...onfigurationsGetWithResponseMockTests.java | 72 --- .../ConfigurationsListByServerMockTests.java | 73 --- .../ConfigurationsUpdateMockTests.java | 77 --- .../generated/DatabaseInnerTests.java | 30 - .../generated/DatabaseListResultTests.java | 42 -- .../generated/DatabasePropertiesTests.java | 29 - .../DatabasesCreateOrUpdateMockTests.java | 74 --- .../generated/DatabasesDeleteMockTests.java | 61 --- .../DatabasesGetWithResponseMockTests.java | 71 --- .../DatabasesListByServerMockTests.java | 69 --- .../generated/DelegatedSubnetUsageTests.java | 24 - .../generated/FirewallRuleInnerTests.java | 30 - .../FirewallRuleListResultTests.java | 41 -- .../FirewallRulePropertiesTests.java | 30 - .../FirewallRulesCreateOrUpdateMockTests.java | 74 --- .../FirewallRulesDeleteMockTests.java | 61 --- ...FirewallRulesGetWithResponseMockTests.java | 71 --- .../FirewallRulesListByServerMockTests.java | 69 --- ...rivateDnsZoneSuffixResponseInnerTests.java | 28 - ...eSuffixesExecuteWithResponseMockTests.java | 66 --- .../generated/HighAvailabilityTests.java | 32 -- .../generated/IdentityTests.java | 54 -- ...ocationBasedCapabilitiesListMockTests.java | 65 --- .../generated/LogFileInnerTests.java | 43 -- .../generated/LogFileListResultTests.java | 58 -- .../generated/LogFilePropertiesTests.java | 43 -- .../LogFilesListByServerMockTests.java | 73 --- .../generated/MaintenanceWindowTests.java | 39 -- .../generated/NameAvailabilityInnerTests.java | 32 -- .../NameAvailabilityRequestTests.java | 30 - .../generated/NetworkTests.java | 30 - .../generated/OperationDisplayTests.java | 39 -- .../generated/OperationInnerTests.java | 62 --- .../generated/OperationListResultTests.java | 119 ---- .../generated/OperationsListMockTests.java | 72 --- .../generated/ServerBackupInnerTests.java | 37 -- .../ServerBackupListResultTests.java | 50 -- .../ServerBackupPropertiesTests.java | 37 -- .../ServerEditionCapabilityTests.java | 25 - .../ServerRestartParameterTests.java | 33 -- .../ServerVersionCapabilityTests.java | 25 - .../generated/ServersDeleteMockTests.java | 61 --- .../generated/ServersFailoverMockTests.java | 61 --- .../generated/ServersRestartMockTests.java | 71 --- .../generated/ServersStartMockTests.java | 61 --- .../generated/ServersStopMockTests.java | 61 --- .../generated/SkuCapabilityTests.java | 25 - .../generated/SkuTests.java | 28 - .../StorageEditionCapabilityTests.java | 25 - .../generated/StorageTests.java | 40 -- ...rtualNetworkSubnetUsageParameterTests.java | 28 - ...ualNetworkSubnetUsageResultInnerTests.java | 25 - 175 files changed, 3921 insertions(+), 4265 deletions(-) create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportCreateSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidSamples.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md index fd9ee4c2fbdc7..f704f0503b411 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-05-09) + +- Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2022-09-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md index 66748dc0f53ce..abb17754c844e 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-12-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2022-09-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-mysqlflexibleserver - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md index 140c30b88f62f..94e5f8ab17bf5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md @@ -8,6 +8,11 @@ - [Get](#azureadadministrators_get) - [ListByServer](#azureadadministrators_listbyserver) +## BackupAndExport + +- [Create](#backupandexport_create) +- [ValidateBackup](#backupandexport_validatebackup) + ## Backups - [Get](#backups_get) @@ -29,6 +34,7 @@ ## Configurations - [BatchUpdate](#configurations_batchupdate) +- [CreateOrUpdate](#configurations_createorupdate) - [Get](#configurations_get) - [ListByServer](#configurations_listbyserver) - [Update](#configurations_update) @@ -75,6 +81,7 @@ - [GetByResourceGroup](#servers_getbyresourcegroup) - [List](#servers_list) - [ListByResourceGroup](#servers_listbyresourcegroup) +- [ResetGtid](#servers_resetgtid) - [Restart](#servers_restart) - [Start](#servers_start) - [Stop](#servers_stop) @@ -88,7 +95,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; /** Samples for AzureADAdministrators CreateOrUpdate. */ public final class AzureADAdministratorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json */ /** * Sample code: Create an azure ad administrator. @@ -120,7 +127,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; /** Samples for AzureADAdministrators Delete. */ public final class AzureADAdministratorsDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json */ /** * Sample code: Delete an azure ad administrator. @@ -144,7 +151,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; /** Samples for AzureADAdministrators Get. */ public final class AzureADAdministratorsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json */ /** * Sample code: Get an azure ad administrator. @@ -166,7 +173,7 @@ public final class AzureADAdministratorsGetSamples { /** Samples for AzureADAdministrators ListByServer. */ public final class AzureADAdministratorsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json */ /** * Sample code: List Azure AD administrators in a server. @@ -180,13 +187,67 @@ public final class AzureADAdministratorsListByServerSamples { } ``` +### BackupAndExport_Create + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; +import java.util.Arrays; + +/** Samples for BackupAndExport Create. */ +public final class BackupAndExportCreateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupAndExport.json + */ + /** + * Sample code: Create and Export Backup. + * + * @param manager Entry point to MySqlManager. + */ + public static void createAndExportBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .backupAndExports() + .create( + "TestGroup", + "mysqltestserver", + new BackupAndExportRequest() + .withBackupSettings(new BackupSettings().withBackupName("customer-backup-name")) + .withTargetDetails( + new FullBackupStoreDetails().withSasUriList(Arrays.asList("sasuri1", "sasuri2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### BackupAndExport_ValidateBackup + +```java +/** Samples for BackupAndExport ValidateBackup. */ +public final class BackupAndExportValidateBackupSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/ValidateBackup.json + */ + /** + * Sample code: Validate Backup. + * + * @param manager Entry point to MySqlManager. + */ + public static void validateBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .backupAndExports() + .validateBackupWithResponse("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} +``` + ### Backups_Get ```java /** Samples for Backups Get. */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/BackupGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. @@ -207,7 +268,7 @@ public final class BackupsGetSamples { /** Samples for Backups ListByServer. */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/BackupsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json */ /** * Sample code: List backups for a server. @@ -226,7 +287,7 @@ public final class BackupsListByServerSamples { /** Samples for Backups Put. */ public final class BackupsPutSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/BackupPut.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupPut.json */ /** * Sample code: Create backup for a server. @@ -247,7 +308,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequ /** Samples for CheckNameAvailability Execute. */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json */ /** * Sample code: Check name availability. @@ -273,7 +334,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequ /** Samples for CheckNameAvailabilityWithoutLocation Execute. */ public final class CheckNameAvailabilityWithoutLocationExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json */ /** * Sample code: Check name availability. @@ -298,7 +359,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnet /** Samples for CheckVirtualNetworkSubnetUsage Execute. */ public final class CheckVirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json */ /** * Sample code: CheckVirtualNetworkSubnetUsage. @@ -330,7 +391,7 @@ import java.util.Arrays; /** Samples for Configurations BatchUpdate. */ public final class ConfigurationsBatchUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json */ /** * Sample code: ConfigurationList. @@ -355,13 +416,40 @@ public final class ConfigurationsBatchUpdateSamples { } ``` +### Configurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; + +/** Samples for Configurations CreateOrUpdate. */ +public final class ConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationCreateOrUpdate.json + */ + /** + * Sample code: ConfigurationCreateOrUpdate. + * + * @param manager Entry point to MySqlManager. + */ + public static void configurationCreateOrUpdate(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .configurations() + .define("event_scheduler") + .withExistingFlexibleServer("TestGroup", "testserver") + .withValue("off") + .withSource(ConfigurationSource.USER_OVERRIDE) + .create(); + } +} +``` + ### Configurations_Get ```java /** Samples for Configurations Get. */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationGet.json */ /** * Sample code: Get a configuration. @@ -382,7 +470,7 @@ public final class ConfigurationsGetSamples { /** Samples for Configurations ListByServer. */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json */ /** * Sample code: List all configurations for a server. @@ -401,13 +489,13 @@ public final class ConfigurationsListByServerSamples { ### Configurations_Update ```java -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; /** Samples for Configurations Update. */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. @@ -415,14 +503,12 @@ 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(); } } ``` @@ -433,7 +519,7 @@ public final class ConfigurationsUpdateSamples { /** Samples for Databases CreateOrUpdate. */ public final class DatabasesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseCreate.json */ /** * Sample code: Create a database. @@ -458,7 +544,7 @@ public final class DatabasesCreateOrUpdateSamples { /** Samples for Databases Delete. */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseDelete.json */ /** * Sample code: Delete a database. @@ -477,7 +563,7 @@ public final class DatabasesDeleteSamples { /** Samples for Databases Get. */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseGet.json */ /** * Sample code: Get a database. @@ -496,7 +582,7 @@ public final class DatabasesGetSamples { /** Samples for Databases ListByServer. */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabasesListByServer.json */ /** * Sample code: List databases in a server. @@ -515,7 +601,7 @@ public final class DatabasesListByServerSamples { /** Samples for FirewallRules CreateOrUpdate. */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleCreate.json */ /** * Sample code: Create a firewall rule. @@ -540,7 +626,7 @@ public final class FirewallRulesCreateOrUpdateSamples { /** Samples for FirewallRules Delete. */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleDelete.json */ /** * Sample code: Delete a firewall rule. @@ -559,7 +645,7 @@ public final class FirewallRulesDeleteSamples { /** Samples for FirewallRules Get. */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json */ /** * Sample code: Get a firewall rule. @@ -578,7 +664,7 @@ public final class FirewallRulesGetSamples { /** Samples for FirewallRules ListByServer. */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json */ /** * Sample code: List all firewall rules in a server. @@ -598,7 +684,7 @@ public final class FirewallRulesListByServerSamples { /** Samples for GetPrivateDnsZoneSuffix Execute. */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json */ /** * Sample code: GetPrivateDnsZoneSuffix. @@ -617,7 +703,7 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { /** Samples for LocationBasedCapabilities List. */ public final class LocationBasedCapabilitiesListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json */ /** * Sample code: CapabilitiesList. @@ -636,7 +722,7 @@ public final class LocationBasedCapabilitiesListSamples { /** Samples for LogFiles ListByServer. */ public final class LogFilesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json */ /** * Sample code: List all server log files for a server. @@ -656,7 +742,7 @@ public final class LogFilesListByServerSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/OperationsList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json */ /** * Sample code: OperationList. @@ -675,7 +761,7 @@ public final class OperationsListSamples { /** Samples for Replicas ListByServer. */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json */ /** * Sample code: List replicas for a server. @@ -714,7 +800,7 @@ import java.util.Map; /** Samples for Servers Create. */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json */ /** * Sample code: Create a replica server. @@ -734,7 +820,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -762,7 +848,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json */ /** * Sample code: Create a server with byok. @@ -809,7 +895,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreateWithPointInTimeRestore.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json */ /** * Sample code: Create a server as a point in time restore. @@ -851,7 +937,7 @@ public final class ServersCreateSamples { /** Samples for Servers Delete. */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json */ /** * Sample code: Delete a server. @@ -870,7 +956,7 @@ public final class ServersDeleteSamples { /** Samples for Servers Failover. */ public final class ServersFailoverSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerFailover.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json */ /** * Sample code: Restart a server. @@ -889,7 +975,7 @@ public final class ServersFailoverSamples { /** Samples for Servers GetByResourceGroup. */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json */ /** * Sample code: Get a server with vnet. @@ -901,7 +987,7 @@ public final class ServersGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGet.json */ /** * Sample code: Get a server. @@ -920,7 +1006,7 @@ public final class ServersGetByResourceGroupSamples { /** Samples for Servers List. */ public final class ServersListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServersList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json */ /** * Sample code: List servers in a subscription. @@ -939,7 +1025,7 @@ public final class ServersListSamples { /** Samples for Servers ListByResourceGroup. */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServersListByResourceGroup.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json */ /** * Sample code: List servers in a resource group. @@ -952,6 +1038,33 @@ public final class ServersListByResourceGroupSamples { } ``` +### Servers_ResetGtid + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; + +/** Samples for Servers ResetGtid. */ +public final class ServersResetGtidSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerResetGtid.json + */ + /** + * Sample code: Reset GTID on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void resetGTIDOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .servers() + .resetGtid( + "TestGroup", + "testserver", + new ServerGtidSetParameter().withGtidSet("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Servers_Restart ```java @@ -961,7 +1074,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParamet /** Samples for Servers Restart. */ public final class ServersRestartSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerRestart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerRestart.json */ /** * Sample code: Restart a server. @@ -988,7 +1101,7 @@ public final class ServersRestartSamples { /** Samples for Servers Start. */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerStart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStart.json */ /** * Sample code: Start a server. @@ -1007,7 +1120,7 @@ public final class ServersStartSamples { /** Samples for Servers Stop. */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerStop.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStop.json */ /** * Sample code: Stop a server. @@ -1040,7 +1153,7 @@ import java.util.Map; /** Samples for Servers Update. */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: Update server customer maintenance window. @@ -1066,7 +1179,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerUpdateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json */ /** * Sample code: Update server with byok. @@ -1104,7 +1217,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json */ /** * Sample code: Update a server. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml index c67d53e76c997..d89befecd850f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for MySql Management - This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-12-01-preview. + This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2022-09-30-preview. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java index bb370e3bb3175..175c71e4395e9 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 @@ -25,6 +25,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; import com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsImpl; @@ -40,6 +41,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersImpl; import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; import com.azure.resourcemanager.mysqlflexibleserver.models.Backups; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilities; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilityWithoutLocations; @@ -66,8 +68,12 @@ * configurations with new business model. */ public final class MySqlManager { + private AzureADAdministrators azureADAdministrators; + private Backups backups; + private BackupAndExports backupAndExports; + private Configurations configurations; private Databases databases; @@ -92,8 +98,6 @@ public final class MySqlManager { private Operations operations; - private AzureADAdministrators azureADAdministrators; - private final MySqlManagementClient clientObject; private MySqlManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -259,7 +263,7 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.mysqlflexibleserver") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -316,6 +320,18 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil } } + /** + * Gets the resource collection API of AzureADAdministrators. It manages AzureADAdministrator. + * + * @return Resource collection API of AzureADAdministrators. + */ + public AzureADAdministrators azureADAdministrators() { + if (this.azureADAdministrators == null) { + this.azureADAdministrators = new AzureADAdministratorsImpl(clientObject.getAzureADAdministrators(), this); + } + return azureADAdministrators; + } + /** * Gets the resource collection API of Backups. * @@ -329,7 +345,19 @@ public Backups backups() { } /** - * Gets the resource collection API of Configurations. + * Gets the resource collection API of BackupAndExports. + * + * @return Resource collection API of BackupAndExports. + */ + public BackupAndExports backupAndExports() { + if (this.backupAndExports == null) { + this.backupAndExports = new BackupAndExportsImpl(clientObject.getBackupAndExports(), this); + } + return backupAndExports; + } + + /** + * Gets the resource collection API of Configurations. It manages Configuration. * * @return Resource collection API of Configurations. */ @@ -478,18 +506,6 @@ public Operations operations() { 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; - } - /** * @return Wrapped service client MySqlManagementClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java new file mode 100644 index 0000000000000..52c7f573e8a98 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; + +/** An instance of this class provides access to all the operations defined in BackupAndExportsClient. */ +public interface BackupAndExportsClient { + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BackupAndExportResponseInner> beginCreate( + String resourceGroupName, String serverName, BackupAndExportRequest parameters); + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BackupAndExportResponseInner> beginCreate( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context); + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupAndExportResponseInner create( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateBackupWithResponse( + String resourceGroupName, String serverName, Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java index 805d6d935b8ce..24ab9610dbff2 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 @@ -17,6 +17,80 @@ /** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ public interface ConfigurationsClient { + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context); + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationInner createOrUpdate( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationInner createOrUpdate( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context); + /** * Updates a configuration of a server. * 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 d794d60e0d956..0ce57fc33beb5 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 @@ -23,13 +23,6 @@ public interface MySqlManagementClient { */ String getEndpoint(); - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The HTTP pipeline to send requests through. * @@ -44,6 +37,13 @@ public interface MySqlManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the AzureADAdministratorsClient object to access its operations. + * + * @return the AzureADAdministratorsClient object. + */ + AzureADAdministratorsClient getAzureADAdministrators(); + /** * Gets the BackupsClient object to access its operations. * @@ -51,6 +51,13 @@ public interface MySqlManagementClient { */ BackupsClient getBackups(); + /** + * Gets the BackupAndExportsClient object to access its operations. + * + * @return the BackupAndExportsClient object. + */ + BackupAndExportsClient getBackupAndExports(); + /** * Gets the ConfigurationsClient object to access its operations. * @@ -134,11 +141,4 @@ public interface MySqlManagementClient { * @return the OperationsClient object. */ OperationsClient getOperations(); - - /** - * Gets the AzureADAdministratorsClient object to access its operations. - * - * @return the AzureADAdministratorsClient object. - */ - AzureADAdministratorsClient getAzureADAdministrators(); } 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 324a1884752ff..9a9b76dcffcce 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 @@ -13,6 +13,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; /** An instance of this class provides access to all the operations defined in ServersClient. */ @@ -480,4 +481,62 @@ SyncPoller, Void> beginRestart( */ @ServiceMethod(returns = ReturnType.SINGLE) void stop(String resourceGroupName, String serverName, Context context); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetGtid( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetGtid( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters); + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java new file mode 100644 index 0000000000000..0a0e178a7ee53 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents BackupAndExport API Response. */ +@Fluent +public final class BackupAndExportResponseInner extends ProxyResource { + /* + * The operation status + */ + @JsonProperty(value = "status") + private OperationStatus status; + + /* + * Start time + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * End time + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Operation progress (0-100). + */ + @JsonProperty(value = "percentComplete") + private Double percentComplete; + + /* + * The response properties of a backup and export operation. + */ + @JsonProperty(value = "properties") + private BackupAndExportResponseProperties innerProperties; + + /* + * Error Response + * + * The BackupAndExport operation error response. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of BackupAndExportResponseInner class. */ + public BackupAndExportResponseInner() { + } + + /** + * Get the status property: The operation status. + * + * @return the status value. + */ + public OperationStatus status() { + return this.status; + } + + /** + * Set the status property: The operation status. + * + * @param status the status value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withStatus(OperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time. + * + * @param startTime the startTime value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time. + * + * @param endTime the endTime value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the percentComplete property: Operation progress (0-100). + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Operation progress (0-100). + * + * @param percentComplete the percentComplete value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withPercentComplete(Double percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the innerProperties property: The response properties of a backup and export operation. + * + * @return the innerProperties value. + */ + private BackupAndExportResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the error property: Error Response + * + *

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

The BackupAndExport operation error response. + * + * @param error the error value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes(); + } + + /** + * Set the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new BackupAndExportResponseProperties(); + } + this.innerProperties().withDatasourceSizeInBytes(datasourceSizeInBytes); + return this; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes(); + } + + /** + * Set the dataTransferredInBytes property: Data transferred in bytes. + * + * @param dataTransferredInBytes the dataTransferredInBytes value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withDataTransferredInBytes(Long dataTransferredInBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new BackupAndExportResponseProperties(); + } + this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes); + return this; + } + + /** + * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value + * pairs. + * + * @return the backupMetadata value. + */ + public String backupMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().backupMetadata(); + } + + /** + * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value + * pairs. + * + * @param backupMetadata the backupMetadata value to set. + * @return the BackupAndExportResponseInner object itself. + */ + public BackupAndExportResponseInner withBackupMetadata(String backupMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new BackupAndExportResponseProperties(); + } + this.innerProperties().withBackupMetadata(backupMetadata); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java new file mode 100644 index 0000000000000..0f556bdc7b3d6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BackupAndExport Response Properties. */ +@Fluent +public final class BackupAndExportResponseProperties { + /* + * Size of datasource in bytes + */ + @JsonProperty(value = "datasourceSizeInBytes") + private Long datasourceSizeInBytes; + + /* + * Data transferred in bytes + */ + @JsonProperty(value = "dataTransferredInBytes") + private Long dataTransferredInBytes; + + /* + * Metadata related to backup to be stored for restoring resource in key-value pairs. + */ + @JsonProperty(value = "backupMetadata") + private String backupMetadata; + + /** Creates an instance of BackupAndExportResponseProperties class. */ + public BackupAndExportResponseProperties() { + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.datasourceSizeInBytes; + } + + /** + * Set the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. + * @return the BackupAndExportResponseProperties object itself. + */ + public BackupAndExportResponseProperties withDatasourceSizeInBytes(Long datasourceSizeInBytes) { + this.datasourceSizeInBytes = datasourceSizeInBytes; + return this; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.dataTransferredInBytes; + } + + /** + * Set the dataTransferredInBytes property: Data transferred in bytes. + * + * @param dataTransferredInBytes the dataTransferredInBytes value to set. + * @return the BackupAndExportResponseProperties object itself. + */ + public BackupAndExportResponseProperties withDataTransferredInBytes(Long dataTransferredInBytes) { + this.dataTransferredInBytes = dataTransferredInBytes; + return this; + } + + /** + * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value + * pairs. + * + * @return the backupMetadata value. + */ + public String backupMetadata() { + return this.backupMetadata; + } + + /** + * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value + * pairs. + * + * @param backupMetadata the backupMetadata value to set. + * @return the BackupAndExportResponseProperties object itself. + */ + public BackupAndExportResponseProperties withBackupMetadata(String backupMetadata) { + this.backupMetadata = backupMetadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java index c7d61a08e0f44..4357c0385ca3b 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 @@ -73,6 +73,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. * @@ -82,6 +105,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. * 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 9c9b3e63a94a6..4b487b154913e 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 @@ -20,12 +20,24 @@ public final class ConfigurationProperties { @JsonProperty(value = "value") private String value; + /* + * Current value of the configuration. + */ + @JsonProperty(value = "currentValue") + private String currentValue; + /* * Description of the configuration. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /* + * The link used to get the document from community or Azure site. + */ + @JsonProperty(value = "documentationLink", access = JsonProperty.Access.WRITE_ONLY) + private String documentationLink; + /* * Default value of the configuration. */ @@ -92,6 +104,26 @@ public ConfigurationProperties withValue(String value) { return this; } + /** + * Get the currentValue property: Current value of the configuration. + * + * @return the currentValue value. + */ + public String currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current value of the configuration. + * + * @param currentValue the currentValue value to set. + * @return the ConfigurationProperties object itself. + */ + public ConfigurationProperties withCurrentValue(String currentValue) { + this.currentValue = currentValue; + return this; + } + /** * Get the description property: Description of the configuration. * @@ -101,6 +133,15 @@ public String description() { return this.description; } + /** + * Get the documentationLink property: The link used to get the document from community or Azure site. + * + * @return the documentationLink value. + */ + public String documentationLink() { + return this.documentationLink; + } + /** * Get the defaultValue property: Default value of the configuration. * 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 ef4edd8f530dc..09caef06d7bc9 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 @@ -9,6 +9,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; +import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; @@ -65,6 +66,12 @@ public final class ServerPropertiesForUpdate { @JsonProperty(value = "dataEncryption") private DataEncryption dataEncryption; + /* + * Network related properties of a server + */ + @JsonProperty(value = "network") + private Network network; + /** Creates an instance of ServerPropertiesForUpdate class. */ public ServerPropertiesForUpdate() { } @@ -229,6 +236,26 @@ public ServerPropertiesForUpdate withDataEncryption(DataEncryption dataEncryptio return this; } + /** + * Get the network property: Network related properties of a server. + * + * @return the network value. + */ + public Network network() { + return this.network; + } + + /** + * Set the network property: Network related properties of a server. + * + * @param network the network value to set. + * @return the ServerPropertiesForUpdate object itself. + */ + public ServerPropertiesForUpdate withNetwork(Network network) { + this.network = network; + return this; + } + /** * Validates the instance. * @@ -250,5 +277,8 @@ public void validate() { if (dataEncryption() != null) { dataEncryption().validate(); } + if (network() != null) { + network().validate(); + } } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java new file mode 100644 index 0000000000000..e64b2d25e0e16 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents ValidateBackup API Response. */ +@Fluent +public final class ValidateBackupResponseInner { + /* + * The response properties of a pre backup operation. + */ + @JsonProperty(value = "properties") + private ValidateBackupResponseProperties innerProperties; + + /** Creates an instance of ValidateBackupResponseInner class. */ + public ValidateBackupResponseInner() { + } + + /** + * Get the innerProperties property: The response properties of a pre backup operation. + * + * @return the innerProperties value. + */ + private ValidateBackupResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the numberOfContainers property: Estimated no of storage containers required for resource data to be backed + * up. + * + * @return the numberOfContainers value. + */ + public Integer numberOfContainers() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfContainers(); + } + + /** + * Set the numberOfContainers property: Estimated no of storage containers required for resource data to be backed + * up. + * + * @param numberOfContainers the numberOfContainers value to set. + * @return the ValidateBackupResponseInner object itself. + */ + public ValidateBackupResponseInner withNumberOfContainers(Integer numberOfContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ValidateBackupResponseProperties(); + } + this.innerProperties().withNumberOfContainers(numberOfContainers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java new file mode 100644 index 0000000000000..dfa9984ee305d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ValidateBackup Response Properties. */ +@Fluent +public final class ValidateBackupResponseProperties { + /* + * Estimated no of storage containers required for resource data to be backed up. + */ + @JsonProperty(value = "numberOfContainers") + private Integer numberOfContainers; + + /** Creates an instance of ValidateBackupResponseProperties class. */ + public ValidateBackupResponseProperties() { + } + + /** + * Get the numberOfContainers property: Estimated no of storage containers required for resource data to be backed + * up. + * + * @return the numberOfContainers value. + */ + public Integer numberOfContainers() { + return this.numberOfContainers; + } + + /** + * Set the numberOfContainers property: Estimated no of storage containers required for resource data to be backed + * up. + * + * @param numberOfContainers the numberOfContainers value to set. + * @return the ValidateBackupResponseProperties object itself. + */ + public ValidateBackupResponseProperties withNumberOfContainers(Integer numberOfContainers) { + this.numberOfContainers = numberOfContainers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java index 4f6cce352a313..ec983c8ec8674 100644 --- 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 @@ -68,8 +68,7 @@ public final class AzureADAdministratorsClientImpl implements AzureADAdministrat public interface AzureADAdministratorsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/administrators/{administratorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -85,8 +84,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/administrators/{administratorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -101,8 +99,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/administrators/{administratorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -117,8 +114,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/administrators") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -187,6 +183,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -194,7 +191,7 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -253,12 +250,13 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -508,6 +506,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -515,7 +514,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -563,12 +562,13 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -765,6 +765,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -772,7 +773,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -821,12 +822,13 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -921,6 +923,7 @@ private Mono> listByServerSinglePageAsy if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -928,7 +931,7 @@ private Mono> listByServerSinglePageAsy service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -980,12 +983,13 @@ private Mono> listByServerSinglePageAsy if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 0000000000000..6200fdecdb31c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; +import java.time.OffsetDateTime; + +public final class BackupAndExportResponseImpl implements BackupAndExportResponse { + private BackupAndExportResponseInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + BackupAndExportResponseImpl( + BackupAndExportResponseInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OperationStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public Long datasourceSizeInBytes() { + return this.innerModel().datasourceSizeInBytes(); + } + + public Long dataTransferredInBytes() { + return this.innerModel().dataTransferredInBytes(); + } + + public String backupMetadata() { + return this.innerModel().backupMetadata(); + } + + public BackupAndExportResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java new file mode 100644 index 0000000000000..6eb944a5fa103 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupAndExportsClient. */ +public final class BackupAndExportsClientImpl implements BackupAndExportsClient { + /** The proxy service used to perform REST calls. */ + private final BackupAndExportsService service; + + /** The service client containing this operation class. */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of BackupAndExportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupAndExportsClientImpl(MySqlManagementClientImpl client) { + this.service = + RestProxy.create(BackupAndExportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientBackupAndExports to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MySqlManagementClien") + public interface BackupAndExportsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @BodyParam("application/json") BackupAndExportRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateBackup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateBackup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-09-30-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-09-30-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BackupAndExportResponseInner> beginCreateAsync( + String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BackupAndExportResponseInner.class, + BackupAndExportResponseInner.class, + this.client.getContext()); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BackupAndExportResponseInner> beginCreateAsync( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, serverName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BackupAndExportResponseInner.class, + BackupAndExportResponseInner.class, + context); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackupAndExportResponseInner> beginCreate( + String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + return this.beginCreateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackupAndExportResponseInner> beginCreate( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + return this.beginCreateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + return beginCreateAsync(resourceGroupName, serverName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + return beginCreateAsync(resourceGroupName, serverName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupAndExportResponseInner create( + String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + return createAsync(resourceGroupName, serverName, parameters).block(); + } + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupAndExportResponseInner create( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + return createAsync(resourceGroupName, serverName, parameters, context).block(); + } + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateBackupWithResponseAsync( + String resourceGroupName, String serverName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String apiVersion = "2022-09-30-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateBackup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateBackupWithResponseAsync( + String resourceGroupName, String serverName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String apiVersion = "2022-09-30-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateBackup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context); + } + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateBackupAsync(String resourceGroupName, String serverName) { + return validateBackupWithResponseAsync(resourceGroupName, serverName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateBackupWithResponse( + String resourceGroupName, String serverName, Context context) { + return validateBackupWithResponseAsync(resourceGroupName, serverName, context).block(); + } + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName) { + return validateBackupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java new file mode 100644 index 0000000000000..4f71540a67e92 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; +import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; + +public final class BackupAndExportsImpl implements BackupAndExports { + private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportsImpl.class); + + private final BackupAndExportsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public BackupAndExportsImpl( + BackupAndExportsClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupAndExportResponse create( + String resourceGroupName, String serverName, BackupAndExportRequest parameters) { + BackupAndExportResponseInner inner = this.serviceClient().create(resourceGroupName, serverName, parameters); + if (inner != null) { + return new BackupAndExportResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public BackupAndExportResponse create( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { + BackupAndExportResponseInner inner = + this.serviceClient().create(resourceGroupName, serverName, parameters, context); + if (inner != null) { + return new BackupAndExportResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateBackupWithResponse( + String resourceGroupName, String serverName, Context context) { + Response inner = + this.serviceClient().validateBackupWithResponse(resourceGroupName, serverName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateBackupResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateBackupResponse validateBackup(String resourceGroupName, String serverName) { + ValidateBackupResponseInner inner = this.serviceClient().validateBackup(resourceGroupName, serverName); + if (inner != null) { + return new ValidateBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private BackupAndExportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java index af9a1d509833f..e3426f53af401 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 @@ -58,8 +58,7 @@ public final class BackupsClientImpl implements BackupsClient { public interface BackupsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/backups/{backupName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> put( @@ -74,8 +73,7 @@ Mono> put( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/backups/{backupName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -90,8 +88,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/backups") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -150,6 +147,7 @@ private Mono> putWithResponseAsync( if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -157,7 +155,7 @@ private Mono> putWithResponseAsync( service .put( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -204,12 +202,13 @@ private Mono> putWithResponseAsync( if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .put( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -305,6 +304,7 @@ private Mono> getWithResponseAsync( if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -312,7 +312,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -359,12 +359,13 @@ private Mono> getWithResponseAsync( if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -456,6 +457,7 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -463,7 +465,7 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -514,12 +516,13 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 a39962596e67f..e8ade0c132261 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 @@ -56,8 +56,7 @@ public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailab public interface CheckNameAvailabilitiesService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}" - + "/checkNameAvailability") + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> execute( @@ -106,6 +105,7 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -113,7 +113,7 @@ private Mono> executeWithResponseAsync( service .execute( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), locationName, nameAvailabilityRequest, @@ -159,12 +159,13 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .execute( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), locationName, nameAvailabilityRequest, 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 a8159467ed746..1d771a3629cbc 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 @@ -106,6 +106,7 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -113,7 +114,7 @@ private Mono> executeWithResponseAsync( service .execute( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), nameAvailabilityRequest, accept, @@ -154,12 +155,13 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .execute( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), nameAvailabilityRequest, accept, 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 f5febdb08187b..4f32ae9315d0d 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 @@ -59,8 +59,7 @@ public final class CheckVirtualNetworkSubnetUsagesClientImpl implements CheckVir public interface CheckVirtualNetworkSubnetUsagesService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}" - + "/checkVirtualNetworkSubnetUsage") + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkVirtualNetworkSubnetUsage") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> execute( @@ -107,6 +106,7 @@ private Mono> executeWithResponse } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -114,7 +114,7 @@ private Mono> executeWithResponse service .execute( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), locationName, parameters, @@ -158,12 +158,13 @@ private Mono> executeWithResponse } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .execute( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), locationName, parameters, 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 b101069b493cc..6f167f8ec87ab 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java @@ -5,6 +5,7 @@ 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,106 @@ 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.configurationName = Utils.getValueFromIdByName(innerObject.id(), "configurations"); + } + + public Configuration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public Configuration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .getWithResponse(resourceGroupName, serverName, configurationName, context) + .getValue(); + return this; + } + + public ConfigurationImpl withValue(String value) { + this.innerModel().withValue(value); + return this; + } + + public ConfigurationImpl withCurrentValue(String currentValue) { + this.innerModel().withCurrentValue(currentValue); + return this; + } + + public ConfigurationImpl withSource(ConfigurationSource source) { + this.innerModel().withSource(source); + return this; + } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java index 4a43d07b3dc53..ea282327b1ca4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java @@ -14,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; @@ -65,10 +66,25 @@ public final class ConfigurationsClientImpl implements ConfigurationsClient { @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") public interface ConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") ConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/configurations/{configurationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -84,8 +100,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/configurations/{configurationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -100,8 +115,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/updateConfigurations") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> batchUpdate( @@ -116,8 +130,7 @@ Mono>> batchUpdate( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/configurations") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -144,6 +157,319 @@ Mono> listByServerNext( Context context); } + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + configurationName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + configurationName, + parameters, + accept, + context); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationInner.class, + ConfigurationInner.class, + this.client.getContext()); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, context); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters) + .getSyncPoller(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner createOrUpdate( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).block(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner createOrUpdate( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); + } + /** * Updates a configuration of a server. * @@ -187,6 +513,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -194,7 +521,7 @@ private Mono>> updateWithResponseAsync( service .update( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -253,12 +580,13 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -491,6 +819,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -498,7 +827,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -547,12 +876,13 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -650,6 +980,7 @@ private Mono>> batchUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -657,7 +988,7 @@ private Mono>> batchUpdateWithResponseAsync( service .batchUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -706,12 +1037,13 @@ private Mono>> batchUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .batchUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -919,6 +1251,7 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -926,7 +1259,7 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -992,12 +1325,13 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 07b4897e779ee..7691bc15217ae 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java @@ -30,32 +30,6 @@ public ConfigurationsImpl( 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 = @@ -120,6 +94,62 @@ public PagedIterable listByServer( return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); } + public Configuration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, configurationName, context); + } + private ConfigurationsClient serviceClient() { return this.innerClient; } @@ -127,4 +157,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/DatabasesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java index 18906f44c8dc1..53bb088a30832 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 @@ -66,8 +66,7 @@ public final class DatabasesClientImpl implements DatabasesClient { public interface DatabasesService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/databases/{databaseName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -83,8 +82,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/databases/{databaseName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -99,8 +97,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/databases/{databaseName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -115,8 +112,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/databases") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -181,6 +177,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -188,7 +185,7 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -242,12 +239,13 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -462,6 +460,7 @@ private Mono>> deleteWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -469,7 +468,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -516,12 +515,13 @@ private Mono>> deleteWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -713,6 +713,7 @@ private Mono> getWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -720,7 +721,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -767,12 +768,13 @@ private Mono> getWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -864,6 +866,7 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -871,7 +874,7 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -922,12 +925,13 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 f8f002cc9ff72..df8ca09c2eceb 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 @@ -66,8 +66,7 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient { public interface FirewallRulesService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -83,8 +82,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -99,8 +97,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -115,8 +112,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/firewallRules") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -182,6 +178,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -189,7 +186,7 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -248,12 +245,13 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -487,6 +485,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -494,7 +493,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -542,12 +541,13 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -743,6 +743,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -750,7 +751,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -799,12 +800,13 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -896,6 +898,7 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -903,7 +906,7 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -954,12 +957,13 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 c97c952d3a74f..d2e657c1d9f66 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 @@ -79,10 +79,10 @@ private Mono> executeWithResponse new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -104,9 +104,10 @@ private Mono> executeWithResponse new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return service.execute(this.client.getEndpoint(), apiVersion, accept, context); } /** 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 3a3801e673277..8c0c04a24a47e 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 @@ -108,6 +108,7 @@ private Mono> listSinglePageAsync(Strin if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -115,7 +116,7 @@ private Mono> listSinglePageAsync(Strin service .list( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), locationName, accept, @@ -160,16 +161,11 @@ private Mono> listSinglePageAsync(Strin if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - locationName, - accept, - context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) .map( res -> new PagedResponseBase<>( 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 index 2e12e6a129dd9..b0ee993e1081a 100644 --- 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 @@ -57,8 +57,7 @@ public final class LogFilesClientImpl implements LogFilesClient { public interface LogFilesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/logFiles") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/logFiles") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -112,6 +111,7 @@ private Mono> listByServerSinglePageAsync(String res if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -119,7 +119,7 @@ private Mono> listByServerSinglePageAsync(String res service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -170,12 +170,13 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 60037af3ed1ca..d342a6137625a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java @@ -23,6 +23,7 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient; @@ -73,18 +74,6 @@ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -121,6 +110,18 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The AzureADAdministratorsClient object to access its operations. */ + private final AzureADAdministratorsClient azureADAdministrators; + + /** + * Gets the AzureADAdministratorsClient object to access its operations. + * + * @return the AzureADAdministratorsClient object. + */ + public AzureADAdministratorsClient getAzureADAdministrators() { + return this.azureADAdministrators; + } + /** The BackupsClient object to access its operations. */ private final BackupsClient backups; @@ -133,6 +134,18 @@ public BackupsClient getBackups() { return this.backups; } + /** The BackupAndExportsClient object to access its operations. */ + private final BackupAndExportsClient backupAndExports; + + /** + * Gets the BackupAndExportsClient object to access its operations. + * + * @return the BackupAndExportsClient object. + */ + public BackupAndExportsClient getBackupAndExports() { + return this.backupAndExports; + } + /** The ConfigurationsClient object to access its operations. */ private final ConfigurationsClient configurations; @@ -277,18 +290,6 @@ 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; - } - /** * Initializes an instance of MySqlManagementClient client. * @@ -311,8 +312,9 @@ public AzureADAdministratorsClient getAzureADAdministrators() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-12-01-preview"; + this.azureADAdministrators = new AzureADAdministratorsClientImpl(this); this.backups = new BackupsClientImpl(this); + this.backupAndExports = new BackupAndExportsClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); this.databases = new DatabasesClientImpl(this); this.firewallRules = new FirewallRulesClientImpl(this); @@ -325,7 +327,6 @@ public AzureADAdministratorsClient getAzureADAdministrators() { this.checkNameAvailabilityWithoutLocations = new CheckNameAvailabilityWithoutLocationsClientImpl(this); this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); this.operations = new OperationsClientImpl(this); - this.azureADAdministrators = new AzureADAdministratorsClientImpl(this); } /** 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 a7a063a56d5b5..0421db5b1224f 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 @@ -93,10 +93,10 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -127,10 +127,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( 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 e944f5c211590..ca2ddd3f5ef8b 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 @@ -57,8 +57,7 @@ public final class ReplicasClientImpl implements ReplicasClient { public interface ReplicasService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/replicas") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/replicas") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -112,6 +111,7 @@ private Mono> listByServerSinglePageAsync(String reso if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -119,7 +119,7 @@ private Mono> listByServerSinglePageAsync(String reso service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -170,12 +170,13 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, 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 1c5fc65c9e2d1..6a239ccf4957a 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 @@ -18,6 +18,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; @@ -274,6 +275,14 @@ public void stop(Context context) { serviceManager.servers().stop(resourceGroupName, serverName, context); } + public void resetGtid(ServerGtidSetParameter parameters) { + serviceManager.servers().resetGtid(resourceGroupName, serverName, parameters); + } + + public void resetGtid(ServerGtidSetParameter parameters, Context context) { + serviceManager.servers().resetGtid(resourceGroupName, serverName, parameters, context); + } + public ServerImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -410,8 +419,13 @@ public ServerImpl withHighAvailability(HighAvailability highAvailability) { } public ServerImpl withNetwork(Network network) { - this.innerModel().withNetwork(network); - return this; + if (isInCreateMode()) { + this.innerModel().withNetwork(network); + return this; + } else { + this.updateParameters.withNetwork(network); + return this; + } } public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { 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 69e63c3f27c59..170838e9d66af 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 @@ -36,6 +36,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerListResult; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import java.nio.ByteBuffer; @@ -69,8 +70,7 @@ public final class ServersClientImpl implements ServersClient { public interface ServersService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -85,8 +85,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -101,8 +100,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -116,8 +114,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -131,8 +128,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -156,8 +152,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/failover") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/failover") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> failover( @@ -171,8 +166,7 @@ Mono>> failover( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/restart") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> restart( @@ -187,8 +181,7 @@ Mono>> restart( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/start") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> start( @@ -202,8 +195,7 @@ Mono>> start( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL" - + "/flexibleServers/{serverName}/stop") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/stop") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> stop( @@ -215,6 +207,21 @@ Mono>> stop( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/resetGtid") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetGtid( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @BodyParam("application/json") ServerGtidSetParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -274,6 +281,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -281,7 +289,7 @@ private Mono>> createWithResponseAsync( service .create( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -330,12 +338,13 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .create( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -534,6 +543,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -541,7 +551,7 @@ private Mono>> updateWithResponseAsync( service .update( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -591,12 +601,13 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -796,6 +807,7 @@ private Mono>> deleteWithResponseAsync(String resource if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -803,7 +815,7 @@ private Mono>> deleteWithResponseAsync(String resource service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -845,12 +857,13 @@ private Mono>> deleteWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1024,6 +1037,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1031,7 +1045,7 @@ private Mono> getByResourceGroupWithResponseAsync( service .getByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1073,12 +1087,13 @@ private Mono> getByResourceGroupWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1161,6 +1176,7 @@ private Mono> listByResourceGroupSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1168,7 +1184,7 @@ private Mono> listByResourceGroupSinglePageAsync(Stri service .listByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, accept, @@ -1214,12 +1230,13 @@ private Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, accept, @@ -1318,17 +1335,13 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1364,15 +1377,11 @@ private Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1468,6 +1477,7 @@ private Mono>> failoverWithResponseAsync(String resour if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1475,7 +1485,7 @@ private Mono>> failoverWithResponseAsync(String resour service .failover( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1517,12 +1527,13 @@ private Mono>> failoverWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .failover( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1702,6 +1713,7 @@ private Mono>> restartWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1709,7 +1721,7 @@ private Mono>> restartWithResponseAsync( service .restart( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1758,12 +1770,13 @@ private Mono>> restartWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1952,6 +1965,7 @@ private Mono>> startWithResponseAsync(String resourceG if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1959,7 +1973,7 @@ private Mono>> startWithResponseAsync(String resourceG service .start( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -2001,12 +2015,13 @@ private Mono>> startWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -2178,6 +2193,7 @@ private Mono>> stopWithResponseAsync(String resourceGr if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2185,7 +2201,7 @@ private Mono>> stopWithResponseAsync(String resourceGr service .stop( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -2227,12 +2243,13 @@ private Mono>> stopWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } + final String apiVersion = "2022-09-30-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .stop( this.client.getEndpoint(), - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -2373,6 +2390,265 @@ public void stop(String resourceGroupName, String serverName, Context context) { stopAsync(resourceGroupName, serverName, context).block(); } + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetGtidWithResponseAsync( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-09-30-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetGtid( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetGtidWithResponseAsync( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-09-30-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetGtid( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResetGtidAsync( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + Mono>> mono = resetGtidWithResponseAsync(resourceGroupName, serverName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResetGtidAsync( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetGtidWithResponseAsync(resourceGroupName, serverName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetGtid( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + return this.beginResetGtidAsync(resourceGroupName, serverName, parameters).getSyncPoller(); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetGtid( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context) { + return this.beginResetGtidAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetGtidAsync(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + return beginResetGtidAsync(resourceGroupName, serverName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetGtidAsync( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context) { + return beginResetGtidAsync(resourceGroupName, serverName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + resetGtidAsync(resourceGroupName, serverName, parameters).block(); + } + + /** + * Resets GTID on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for resetting GTID on a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetGtid( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context) { + resetGtidAsync(resourceGroupName, serverName, parameters, context).block(); + } + /** * Get the next page of items. * 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 358e7ec50bf34..66d4598822e7c 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 @@ -12,6 +12,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; @@ -113,6 +114,15 @@ public void stop(String resourceGroupName, String serverName, Context context) { this.serviceClient().stop(resourceGroupName, serverName, context); } + public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { + this.serviceClient().resetGtid(resourceGroupName, serverName, parameters); + } + + public void resetGtid( + String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context) { + this.serviceClient().resetGtid(resourceGroupName, serverName, parameters, context); + } + public Server getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 0000000000000..b2892c8a5a954 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; + +public final class ValidateBackupResponseImpl implements ValidateBackupResponse { + private ValidateBackupResponseInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + ValidateBackupResponseImpl( + ValidateBackupResponseInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer numberOfContainers() { + return this.innerModel().numberOfContainers(); + } + + public ValidateBackupResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java new file mode 100644 index 0000000000000..e333e601153e1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BackupAndExport API Request. */ +@Fluent +public final class BackupAndExportRequest extends BackupRequestBase { + /* + * Backup Target Store Details + */ + @JsonProperty(value = "targetDetails", required = true) + private BackupStoreDetails targetDetails; + + /** Creates an instance of BackupAndExportRequest class. */ + public BackupAndExportRequest() { + } + + /** + * Get the targetDetails property: Backup Target Store Details. + * + * @return the targetDetails value. + */ + public BackupStoreDetails targetDetails() { + return this.targetDetails; + } + + /** + * Set the targetDetails property: Backup Target Store Details. + * + * @param targetDetails the targetDetails value to set. + * @return the BackupAndExportRequest object itself. + */ + public BackupAndExportRequest withTargetDetails(BackupStoreDetails targetDetails) { + this.targetDetails = targetDetails; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupAndExportRequest withBackupSettings(BackupSettings backupSettings) { + super.withBackupSettings(backupSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetDetails in model BackupAndExportRequest")); + } else { + targetDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportRequest.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java new file mode 100644 index 0000000000000..c07bb27739b4b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of BackupAndExportResponse. */ +public interface BackupAndExportResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the status property: The operation status. + * + * @return the status value. + */ + OperationStatus status(); + + /** + * Gets the startTime property: Start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: Operation progress (0-100). + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the error property: Error Response + * + *

The BackupAndExport operation error response. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + Long datasourceSizeInBytes(); + + /** + * Gets the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + Long dataTransferredInBytes(); + + /** + * Gets the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value + * pairs. + * + * @return the backupMetadata value. + */ + String backupMetadata(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner object. + * + * @return the inner object. + */ + BackupAndExportResponseInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java new file mode 100644 index 0000000000000..12f58ea42bbe6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BackupAndExports. */ +public interface BackupAndExports { + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response. + */ + BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); + + /** + * Exports the backup of the given server by creating a backup if not existing. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating and exporting backup of the given server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents BackupAndExport API Response. + */ + BackupAndExportResponse create( + String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response along with {@link Response}. + */ + Response validateBackupWithResponse( + String resourceGroupName, String serverName, Context context); + + /** + * Validates if backup can be performed for given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents ValidateBackup API Response. + */ + ValidateBackupResponse validateBackup(String resourceGroupName, String serverName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java new file mode 100644 index 0000000000000..187596ecf784c --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). */ +public final class BackupFormat extends ExpandableStringEnum { + /** Static value None for BackupFormat. */ + public static final BackupFormat NONE = fromString("None"); + + /** Static value CollatedFormat for BackupFormat. */ + public static final BackupFormat COLLATED_FORMAT = fromString("CollatedFormat"); + + /** + * Creates a new instance of BackupFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupFormat() { + } + + /** + * Creates or finds a BackupFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupFormat. + */ + @JsonCreator + public static BackupFormat fromString(String name) { + return fromString(name, BackupFormat.class); + } + + /** + * Gets known BackupFormat values. + * + * @return known BackupFormat values. + */ + public static Collection values() { + return values(BackupFormat.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java new file mode 100644 index 0000000000000..6449d602d0f84 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BackupRequestBase is the base for all backup request. */ +@Fluent +public class BackupRequestBase { + /* + * Backup Settings + */ + @JsonProperty(value = "backupSettings", required = true) + private BackupSettings backupSettings; + + /** Creates an instance of BackupRequestBase class. */ + public BackupRequestBase() { + } + + /** + * Get the backupSettings property: Backup Settings. + * + * @return the backupSettings value. + */ + public BackupSettings backupSettings() { + return this.backupSettings; + } + + /** + * Set the backupSettings property: Backup Settings. + * + * @param backupSettings the backupSettings value to set. + * @return the BackupRequestBase object itself. + */ + public BackupRequestBase withBackupSettings(BackupSettings backupSettings) { + this.backupSettings = backupSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backupSettings() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backupSettings in model BackupRequestBase")); + } else { + backupSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupRequestBase.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java new file mode 100644 index 0000000000000..42de6bf4329f6 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup Settings. */ +@Fluent +public final class BackupSettings { + /* + * The name of the backup. + */ + @JsonProperty(value = "backupName", required = true) + private String backupName; + + /* + * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE) + */ + @JsonProperty(value = "backupFormat") + private BackupFormat backupFormat; + + /** Creates an instance of BackupSettings class. */ + public BackupSettings() { + } + + /** + * Get the backupName property: The name of the backup. + * + * @return the backupName value. + */ + public String backupName() { + return this.backupName; + } + + /** + * Set the backupName property: The name of the backup. + * + * @param backupName the backupName value to set. + * @return the BackupSettings object itself. + */ + public BackupSettings withBackupName(String backupName) { + this.backupName = backupName; + return this; + } + + /** + * Get the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). + * + * @return the backupFormat value. + */ + public BackupFormat backupFormat() { + return this.backupFormat; + } + + /** + * Set the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). + * + * @param backupFormat the backupFormat value to set. + * @return the BackupSettings object itself. + */ + public BackupSettings withBackupFormat(BackupFormat backupFormat) { + this.backupFormat = backupFormat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backupName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property backupName in model BackupSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java new file mode 100644 index 0000000000000..87e5313d32dba --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Details about the target where the backup content will be stored. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = BackupStoreDetails.class) +@JsonTypeName("BackupStoreDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "FullBackupStoreDetails", value = FullBackupStoreDetails.class)}) +@Immutable +public class BackupStoreDetails { + /** Creates an instance of BackupStoreDetails class. */ + public BackupStoreDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java index 78e62044cf8ac..77190eb04a656 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** An immutable client-side representation of Configuration. */ @@ -44,6 +45,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. * @@ -51,6 +59,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. * @@ -100,10 +115,161 @@ 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/Configurations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java index e24da8faab4bd..cbd8114e46c08 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java @@ -7,45 +7,9 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** Resource collection API of Configurations. */ public interface Configurations { - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - Configuration update( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - Configuration update( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context); - /** * Gets information about a configuration of server. * @@ -138,4 +102,35 @@ PagedIterable listByServer( Integer page, Integer pageSize, Context context); + + /** + * Gets information about a configuration of server. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a configuration of server along with {@link Response}. + */ + Configuration getById(String id); + + /** + * Gets information about a configuration of server. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a configuration of server along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Configuration resource. + * + * @param name resource name. + * @return the first stage of the new Configuration definition. + */ + Configuration.DefinitionStages.Blank define(String name); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java new file mode 100644 index 0000000000000..182a5e2e43db7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("FullBackupStoreDetails") +@Fluent +public final class FullBackupStoreDetails extends BackupStoreDetails { + /* + * SASUriList of storage containers where backup data is to be streamed/copied. + */ + @JsonProperty(value = "sasUriList", required = true) + private List sasUriList; + + /** Creates an instance of FullBackupStoreDetails class. */ + public FullBackupStoreDetails() { + } + + /** + * Get the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. + * + * @return the sasUriList value. + */ + public List sasUriList() { + return this.sasUriList; + } + + /** + * Set the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. + * + * @param sasUriList the sasUriList value to set. + * @return the FullBackupStoreDetails object itself. + */ + public FullBackupStoreDetails withSasUriList(List sasUriList) { + this.sasUriList = sasUriList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sasUriList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sasUriList in model FullBackupStoreDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FullBackupStoreDetails.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java index 3aa3845afae3d..c46b12ed9533e 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 @@ -11,7 +11,7 @@ /** Properties to configure Identity for Bring your Own Keys. */ @Fluent -public class Identity { +public final class Identity { /* * ObjectId from the KeyVault */ 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 4ad17630fa06d..e380c8ad335be 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java @@ -4,45 +4,41 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Type of managed service identity. */ -public enum ManagedServiceIdentityType { - /** Enum value UserAssigned. */ - USER_ASSIGNED("UserAssigned"); +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - /** The actual serialized value for a ManagedServiceIdentityType instance. */ - private final String value; - - ManagedServiceIdentityType(String value) { - this.value = value; + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @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. */ @JsonCreator - 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} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java index 7b5e50e9d4afd..c74292906286c 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 @@ -14,7 +14,7 @@ public final class Network { * Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet * integration. */ - @JsonProperty(value = "publicNetworkAccess", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "publicNetworkAccess") private EnableStatusEnum publicNetworkAccess; /* @@ -43,6 +43,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. * 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 0000000000000..1132804a454cd --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The operation status. */ +public enum OperationStatus { + /** Enum value Pending. */ + PENDING("Pending"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value CancelInProgress. */ + CANCEL_IN_PROGRESS("CancelInProgress"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a OperationStatus instance. */ + private final String value; + + OperationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationStatus object, or null if unable to parse. + */ + @JsonCreator + public static OperationStatus fromString(String value) { + if (value == null) { + return null; + } + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java index 43f7efe88b29c..0defb712482f3 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 @@ -480,7 +480,8 @@ interface Update UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, UpdateStages.WithReplicationRole, - UpdateStages.WithDataEncryption { + UpdateStages.WithDataEncryption, + UpdateStages.WithNetwork { /** * Executes the update request. * @@ -608,6 +609,16 @@ 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); + } } /** * Refreshes the resource to sync with Azure. @@ -698,4 +709,25 @@ 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); } 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 01dcdbabafc8d..a1a61efddc3e2 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 @@ -295,6 +295,29 @@ public ServerForUpdate withDataEncryption(DataEncryption dataEncryption) { return this; } + /** + * Get the network property: Network related properties of a server. + * + * @return the network value. + */ + public Network network() { + return this.innerProperties() == null ? null : this.innerProperties().network(); + } + + /** + * Set the network property: Network related properties of a server. + * + * @param network the network value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withNetwork(Network network) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withNetwork(network); + return this; + } + /** * Validates the instance. * 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 0000000000000..43a2f45351179 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server gtid set parameters. */ +@Fluent +public final class ServerGtidSetParameter { + /* + * The gtid set of server. + */ + @JsonProperty(value = "gtidSet") + private String gtidSet; + + /** Creates an instance of ServerGtidSetParameter class. */ + public ServerGtidSetParameter() { + } + + /** + * Get the gtidSet property: The gtid set of server. + * + * @return the gtidSet value. + */ + public String gtidSet() { + return this.gtidSet; + } + + /** + * Set the gtidSet property: The gtid set of server. + * + * @param gtidSet the gtidSet value to set. + * @return the ServerGtidSetParameter object itself. + */ + public ServerGtidSetParameter withGtidSet(String gtidSet) { + this.gtidSet = gtidSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java index 2c5de8093a34b..c7d65da81a6b4 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 @@ -195,6 +195,31 @@ 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); + /** * Gets information about a server. * 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 9f4b6f69a9873..8567c348df707 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 @@ -28,6 +28,12 @@ public final class Storage { @JsonProperty(value = "autoGrow") private EnableStatusEnum autoGrow; + /* + * Enable Log On Disk or not. + */ + @JsonProperty(value = "logOnDisk") + private EnableStatusEnum logOnDisk; + /* * The sku name of the server storage. */ @@ -104,6 +110,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. * 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 0000000000000..f88803502a0b2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ValidateBackupResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; + +/** An immutable client-side representation of ValidateBackupResponse. */ +public interface ValidateBackupResponse { + /** + * Gets the numberOfContainers property: Estimated no of storage containers required for resource data to be backed + * up. + * + * @return the numberOfContainers value. + */ + Integer numberOfContainers(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner object. + * + * @return the inner object. + */ + ValidateBackupResponseInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/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 index 5db566be47594..60d686e6cba1f 100644 --- 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 @@ -10,7 +10,7 @@ /** Samples for AzureADAdministrators CreateOrUpdate. */ public final class AzureADAdministratorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json */ /** * Sample code: Create an azure ad administrator. 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 index 2e7f65c35e37f..abb971dbfb546 100644 --- 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 @@ -9,7 +9,7 @@ /** Samples for AzureADAdministrators Delete. */ public final class AzureADAdministratorsDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json */ /** * Sample code: Delete an azure ad administrator. 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 index 569c915a2efc3..d4fb98587e0d3 100644 --- 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 @@ -9,7 +9,7 @@ /** Samples for AzureADAdministrators Get. */ public final class AzureADAdministratorsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json */ /** * Sample code: Get an azure ad administrator. 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 index 83760ad5071a6..956453d8bda36 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for AzureADAdministrators ListByServer. */ public final class AzureADAdministratorsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json */ /** * Sample code: List Azure AD administrators in a server. 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 0000000000000..fbb01d91eb1db --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportCreateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; +import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; +import java.util.Arrays; + +/** Samples for BackupAndExport Create. */ +public final class BackupAndExportCreateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupAndExport.json + */ + /** + * Sample code: Create and Export Backup. + * + * @param manager Entry point to MySqlManager. + */ + public static void createAndExportBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .backupAndExports() + .create( + "TestGroup", + "mysqltestserver", + new BackupAndExportRequest() + .withBackupSettings(new BackupSettings().withBackupName("customer-backup-name")) + .withTargetDetails( + new FullBackupStoreDetails().withSasUriList(Arrays.asList("sasuri1", "sasuri2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java new file mode 100644 index 0000000000000..4f4c7cee72adc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportValidateBackupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** Samples for BackupAndExport ValidateBackup. */ +public final class BackupAndExportValidateBackupSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/ValidateBackup.json + */ + /** + * Sample code: Validate Backup. + * + * @param manager Entry point to MySqlManager. + */ + public static void validateBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .backupAndExports() + .validateBackupWithResponse("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetSamples.java index e4a8b3a5b300f..5108efd68a111 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 @@ -7,7 +7,7 @@ /** Samples for Backups Get. */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/BackupGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. 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 8130282dba5cf..e3246d23dfb77 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 @@ -7,7 +7,7 @@ /** Samples for Backups ListByServer. */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/BackupsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json */ /** * Sample code: List backups for a server. 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 index b336758be6d0e..b2e49f72cf080 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for Backups Put. */ public final class BackupsPutSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/BackupPut.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupPut.json */ /** * Sample code: Create backup for a server. 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 b5fec7ae0cdbb..1b4d85575b47e 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 @@ -9,7 +9,7 @@ /** Samples for CheckNameAvailability Execute. */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/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 085bcdc4f5fb1..a6c68f9eed147 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 @@ -9,7 +9,7 @@ /** Samples for CheckNameAvailabilityWithoutLocation Execute. */ public final class CheckNameAvailabilityWithoutLocationExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.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 bfa7712e7e767..aceed539d542e 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 @@ -9,7 +9,7 @@ /** Samples for CheckVirtualNetworkSubnetUsage Execute. */ public final class CheckVirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/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 2a356d033faf3..159cdf8e709a5 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 @@ -12,7 +12,7 @@ /** Samples for Configurations BatchUpdate. */ public final class ConfigurationsBatchUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json */ /** * Sample code: ConfigurationList. 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 0000000000000..224db98d89536 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; + +/** Samples for Configurations CreateOrUpdate. */ +public final class ConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationCreateOrUpdate.json + */ + /** + * Sample code: ConfigurationCreateOrUpdate. + * + * @param manager Entry point to MySqlManager. + */ + public static void configurationCreateOrUpdate(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .configurations() + .define("event_scheduler") + .withExistingFlexibleServer("TestGroup", "testserver") + .withValue("off") + .withSource(ConfigurationSource.USER_OVERRIDE) + .create(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetSamples.java index 93565cd2dc024..2b2cbe872d5b1 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 @@ -7,7 +7,7 @@ /** Samples for Configurations Get. */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/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 7160d7f9ade9b..00b9fc9391a04 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 @@ -7,7 +7,7 @@ /** Samples for Configurations ListByServer. */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json */ /** * Sample code: List all configurations for a server. 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 eb4bf7c4891c4..a5900438681be 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 @@ -4,13 +4,13 @@ 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; /** Samples for Configurations Update. */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. @@ -18,13 +18,11 @@ 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 de2c91220cb0f..90661cded5603 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 @@ -7,7 +7,7 @@ /** Samples for Databases CreateOrUpdate. */ public final class DatabasesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/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 3e297d5dbc4e6..f01b8aa2696dc 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 @@ -7,7 +7,7 @@ /** Samples for Databases Delete. */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/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 4cda33dda59eb..4d3c65bca5aec 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 @@ -7,7 +7,7 @@ /** Samples for Databases Get. */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/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 dda3e685769e2..bb91f676dc8f8 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 @@ -7,7 +7,7 @@ /** Samples for Databases ListByServer. */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabasesListByServer.json */ /** * Sample code: List databases in a server. 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 de91d27b062c1..84ecda3c44954 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 @@ -7,7 +7,7 @@ /** Samples for FirewallRules CreateOrUpdate. */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleCreate.json */ /** * Sample code: Create a firewall rule. 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 1c40bc8d531b7..77e5e69ca4a3f 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 @@ -7,7 +7,7 @@ /** Samples for FirewallRules Delete. */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleDelete.json */ /** * Sample code: Delete a firewall rule. 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 1a8a0e66a1859..853bfe5a56f97 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 @@ -7,7 +7,7 @@ /** Samples for FirewallRules Get. */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json */ /** * Sample code: Get a firewall rule. 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 5711621b3030c..fd00664fab19f 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 @@ -7,7 +7,7 @@ /** Samples for FirewallRules ListByServer. */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json */ /** * Sample code: List all firewall rules in a server. 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 2f05463211ba8..d38883b660733 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 @@ -7,7 +7,7 @@ /** Samples for GetPrivateDnsZoneSuffix Execute. */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/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 675eeff7d851f..a71984ac15fe4 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 @@ -7,7 +7,7 @@ /** Samples for LocationBasedCapabilities List. */ public final class LocationBasedCapabilitiesListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json */ /** * Sample code: CapabilitiesList. 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 index 3169f8a93f5d1..ba4d000715f48 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for LogFiles ListByServer. */ public final class LogFilesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json */ /** * Sample code: List all server log files for a server. 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 09ea68f131494..6c9412e341660 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 @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/OperationsList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json */ /** * Sample code: OperationList. 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 9133c1e2969d2..ae11afaf78b6f 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 @@ -7,7 +7,7 @@ /** Samples for Replicas ListByServer. */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json */ /** * Sample code: List replicas for a server. 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 f59e3982b5b8a..3cbba0731a774 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 @@ -27,7 +27,7 @@ /** Samples for Servers Create. */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json */ /** * Sample code: Create a replica server. @@ -47,7 +47,7 @@ public static void createAReplicaServer(com.azure.resourcemanager.mysqlflexibles } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -75,7 +75,7 @@ public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserve } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json */ /** * Sample code: Create a server with byok. @@ -122,7 +122,7 @@ public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexible } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerCreateWithPointInTimeRestore.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json */ /** * Sample code: Create a server as a point in time restore. 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 db2ba7bc9ce1f..8b1976e48c45b 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 @@ -7,7 +7,7 @@ /** Samples for Servers Delete. */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json */ /** * Sample code: Delete a server. 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 7ff1fe7c410d7..e88d37df85c6e 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 @@ -7,7 +7,7 @@ /** Samples for Servers Failover. */ public final class ServersFailoverSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerFailover.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/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 e99794f1473ef..077beb7a1c2ab 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 @@ -7,7 +7,7 @@ /** Samples for Servers GetByResourceGroup. */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json */ /** * Sample code: Get a server with vnet. @@ -19,7 +19,7 @@ public static void getAServerWithVnet(com.azure.resourcemanager.mysqlflexibleser } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/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 39d70321d3d78..e7681a57173fd 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 @@ -7,7 +7,7 @@ /** Samples for Servers ListByResourceGroup. */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServersListByResourceGroup.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json */ /** * Sample code: List servers in a resource group. 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 d5a0b358fd290..26654ceac75f4 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 @@ -7,7 +7,7 @@ /** Samples for Servers List. */ public final class ServersListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServersList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json */ /** * Sample code: List servers in a subscription. 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 0000000000000..b9c14cb05698b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; + +/** Samples for Servers ResetGtid. */ +public final class ServersResetGtidSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerResetGtid.json + */ + /** + * Sample code: Reset GTID on a server. + * + * @param manager Entry point to MySqlManager. + */ + public static void resetGTIDOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .servers() + .resetGtid( + "TestGroup", + "testserver", + new ServerGtidSetParameter().withGtidSet("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartSamples.java index 7a8970044e9c1..f2a73a6fd27fa 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 @@ -10,7 +10,7 @@ /** Samples for Servers Restart. */ public final class ServersRestartSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerRestart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/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 6f385b62fc995..96d9bbee285f0 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 @@ -7,7 +7,7 @@ /** Samples for Servers Start. */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerStart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/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 f72ac6b3776b4..5ae8062333809 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 @@ -7,7 +7,7 @@ /** Samples for Servers Stop. */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerStop.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/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 1e8eaf3bb9712..1bcbeeccb91bd 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 @@ -21,7 +21,7 @@ /** Samples for Servers Update. */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: Update server customer maintenance window. @@ -47,7 +47,7 @@ public static void updateServerCustomerMaintenanceWindow( } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerUpdateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json */ /** * Sample code: Update server with byok. @@ -85,7 +85,7 @@ public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibles } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json */ /** * Sample code: Update a server. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java deleted file mode 100644 index a0cc7069c359d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"zxbzpfzabglc\",\"sid\":\"xwtctyqiklbbovpl\",\"tenantId\":\"bhvgy\",\"identityResourceId\":\"uosvmkfssxqukk\"},\"id\":\"l\",\"name\":\"mg\",\"type\":\"xnkjzkdesl\"},{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"wiyighxpkdw\",\"sid\":\"aiuebbaumnyqu\",\"tenantId\":\"deoj\",\"identityResourceId\":\"bckhsmtxpsi\"},\"id\":\"tfhvpesapskrdqmh\",\"name\":\"jdhtldwkyzxu\",\"type\":\"tkncwsc\"}],\"nextLink\":\"vlxotogtwrupqsx\"}") - .toObject(AdministratorListResult.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); - Assertions.assertEquals("zxbzpfzabglc", model.value().get(0).login()); - Assertions.assertEquals("xwtctyqiklbbovpl", model.value().get(0).sid()); - Assertions.assertEquals("bhvgy", model.value().get(0).tenantId()); - Assertions.assertEquals("uosvmkfssxqukk", model.value().get(0).identityResourceId()); - Assertions.assertEquals("vlxotogtwrupqsx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorListResult model = - new AdministratorListResult() - .withValue( - Arrays - .asList( - new AzureADAdministratorInner() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("zxbzpfzabglc") - .withSid("xwtctyqiklbbovpl") - .withTenantId("bhvgy") - .withIdentityResourceId("uosvmkfssxqukk"), - new AzureADAdministratorInner() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("wiyighxpkdw") - .withSid("aiuebbaumnyqu") - .withTenantId("deoj") - .withIdentityResourceId("bckhsmtxpsi"))) - .withNextLink("vlxotogtwrupqsx"); - model = BinaryData.fromObject(model).toObject(AdministratorListResult.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); - Assertions.assertEquals("zxbzpfzabglc", model.value().get(0).login()); - Assertions.assertEquals("xwtctyqiklbbovpl", model.value().get(0).sid()); - Assertions.assertEquals("bhvgy", model.value().get(0).tenantId()); - Assertions.assertEquals("uosvmkfssxqukk", model.value().get(0).identityResourceId()); - Assertions.assertEquals("vlxotogtwrupqsx", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java deleted file mode 100644 index b88b793612137..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdministratorProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorProperties model = - BinaryData - .fromString( - "{\"administratorType\":\"ActiveDirectory\",\"login\":\"bhqwalmuzyoxa\",\"sid\":\"dkzjancuxrh\",\"tenantId\":\"bavxbniwdjswzt\",\"identityResourceId\":\"bpg\"}") - .toObject(AdministratorProperties.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("bhqwalmuzyoxa", model.login()); - Assertions.assertEquals("dkzjancuxrh", model.sid()); - Assertions.assertEquals("bavxbniwdjswzt", model.tenantId()); - Assertions.assertEquals("bpg", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorProperties model = - new AdministratorProperties() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("bhqwalmuzyoxa") - .withSid("dkzjancuxrh") - .withTenantId("bavxbniwdjswzt") - .withIdentityResourceId("bpg"); - model = BinaryData.fromObject(model).toObject(AdministratorProperties.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("bhqwalmuzyoxa", model.login()); - Assertions.assertEquals("dkzjancuxrh", model.sid()); - Assertions.assertEquals("bavxbniwdjswzt", model.tenantId()); - Assertions.assertEquals("bpg", model.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java deleted file mode 100644 index 4b9647625faa9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import org.junit.jupiter.api.Assertions; - -public final class AzureADAdministratorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureADAdministratorInner model = - BinaryData - .fromString( - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"qidybyx\",\"sid\":\"fclhaaxdbabphlwr\",\"tenantId\":\"fkts\",\"identityResourceId\":\"sucocmnyyazttbtw\"},\"id\":\"qpuedckzywbiex\",\"name\":\"fey\",\"type\":\"eaxib\"}") - .toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("qidybyx", model.login()); - Assertions.assertEquals("fclhaaxdbabphlwr", model.sid()); - Assertions.assertEquals("fkts", model.tenantId()); - Assertions.assertEquals("sucocmnyyazttbtw", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureADAdministratorInner model = - new AzureADAdministratorInner() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("qidybyx") - .withSid("fclhaaxdbabphlwr") - .withTenantId("fkts") - .withIdentityResourceId("sucocmnyyazttbtw"); - model = BinaryData.fromObject(model).toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("qidybyx", model.login()); - Assertions.assertEquals("fclhaaxdbabphlwr", model.sid()); - Assertions.assertEquals("fkts", model.tenantId()); - Assertions.assertEquals("sucocmnyyazttbtw", model.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java deleted file mode 100644 index d7895baf97774..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"ubpaxhe\",\"sid\":\"i\",\"tenantId\":\"vpdtiirqtdqoa\",\"identityResourceId\":\"r\"},\"id\":\"fgsqu\",\"name\":\"fxrxxle\",\"type\":\"tramxjez\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = - manager - .azureADAdministrators() - .define(AdministratorName.ACTIVE_DIRECTORY) - .withExistingFlexibleServer("cqqudf", "byxbaaabjy") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("m") - .withSid("rtuzqogs") - .withTenantId("nevfdnw") - .withIdentityResourceId("mewzsyyc") - .create(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("ubpaxhe", response.login()); - Assertions.assertEquals("i", response.sid()); - Assertions.assertEquals("vpdtiirqtdqoa", response.tenantId()); - Assertions.assertEquals("r", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java deleted file mode 100644 index fc30c9573ec75..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .azureADAdministrators() - .delete("wneaiv", "wczelpci", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java deleted file mode 100644 index 8327523807bba..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"rvxaglrvimjwosy\",\"sid\":\"itc\",\"tenantId\":\"fcktqumiekke\",\"identityResourceId\":\"ikh\"},\"id\":\"fjhdg\",\"name\":\"gge\",\"type\":\"dunyg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = - manager - .azureADAdministrators() - .getWithResponse( - "lsfeaenwabfatkld", - "xbjhwuaanozjosph", - AdministratorName.ACTIVE_DIRECTORY, - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("rvxaglrvimjwosy", response.login()); - Assertions.assertEquals("itc", response.sid()); - Assertions.assertEquals("fcktqumiekke", response.tenantId()); - Assertions.assertEquals("ikh", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java deleted file mode 100644 index cad08d5c96cfa..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"oadsuvar\",\"sid\":\"wdmjsjqbjhhyx\",\"tenantId\":\"wlycoduhpkxkg\",\"identityResourceId\":\"areqna\"},\"id\":\"qugjhkycube\",\"name\":\"dgssofwqmzqal\",\"type\":\"rmnjijpx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.azureADAdministrators().listByServer("eqidbqfatpx", "lr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.iterator().next().administratorType()); - Assertions.assertEquals("oadsuvar", response.iterator().next().login()); - Assertions.assertEquals("wdmjsjqbjhhyx", response.iterator().next().sid()); - Assertions.assertEquals("wlycoduhpkxkg", response.iterator().next().tenantId()); - Assertions.assertEquals("areqna", response.iterator().next().identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java deleted file mode 100644 index bef1740f862b0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Backup; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import org.junit.jupiter.api.Assertions; - -public final class BackupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Backup model = - BinaryData - .fromString( - "{\"backupRetentionDays\":969861111,\"geoRedundantBackup\":\"Enabled\",\"earliestRestoreDate\":\"2021-01-31T18:34:57Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(969861111, model.backupRetentionDays()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model = new Backup().withBackupRetentionDays(969861111).withGeoRedundantBackup(EnableStatusEnum.ENABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(969861111, model.backupRetentionDays()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.geoRedundantBackup()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java deleted file mode 100644 index efdf94dc04875..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"backupType\":\"xtccmg\",\"completedTime\":\"2021-02-11T06:40:02Z\",\"source\":\"ytlmoyrxvwfud\"},\"id\":\"zntxhdz\",\"name\":\"lrqjbhckfr\",\"type\":\"hrxsbk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = - manager - .backups() - .getWithResponse("tazqugxywpmueefj", "wfqkquj", "dsuyonobgla", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xtccmg", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T06:40:02Z"), response.completedTime()); - Assertions.assertEquals("ytlmoyrxvwfud", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java deleted file mode 100644 index f92baf769d35e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"backupType\":\"seyvj\",\"completedTime\":\"2021-09-13T12:12:28Z\",\"source\":\"slhs\"},\"id\":\"deemao\",\"name\":\"mx\",\"type\":\"gkvtmelmqkrhah\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.backups().listByServer("vpycanuzbp", "kafkuwbcrnwbm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("seyvj", response.iterator().next().backupType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-09-13T12:12:28Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("slhs", response.iterator().next().source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java deleted file mode 100644 index 8bb5728fc220b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"backupType\":\"nxdhbt\",\"completedTime\":\"2020-12-23T07:25:08Z\",\"source\":\"ywpnvjt\"},\"id\":\"nermcl\",\"name\":\"plpho\",\"type\":\"uscrpabgyepsb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = - manager - .backups() - .putWithResponse("nmic", "kvceoveilovnotyf", "fcnj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nxdhbt", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T07:25:08Z"), response.completedTime()); - Assertions.assertEquals("ywpnvjt", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java deleted file mode 100644 index c584835beb56e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitiesListResult; - -public final class CapabilitiesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitiesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"zone\":\"wxrjfeallnwsub\",\"supportedHAMode\":[\"jampmngnzscxaqw\",\"ochcbonqvpkvl\"],\"supportedGeoBackupRegions\":[\"jease\",\"pheoflokeyy\",\"enjbdlwtgrhp\",\"jp\"],\"supportedFlexibleServerEditions\":[]}],\"nextLink\":\"sxazjpq\"}") - .toObject(CapabilitiesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesListResult model = new CapabilitiesListResult(); - model = BinaryData.fromObject(model).toObject(CapabilitiesListResult.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java deleted file mode 100644 index 4c83c08768b71..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner; - -public final class CapabilityPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityPropertiesInner model = - BinaryData - .fromString( - "{\"zone\":\"gual\",\"supportedHAMode\":[\"xhejjzzvdud\",\"wdslfhotwmcy\",\"pwlbjnpg\"],\"supportedGeoBackupRegions\":[\"tadehxnltyfsopp\",\"suesnzw\",\"ej\",\"avo\"],\"supportedFlexibleServerEditions\":[{\"name\":\"mohctb\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"dndnvow\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"wdkcglhsl\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]}]}") - .toObject(CapabilityPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesInner model = new CapabilityPropertiesInner(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesInner.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java deleted file mode 100644 index bd27e5a7e5ed0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"message\":\"crkvcikhnv\",\"nameAvailable\":false,\"reason\":\"gxqquezik\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilities() - .executeWithResponse( - "ncvokotllxdyhg", - new NameAvailabilityRequest().withName("y").withType("ogjltdtbnnhad"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("crkvcikhnv", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("gxqquezik", response.reason()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java deleted file mode 100644 index 0cffb43a8c45d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"message\":\"cjzkzivgvvcna\",\"nameAvailable\":false,\"reason\":\"rnxxmueed\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilityWithoutLocations() - .executeWithResponse( - new NameAvailabilityRequest().withName("wggxkallat").withType("lwuip"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("cjzkzivgvvcna", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("rnxxmueed", response.reason()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java deleted file mode 100644 index 4266ae0b71412..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"ypyynpcdpumnzg\",\"subscriptionId\":\"z\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"iknsorgjh\",\"usage\":7538220819901034139},{\"subnetName\":\"lwwrl\",\"usage\":214616296495894801}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualNetworkSubnetUsageResult response = - manager - .checkVirtualNetworkSubnetUsages() - .executeWithResponse( - "ynkedyatrwyhqmib", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("hwit"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java deleted file mode 100644 index 4ff531d1f70fe..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationForBatchUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForBatchUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForBatchUpdateProperties model = - BinaryData - .fromString("{\"value\":\"ipjoxzjnchgejs\",\"source\":\"dmailzydehojw\"}") - .toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("ipjoxzjnchgejs", model.value()); - Assertions.assertEquals("dmailzydehojw", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForBatchUpdateProperties model = - new ConfigurationForBatchUpdateProperties().withValue("ipjoxzjnchgejs").withSource("dmailzydehojw"); - model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("ipjoxzjnchgejs", model.value()); - Assertions.assertEquals("dmailzydehojw", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java deleted file mode 100644 index 922bcef56c2a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForBatchUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForBatchUpdate model = - BinaryData - .fromString("{\"name\":\"hkryhtn\",\"properties\":{\"value\":\"zw\",\"source\":\"kjyemkk\"}}") - .toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("hkryhtn", model.name()); - Assertions.assertEquals("zw", model.value()); - Assertions.assertEquals("kjyemkk", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForBatchUpdate model = - new ConfigurationForBatchUpdate().withName("hkryhtn").withValue("zw").withSource("kjyemkk"); - model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("hkryhtn", model.name()); - Assertions.assertEquals("zw", model.value()); - Assertions.assertEquals("kjyemkk", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java deleted file mode 100644 index a632c02cb8184..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationInner model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"ouajpsqucmpoyf\",\"description\":\"fogknygjofjdde\",\"defaultValue\":\"rd\",\"dataType\":\"pewnw\",\"allowedValues\":\"itjz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"fcqhsmyurkd\",\"name\":\"mlxhekuksjtxukcd\",\"type\":\"parcry\"}") - .toObject(ConfigurationInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationInner model = - new ConfigurationInner().withValue("ouajpsqucmpoyf").withSource(ConfigurationSource.SYSTEM_DEFAULT); - model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java deleted file mode 100644 index 8be2b1bb3c8c6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationListForBatchUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListForBatchUpdate model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"hanufhfcbjysagi\",\"properties\":{\"value\":\"qhabifpikxwcz\",\"source\":\"scnpqxuhivy\"}},{\"name\":\"iwbybrkxvdumjg\",\"properties\":{\"value\":\"wvukx\",\"source\":\"udccsnhsjc\"}}],\"resetAllToDefault\":\"True\"}") - .toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("hanufhfcbjysagi", model.value().get(0).name()); - Assertions.assertEquals("qhabifpikxwcz", model.value().get(0).value()); - Assertions.assertEquals("scnpqxuhivy", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.TRUE, model.resetAllToDefault()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListForBatchUpdate model = - new ConfigurationListForBatchUpdate() - .withValue( - Arrays - .asList( - new ConfigurationForBatchUpdate() - .withName("hanufhfcbjysagi") - .withValue("qhabifpikxwcz") - .withSource("scnpqxuhivy"), - new ConfigurationForBatchUpdate() - .withName("iwbybrkxvdumjg") - .withValue("wvukx") - .withSource("udccsnhsjc"))) - .withResetAllToDefault(ResetAllToDefault.TRUE); - model = BinaryData.fromObject(model).toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("hanufhfcbjysagi", model.value().get(0).name()); - Assertions.assertEquals("qhabifpikxwcz", model.value().get(0).value()); - Assertions.assertEquals("scnpqxuhivy", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.TRUE, model.resetAllToDefault()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java deleted file mode 100644 index b18a9d02774e9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.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\":\"inpm\",\"description\":\"jaqwixjsp\",\"defaultValue\":\"zvcputegjvwmfda\",\"dataType\":\"cmdv\",\"allowedValues\":\"hulsuuvmkjozkrwf\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"ej\",\"name\":\"pvwryoqpsoacc\",\"type\":\"azakl\"},{\"properties\":{\"value\":\"hbcryffdfdosyge\",\"description\":\"aojakhmsbzjhcrz\",\"defaultValue\":\"dphlxaolt\",\"dataType\":\"trg\",\"allowedValues\":\"bpf\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"jrwzox\",\"name\":\"j\",\"type\":\"felluwfzitonpe\"},{\"properties\":{\"value\":\"jkjlxofpdvhpfx\",\"description\":\"pini\",\"defaultValue\":\"ayhuy\",\"dataType\":\"kpode\",\"allowedValues\":\"oginuvamiheognar\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"ivyevcciqihnhun\",\"name\":\"bwjzr\",\"type\":\"fygxgispemvtzfk\"}],\"nextLink\":\"ubljofxqe\"}") - .toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("inpm", model.value().get(0).value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); - Assertions.assertEquals("ubljofxqe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResultInner model = - new ConfigurationListResultInner() - .withValue( - Arrays - .asList( - new ConfigurationInner().withValue("inpm").withSource(ConfigurationSource.SYSTEM_DEFAULT), - new ConfigurationInner() - .withValue("hbcryffdfdosyge") - .withSource(ConfigurationSource.SYSTEM_DEFAULT), - new ConfigurationInner() - .withValue("jkjlxofpdvhpfx") - .withSource(ConfigurationSource.SYSTEM_DEFAULT))) - .withNextLink("ubljofxqe"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("inpm", model.value().get(0).value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); - Assertions.assertEquals("ubljofxqe", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java deleted file mode 100644 index eadf54f62ee3b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationProperties model = - BinaryData - .fromString( - "{\"value\":\"nzwuxzd\",\"description\":\"a\",\"defaultValue\":\"lhmwhfpmrqobm\",\"dataType\":\"kknryrtihf\",\"allowedValues\":\"ijbpzvgnwzsymgl\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"}") - .toObject(ConfigurationProperties.class); - Assertions.assertEquals("nzwuxzd", model.value()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationProperties model = - new ConfigurationProperties().withValue("nzwuxzd").withSource(ConfigurationSource.USER_OVERRIDE); - model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("nzwuxzd", model.value()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java deleted file mode 100644 index 1f271f6a5009f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsBatchUpdateMockTests { - @Test - public void testBatchUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ah\",\"name\":\"pjyzhpv\",\"type\":\"qzcjrvxdj\"}],\"nextLink\":\"mwlxk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationListResult response = - manager - .configurations() - .batchUpdate( - "mtsavjcbpwxqp", - "rknftguvriuhprwm", - new ConfigurationListForBatchUpdate() - .withValue( - Arrays - .asList( - new ConfigurationForBatchUpdate().withName("qtayri"), - new ConfigurationForBatchUpdate().withName("oyq"), - new ConfigurationForBatchUpdate().withName("rmcqiby"), - new ConfigurationForBatchUpdate().withName("jvkn"))) - .withResetAllToDefault(ResetAllToDefault.FALSE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mwlxk", response.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 5a7ebffa6221c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"zqlveualupjmkhf\",\"description\":\"bbcswsrtjri\",\"defaultValue\":\"rbpbewtghfgblcg\",\"dataType\":\"zvlvqhjkbegib\",\"allowedValues\":\"mxiebw\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"rtzju\",\"name\":\"gwyzm\",\"type\":\"txon\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .getWithResponse("l", "zbtd", "xujznbmpowu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zqlveualupjmkhf", response.value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java deleted file mode 100644 index 9b0042e98c940..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"value\":\"jzuaejxdultskzbb\",\"description\":\"zumveekgpwo\",\"defaultValue\":\"hkfpbs\",\"dataType\":\"ofd\",\"allowedValues\":\"uusdttouwa\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"smv\",\"name\":\"xwyjsflhhc\",\"type\":\"aln\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .configurations() - .listByServer( - "ug", "hzovawjvzunlut", "nnprn", "i", 1099728143, 1381337865, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jzuaejxdultskzbb", response.iterator().next().value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.iterator().next().source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java deleted file mode 100644 index 2c4e43337f4c8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"bvmeuecivy\",\"description\":\"ce\",\"defaultValue\":\"jgjrwjueiotwm\",\"dataType\":\"ytdxwit\",\"allowedValues\":\"rjaw\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"x\",\"name\":\"bkpyc\",\"type\":\"klwndnhjdauwhv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .update( - "ljuahaquhcdh", - "duala", - "xqpvfadmw", - new ConfigurationInner().withValue("r").withSource(ConfigurationSource.SYSTEM_DEFAULT), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bvmeuecivy", response.value()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java deleted file mode 100644 index f8d24e2c36060..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"charset\":\"aeqjhqjbasvms\",\"collation\":\"qulngsntnbybkzgc\"},\"id\":\"wclxxwrl\",\"name\":\"douskcqvkocrcjdk\",\"type\":\"tnhxbn\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("aeqjhqjbasvms", model.charset()); - Assertions.assertEquals("qulngsntnbybkzgc", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("aeqjhqjbasvms").withCollation("qulngsntnbybkzgc"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("aeqjhqjbasvms", model.charset()); - Assertions.assertEquals("qulngsntnbybkzgc", model.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java deleted file mode 100644 index df5cba50a20e6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.DatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"charset\":\"eebvmgxsab\",\"collation\":\"qduujitcjczdz\"},\"id\":\"ndhkrw\",\"name\":\"d\",\"type\":\"ppdsbdkvwrwj\"},{\"properties\":{\"charset\":\"snhu\",\"collation\":\"eltmrldhugjzzdat\"},\"id\":\"hocdgeab\",\"name\":\"gphuticndvka\",\"type\":\"zwyiftyhxhur\"},{\"properties\":{\"charset\":\"tyxolniwpwc\",\"collation\":\"jfkgiawxk\"},\"id\":\"ypl\",\"name\":\"ckbasyypndd\",\"type\":\"sgcbac\"}],\"nextLink\":\"ejk\"}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("eebvmgxsab", model.value().get(0).charset()); - Assertions.assertEquals("qduujitcjczdz", model.value().get(0).collation()); - Assertions.assertEquals("ejk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = - new DatabaseListResult() - .withValue( - Arrays - .asList( - new DatabaseInner().withCharset("eebvmgxsab").withCollation("qduujitcjczdz"), - new DatabaseInner().withCharset("snhu").withCollation("eltmrldhugjzzdat"), - new DatabaseInner().withCharset("tyxolniwpwc").withCollation("jfkgiawxk"))) - .withNextLink("ejk"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("eebvmgxsab", model.value().get(0).charset()); - Assertions.assertEquals("qduujitcjczdz", model.value().get(0).collation()); - Assertions.assertEquals("ejk", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java deleted file mode 100644 index 26c12f112842e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseProperties model = - BinaryData - .fromString("{\"charset\":\"iksqr\",\"collation\":\"ssainqpjwnzll\"}") - .toObject(DatabaseProperties.class); - Assertions.assertEquals("iksqr", model.charset()); - Assertions.assertEquals("ssainqpjwnzll", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("iksqr").withCollation("ssainqpjwnzll"); - model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("iksqr", model.charset()); - Assertions.assertEquals("ssainqpjwnzll", model.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java deleted file mode 100644 index 649e7c45e83f6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"qtdo\",\"collation\":\"cbxvwvxyslqbh\"},\"id\":\"xoblytkbl\",\"name\":\"pe\",\"type\":\"wwfbkrvrnsvshq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .define("rmfqjhhkxbpvj") - .withExistingFlexibleServer("moizpos", "mgrcfbu") - .withCharset("hx") - .withCollation("yngudivk") - .create(); - - Assertions.assertEquals("qtdo", response.charset()); - Assertions.assertEquals("cbxvwvxyslqbh", response.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java deleted file mode 100644 index 8b544abdd9c67..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.databases().delete("ixisxyawjoy", "qcslyjpkiid", "yexz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java deleted file mode 100644 index 1673acea2aa9f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"pnapnyiropuh\",\"collation\":\"gvpgy\"},\"id\":\"qgitxmed\",\"name\":\"v\",\"type\":\"slynqwwnc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .getWithResponse("eli", "hnrztfol", "bnxknalaulppg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pnapnyiropuh", response.charset()); - Assertions.assertEquals("gvpgy", response.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java deleted file mode 100644 index ea04db4167fec..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"charset\":\"ygpfqb\",\"collation\":\"ceopzfqrhhuaopp\"},\"id\":\"qeqxo\",\"name\":\"z\",\"type\":\"ahzxctobgbk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.databases().listByServer("zzhxgktrm", "ucnapkteoellwp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ygpfqb", response.iterator().next().charset()); - Assertions.assertEquals("ceopzfqrhhuaopp", response.iterator().next().collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java deleted file mode 100644 index 38a8e5f128930..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.DelegatedSubnetUsage; - -public final class DelegatedSubnetUsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelegatedSubnetUsage model = - BinaryData - .fromString("{\"subnetName\":\"qjvsovmyokacs\",\"usage\":429791645312518645}") - .toObject(DelegatedSubnetUsage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelegatedSubnetUsage model = new DelegatedSubnetUsage(); - model = BinaryData.fromObject(model).toObject(DelegatedSubnetUsage.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java deleted file mode 100644 index 0b1843faaf528..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"startIpAddress\":\"tynqgoul\",\"endIpAddress\":\"ndlik\"},\"id\":\"qkgfgibma\",\"name\":\"gakeqsr\",\"type\":\"yb\"}") - .toObject(FirewallRuleInner.class); - Assertions.assertEquals("tynqgoul", model.startIpAddress()); - Assertions.assertEquals("ndlik", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleInner model = new FirewallRuleInner().withStartIpAddress("tynqgoul").withEndIpAddress("ndlik"); - model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("tynqgoul", model.startIpAddress()); - Assertions.assertEquals("ndlik", model.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java deleted file mode 100644 index 2720eb7897120..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRuleListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"b\",\"endIpAddress\":\"wtmutduq\"},\"id\":\"ap\",\"name\":\"pwgcuertu\",\"type\":\"kdosvqw\"},{\"properties\":{\"startIpAddress\":\"bmdg\",\"endIpAddress\":\"bjf\"},\"id\":\"gmbmbexppbh\",\"name\":\"q\",\"type\":\"rolfpfp\"}],\"nextLink\":\"lgbquxig\"}") - .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("b", model.value().get(0).startIpAddress()); - Assertions.assertEquals("wtmutduq", model.value().get(0).endIpAddress()); - Assertions.assertEquals("lgbquxig", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = - new FirewallRuleListResult() - .withValue( - Arrays - .asList( - new FirewallRuleInner().withStartIpAddress("b").withEndIpAddress("wtmutduq"), - new FirewallRuleInner().withStartIpAddress("bmdg").withEndIpAddress("bjf"))) - .withNextLink("lgbquxig"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("b", model.value().get(0).startIpAddress()); - Assertions.assertEquals("wtmutduq", model.value().get(0).endIpAddress()); - Assertions.assertEquals("lgbquxig", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java deleted file mode 100644 index f22dc9027e470..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleProperties; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleProperties model = - BinaryData - .fromString("{\"startIpAddress\":\"qqedqytbciqfou\",\"endIpAddress\":\"lmmnkzsmodmglo\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("qqedqytbciqfou", model.startIpAddress()); - Assertions.assertEquals("lmmnkzsmodmglo", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleProperties model = - new FirewallRuleProperties().withStartIpAddress("qqedqytbciqfou").withEndIpAddress("lmmnkzsmodmglo"); - model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("qqedqytbciqfou", model.startIpAddress()); - Assertions.assertEquals("lmmnkzsmodmglo", model.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java deleted file mode 100644 index 2433b2c9d34a7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"startIpAddress\":\"ntnev\",\"endIpAddress\":\"iwjmygtdssls\"},\"id\":\"mweriofzpy\",\"name\":\"semwabnet\",\"type\":\"hhszh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .define("dnbbglzps") - .withExistingFlexibleServer("aolps", "lqlfm") - .withStartIpAddress("iydmcwyhzdxs") - .withEndIpAddress("adbzmnvdfznud") - .create(); - - Assertions.assertEquals("ntnev", response.startIpAddress()); - Assertions.assertEquals("iwjmygtdssls", response.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java deleted file mode 100644 index 9472d2433877a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.firewallRules().delete("ohxcrsbfova", "rruvwbhsq", "sub", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java deleted file mode 100644 index b361e5b28eaf6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"startIpAddress\":\"twss\",\"endIpAddress\":\"t\"},\"id\":\"pvjzbe\",\"name\":\"ilzznfqqnvwp\",\"type\":\"qtaruoujmkcjhwq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .getWithResponse("gjb", "rxbpyb", "rfbjf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("twss", response.startIpAddress()); - Assertions.assertEquals("t", response.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java deleted file mode 100644 index ad72e3d56e4c1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"startIpAddress\":\"doy\",\"endIpAddress\":\"mifthnzdnd\"},\"id\":\"gnayqigynduh\",\"name\":\"vhqlkthumaqo\",\"type\":\"bgycduiertgccym\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.firewallRules().listByServer("tjrybnwjewgdr", "ervnaenqpehi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("doy", response.iterator().next().startIpAddress()); - Assertions.assertEquals("mifthnzdnd", response.iterator().next().endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java deleted file mode 100644 index 8a4fe9b2fdc2d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class GetPrivateDnsZoneSuffixResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = - BinaryData - .fromString("{\"privateDnsZoneSuffix\":\"uugidyjrrfby\"}") - .toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("uugidyjrrfby", model.privateDnsZoneSuffix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = - new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("uugidyjrrfby"); - model = BinaryData.fromObject(model).toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("uugidyjrrfby", model.privateDnsZoneSuffix()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java deleted file mode 100644 index 9347b661d23a0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"privateDnsZoneSuffix\":\"rdvstkwqqtch\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GetPrivateDnsZoneSuffixResponse response = - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("rdvstkwqqtch", response.privateDnsZoneSuffix()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java deleted file mode 100644 index 6771104392775..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailability model = - BinaryData - .fromString( - "{\"mode\":\"SameZone\",\"state\":\"Healthy\",\"standbyAvailabilityZone\":\"abnmocpcyshu\"}") - .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.SAME_ZONE, model.mode()); - Assertions.assertEquals("abnmocpcyshu", model.standbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailability model = - new HighAvailability().withMode(HighAvailabilityMode.SAME_ZONE).withStandbyAvailabilityZone("abnmocpcyshu"); - model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.SAME_ZONE, model.mode()); - Assertions.assertEquals("abnmocpcyshu", model.standbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java deleted file mode 100644 index 27d141f49cb45..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; -import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"uckyf\",\"tenantId\":\"rfidfvzwdz\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wxmnteiwao\":\"datawisdkft\",\"fsrpymzidnse\":\"datavkmijcmmxdcuf\",\"yc\":\"datacxtbzsg\",\"mdwzjeiachboo\":\"datasne\"}}") - .toObject(Identity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = - new Identity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "wxmnteiwao", - "datawisdkft", - "fsrpymzidnse", - "datavkmijcmmxdcuf", - "yc", - "datacxtbzsg", - "mdwzjeiachboo", - "datasne")); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java deleted file mode 100644 index f96ac661452eb..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilityProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitiesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"zone\":\"fqka\",\"supportedHAMode\":[\"iipfpubj\",\"bwwift\"],\"supportedGeoBackupRegions\":[\"kvpuvksgplsaknyn\",\"synljphuopxodl\",\"iyntorzihle\",\"sjswsrms\"],\"supportedFlexibleServerEditions\":[{\"name\":\"pzbchck\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"xiy\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]}]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.locationBasedCapabilities().list("uu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java deleted file mode 100644 index 191dab168a630..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileInner model = - BinaryData - .fromString( - "{\"properties\":{\"sizeInKB\":1650647626366334623,\"createdTime\":\"2021-09-11T07:53:16Z\",\"type\":\"kanyktzlcuiywg\",\"lastModifiedTime\":\"2021-06-17T20:14:54Z\",\"url\":\"ndrvynhzg\"},\"id\":\"hrc\",\"name\":\"yncocpecfvmmcoo\",\"type\":\"sxlzevgbmqj\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(1650647626366334623L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T07:53:16Z"), model.createdTime()); - Assertions.assertEquals("kanyktzlcuiywg", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T20:14:54Z"), model.lastModifiedTime()); - Assertions.assertEquals("ndrvynhzg", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = - new LogFileInner() - .withSizeInKB(1650647626366334623L) - .withCreatedTime(OffsetDateTime.parse("2021-09-11T07:53:16Z")) - .withTypePropertiesType("kanyktzlcuiywg") - .withLastModifiedTime(OffsetDateTime.parse("2021-06-17T20:14:54Z")) - .withUrl("ndrvynhzg"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(1650647626366334623L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T07:53:16Z"), model.createdTime()); - Assertions.assertEquals("kanyktzlcuiywg", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T20:14:54Z"), model.lastModifiedTime()); - Assertions.assertEquals("ndrvynhzg", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java deleted file mode 100644 index aee5167c82601..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFileListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogFileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"sizeInKB\":5974596582216601991,\"createdTime\":\"2021-09-17T10:09:05Z\",\"type\":\"cffcyddglmj\",\"lastModifiedTime\":\"2021-01-08T20:29:39Z\",\"url\":\"kw\"},\"id\":\"eicxmqciwqvhkhi\",\"name\":\"uigdtopbobjog\",\"type\":\"m\"},{\"properties\":{\"sizeInKB\":152177309895982741,\"createdTime\":\"2021-08-13T08:15:28Z\",\"type\":\"rzayv\",\"lastModifiedTime\":\"2021-03-05T03:10:15Z\",\"url\":\"vdfgiotk\"},\"id\":\"utqxlngx\",\"name\":\"efgugnxk\",\"type\":\"xdqmidtthzrvqdra\"}],\"nextLink\":\"jybige\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(5974596582216601991L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T10:09:05Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("cffcyddglmj", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T20:29:39Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("kw", model.value().get(0).url()); - Assertions.assertEquals("jybige", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = - new LogFileListResult() - .withValue( - Arrays - .asList( - new LogFileInner() - .withSizeInKB(5974596582216601991L) - .withCreatedTime(OffsetDateTime.parse("2021-09-17T10:09:05Z")) - .withTypePropertiesType("cffcyddglmj") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-08T20:29:39Z")) - .withUrl("kw"), - new LogFileInner() - .withSizeInKB(152177309895982741L) - .withCreatedTime(OffsetDateTime.parse("2021-08-13T08:15:28Z")) - .withTypePropertiesType("rzayv") - .withLastModifiedTime(OffsetDateTime.parse("2021-03-05T03:10:15Z")) - .withUrl("vdfgiotk"))) - .withNextLink("jybige"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(5974596582216601991L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T10:09:05Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("cffcyddglmj", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T20:29:39Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("kw", model.value().get(0).url()); - Assertions.assertEquals("jybige", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java deleted file mode 100644 index 3e38825551f64..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileProperties model = - BinaryData - .fromString( - "{\"sizeInKB\":6844004088185237478,\"createdTime\":\"2021-02-17T22:01:44Z\",\"type\":\"ivkwlzuvccfwnfnb\",\"lastModifiedTime\":\"2021-04-04T07:21:26Z\",\"url\":\"onlebxetqgtzxdpn\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(6844004088185237478L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-17T22:01:44Z"), model.createdTime()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T07:21:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("onlebxetqgtzxdpn", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = - new LogFileProperties() - .withSizeInKB(6844004088185237478L) - .withCreatedTime(OffsetDateTime.parse("2021-02-17T22:01:44Z")) - .withType("ivkwlzuvccfwnfnb") - .withLastModifiedTime(OffsetDateTime.parse("2021-04-04T07:21:26Z")) - .withUrl("onlebxetqgtzxdpn"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(6844004088185237478L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-17T22:01:44Z"), model.createdTime()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T07:21:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("onlebxetqgtzxdpn", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java deleted file mode 100644 index c4b7f16ed20b0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LogFilesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"sizeInKB\":8335274886610479577,\"createdTime\":\"2021-01-02T23:27:33Z\",\"type\":\"bpkkpwdre\",\"lastModifiedTime\":\"2021-09-12T16:04:39Z\",\"url\":\"vq\"},\"id\":\"vljxywsu\",\"name\":\"syrsndsytgadgvra\",\"type\":\"aeneqnzarrwl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.logFiles().listByServer("afnn", "lpichk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(8335274886610479577L, response.iterator().next().sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-02T23:27:33Z"), response.iterator().next().createdTime()); - Assertions.assertEquals("bpkkpwdre", response.iterator().next().typePropertiesType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-09-12T16:04:39Z"), response.iterator().next().lastModifiedTime()); - Assertions.assertEquals("vq", response.iterator().next().url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java deleted file mode 100644 index 59244b34ca5f0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindow model = - BinaryData - .fromString( - "{\"customWindow\":\"bqidtqaj\",\"startHour\":303743621,\"startMinute\":743908174,\"dayOfWeek\":144447336}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("bqidtqaj", model.customWindow()); - Assertions.assertEquals(303743621, model.startHour()); - Assertions.assertEquals(743908174, model.startMinute()); - Assertions.assertEquals(144447336, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = - new MaintenanceWindow() - .withCustomWindow("bqidtqaj") - .withStartHour(303743621) - .withStartMinute(743908174) - .withDayOfWeek(144447336); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("bqidtqaj", model.customWindow()); - Assertions.assertEquals(303743621, model.startHour()); - Assertions.assertEquals(743908174, model.startMinute()); - Assertions.assertEquals(144447336, model.dayOfWeek()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java deleted file mode 100644 index f6f4ce6be0c6d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityInner model = - BinaryData - .fromString("{\"message\":\"jiwkuofoskghsau\",\"nameAvailable\":true,\"reason\":\"mvxi\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals("jiwkuofoskghsau", model.message()); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("mvxi", model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = - new NameAvailabilityInner().withMessage("jiwkuofoskghsau").withNameAvailable(true).withReason("mvxi"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals("jiwkuofoskghsau", model.message()); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("mvxi", model.reason()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java deleted file mode 100644 index 9676ae51e2ec1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"hzdobpxjmflbvvnc\",\"type\":\"kcciwwzjuqkhr\"}") - .toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.name()); - Assertions.assertEquals("kcciwwzjuqkhr", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityRequest model = - new NameAvailabilityRequest().withName("hzdobpxjmflbvvnc").withType("kcciwwzjuqkhr"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.name()); - Assertions.assertEquals("kcciwwzjuqkhr", model.type()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java deleted file mode 100644 index 13de445b423b1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Network model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Disabled\",\"delegatedSubnetResourceId\":\"bl\",\"privateDnsZoneResourceId\":\"gpbtoqcjmklj\"}") - .toObject(Network.class); - Assertions.assertEquals("bl", model.delegatedSubnetResourceId()); - Assertions.assertEquals("gpbtoqcjmklj", model.privateDnsZoneResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Network model = new Network().withDelegatedSubnetResourceId("bl").withPrivateDnsZoneResourceId("gpbtoqcjmklj"); - model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals("bl", model.delegatedSubnetResourceId()); - Assertions.assertEquals("gpbtoqcjmklj", model.privateDnsZoneResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java deleted file mode 100644 index 03ee9ab7ec4d3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"cvpnazzmhjrunmpx\",\"resource\":\"dbhrbnlankxm\",\"operation\":\"k\",\"description\":\"henbtkcxywnytn\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("cvpnazzmhjrunmpx", model.provider()); - Assertions.assertEquals("dbhrbnlankxm", model.resource()); - Assertions.assertEquals("k", model.operation()); - Assertions.assertEquals("henbtkcxywnytn", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("cvpnazzmhjrunmpx") - .withResource("dbhrbnlankxm") - .withOperation("k") - .withDescription("henbtkcxywnytn"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("cvpnazzmhjrunmpx", model.provider()); - Assertions.assertEquals("dbhrbnlankxm", model.resource()); - Assertions.assertEquals("k", model.operation()); - Assertions.assertEquals("henbtkcxywnytn", model.description()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java deleted file mode 100644 index 5906c132ab4d9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.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\":\"riwflzlfb\",\"display\":{\"provider\":\"uzycispnqza\",\"resource\":\"gkbrpyyd\",\"operation\":\"bnuqqkpik\",\"description\":\"rgvtqag\"},\"origin\":\"uynhijg\",\"properties\":{\"arbu\":\"databfs\"}}") - .toObject(OperationInner.class); - Assertions.assertEquals("riwflzlfb", model.name()); - Assertions.assertEquals("uzycispnqza", model.display().provider()); - Assertions.assertEquals("gkbrpyyd", model.display().resource()); - Assertions.assertEquals("bnuqqkpik", model.display().operation()); - Assertions.assertEquals("rgvtqag", model.display().description()); - Assertions.assertEquals("uynhijg", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = - new OperationInner() - .withName("riwflzlfb") - .withDisplay( - new OperationDisplay() - .withProvider("uzycispnqza") - .withResource("gkbrpyyd") - .withOperation("bnuqqkpik") - .withDescription("rgvtqag")) - .withOrigin("uynhijg") - .withProperties(mapOf("arbu", "databfs")); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("riwflzlfb", model.name()); - Assertions.assertEquals("uzycispnqza", model.display().provider()); - Assertions.assertEquals("gkbrpyyd", model.display().resource()); - Assertions.assertEquals("bnuqqkpik", model.display().operation()); - Assertions.assertEquals("rgvtqag", model.display().description()); - Assertions.assertEquals("uynhijg", model.origin()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java deleted file mode 100644 index 1a2e4882f553c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"e\",\"display\":{\"provider\":\"onpc\",\"resource\":\"ocohslkevleg\",\"operation\":\"fbuhfmvfaxkffe\",\"description\":\"th\"},\"origin\":\"m\",\"properties\":{\"hxmzsbbzoggig\":\"datav\",\"ydptkoen\":\"dataxwburvjxxjns\"}},{\"name\":\"uknvudwti\",\"display\":{\"provider\":\"ldngkpoci\",\"resource\":\"z\",\"operation\":\"o\",\"description\":\"ukgjnpiucgygevq\"},\"origin\":\"typmrbpizcdrqjsd\",\"properties\":{\"eoejzic\":\"datanfyhx\",\"hajdeyeamdpha\":\"dataifsjttgzfbishcb\",\"wkgshwa\":\"dataalpbuxwgipwhon\",\"bin\":\"datakix\"}},{\"name\":\"pu\",\"display\":{\"provider\":\"rywn\",\"resource\":\"oqftiyqzrnkcq\",\"operation\":\"xlwhzlsicoh\",\"description\":\"qnwvlrya\"},\"origin\":\"hheunmmqhgyx\",\"properties\":{\"koklya\":\"datanoc\",\"ewrmjmwvvjektc\":\"datauconuqszfkbey\"}},{\"name\":\"enhwlrs\",\"display\":{\"provider\":\"zpwv\",\"resource\":\"dqgbiqylihkaetc\",\"operation\":\"vfcivfsnkymuc\",\"description\":\"hjfbebrjcxe\"},\"origin\":\"uwutttxfvjrbi\",\"properties\":{\"jky\":\"dataxepcyvahfn\",\"ljyoxgvcltb\":\"dataxjvuujqgidokg\",\"bijhtxfvgxbf\":\"datasncghkjeszz\",\"ec\":\"datamxnehmp\"}}],\"nextLink\":\"odebfqkkrbmpu\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("e", model.value().get(0).name()); - Assertions.assertEquals("onpc", model.value().get(0).display().provider()); - Assertions.assertEquals("ocohslkevleg", model.value().get(0).display().resource()); - Assertions.assertEquals("fbuhfmvfaxkffe", model.value().get(0).display().operation()); - Assertions.assertEquals("th", model.value().get(0).display().description()); - Assertions.assertEquals("m", model.value().get(0).origin()); - Assertions.assertEquals("odebfqkkrbmpu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = - new OperationListResult() - .withValue( - Arrays - .asList( - new OperationInner() - .withName("e") - .withDisplay( - new OperationDisplay() - .withProvider("onpc") - .withResource("ocohslkevleg") - .withOperation("fbuhfmvfaxkffe") - .withDescription("th")) - .withOrigin("m") - .withProperties(mapOf("hxmzsbbzoggig", "datav", "ydptkoen", "dataxwburvjxxjns")), - new OperationInner() - .withName("uknvudwti") - .withDisplay( - new OperationDisplay() - .withProvider("ldngkpoci") - .withResource("z") - .withOperation("o") - .withDescription("ukgjnpiucgygevq")) - .withOrigin("typmrbpizcdrqjsd") - .withProperties( - mapOf( - "eoejzic", - "datanfyhx", - "hajdeyeamdpha", - "dataifsjttgzfbishcb", - "wkgshwa", - "dataalpbuxwgipwhon", - "bin", - "datakix")), - new OperationInner() - .withName("pu") - .withDisplay( - new OperationDisplay() - .withProvider("rywn") - .withResource("oqftiyqzrnkcq") - .withOperation("xlwhzlsicoh") - .withDescription("qnwvlrya")) - .withOrigin("hheunmmqhgyx") - .withProperties(mapOf("koklya", "datanoc", "ewrmjmwvvjektc", "datauconuqszfkbey")), - new OperationInner() - .withName("enhwlrs") - .withDisplay( - new OperationDisplay() - .withProvider("zpwv") - .withResource("dqgbiqylihkaetc") - .withOperation("vfcivfsnkymuc") - .withDescription("hjfbebrjcxe")) - .withOrigin("uwutttxfvjrbi") - .withProperties( - mapOf( - "jky", - "dataxepcyvahfn", - "ljyoxgvcltb", - "dataxjvuujqgidokg", - "bijhtxfvgxbf", - "datasncghkjeszz", - "ec", - "datamxnehmp")))) - .withNextLink("odebfqkkrbmpu"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("e", model.value().get(0).name()); - Assertions.assertEquals("onpc", model.value().get(0).display().provider()); - Assertions.assertEquals("ocohslkevleg", model.value().get(0).display().resource()); - Assertions.assertEquals("fbuhfmvfaxkffe", model.value().get(0).display().operation()); - Assertions.assertEquals("th", model.value().get(0).display().description()); - Assertions.assertEquals("m", model.value().get(0).origin()); - Assertions.assertEquals("odebfqkkrbmpu", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java deleted file mode 100644 index 1bbdb04b3b209..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"lmfmtdaay\",\"display\":{\"provider\":\"wvgpiohg\",\"resource\":\"rtfudxepxg\",\"operation\":\"agvrvmnpkuk\",\"description\":\"i\"},\"origin\":\"blxgwimf\",\"properties\":{\"kfoqreyfkzikfj\":\"datafjxwmsz\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lmfmtdaay", response.iterator().next().name()); - Assertions.assertEquals("wvgpiohg", response.iterator().next().display().provider()); - Assertions.assertEquals("rtfudxepxg", response.iterator().next().display().resource()); - Assertions.assertEquals("agvrvmnpkuk", response.iterator().next().display().operation()); - Assertions.assertEquals("i", response.iterator().next().display().description()); - Assertions.assertEquals("blxgwimf", response.iterator().next().origin()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java deleted file mode 100644 index 72b5c8c292b1d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupInner model = - BinaryData - .fromString( - "{\"properties\":{\"backupType\":\"hq\",\"completedTime\":\"2021-08-01T15:29:09Z\",\"source\":\"xpyb\"},\"id\":\"m\",\"name\":\"hmtzopbsphrup\",\"type\":\"dgs\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals("hq", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-01T15:29:09Z"), model.completedTime()); - Assertions.assertEquals("xpyb", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = - new ServerBackupInner() - .withBackupType("hq") - .withCompletedTime(OffsetDateTime.parse("2021-08-01T15:29:09Z")) - .withSource("xpyb"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals("hq", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-01T15:29:09Z"), model.completedTime()); - Assertions.assertEquals("xpyb", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java deleted file mode 100644 index 0cf5459cceaf3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"ufpo\",\"completedTime\":\"2021-04-30T22:33:15Z\",\"source\":\"zhwlrxy\"},\"id\":\"soqijg\",\"name\":\"dmbpazlobcufpdz\",\"type\":\"rbt\"},{\"properties\":{\"backupType\":\"jnqglhqgnu\",\"completedTime\":\"2021-07-08T13:35:12Z\",\"source\":\"jywif\"},\"id\":\"esaagdfm\",\"name\":\"lzl\",\"type\":\"j\"}],\"nextLink\":\"ifkwmrvktsizntoc\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals("ufpo", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T22:33:15Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("zhwlrxy", model.value().get(0).source()); - Assertions.assertEquals("ifkwmrvktsizntoc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model = - new ServerBackupListResult() - .withValue( - Arrays - .asList( - new ServerBackupInner() - .withBackupType("ufpo") - .withCompletedTime(OffsetDateTime.parse("2021-04-30T22:33:15Z")) - .withSource("zhwlrxy"), - new ServerBackupInner() - .withBackupType("jnqglhqgnu") - .withCompletedTime(OffsetDateTime.parse("2021-07-08T13:35:12Z")) - .withSource("jywif"))) - .withNextLink("ifkwmrvktsizntoc"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals("ufpo", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T22:33:15Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("zhwlrxy", model.value().get(0).source()); - Assertions.assertEquals("ifkwmrvktsizntoc", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java deleted file mode 100644 index cd806a62883ca..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupProperties model = - BinaryData - .fromString( - "{\"backupType\":\"bejhphoycmsxa\",\"completedTime\":\"2021-05-13T08:05:39Z\",\"source\":\"xbmtqioqjz\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals("bejhphoycmsxa", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T08:05:39Z"), model.completedTime()); - Assertions.assertEquals("xbmtqioqjz", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = - new ServerBackupProperties() - .withBackupType("bejhphoycmsxa") - .withCompletedTime(OffsetDateTime.parse("2021-05-13T08:05:39Z")) - .withSource("xbmtqioqjz"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals("bejhphoycmsxa", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T08:05:39Z"), model.completedTime()); - Assertions.assertEquals("xbmtqioqjz", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java deleted file mode 100644 index 6f8a67e08ad12..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapability; - -public final class ServerEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"gdtjixhbkuofqwey\",\"supportedStorageEditions\":[{\"name\":\"n\",\"minStorageSize\":8434389153088034755,\"maxStorageSize\":2875965285682114251,\"minBackupRetentionDays\":7243731363217682630,\"maxBackupRetentionDays\":6472421771400984812},{\"name\":\"vyvdcs\",\"minStorageSize\":6235593202680912824,\"maxStorageSize\":7516654710743281273,\"minBackupRetentionDays\":2423895035915397618,\"maxBackupRetentionDays\":6881995629612654838},{\"name\":\"f\",\"minStorageSize\":7992686920033217909,\"maxStorageSize\":2053372524556858368,\"minBackupRetentionDays\":3419349819786091531,\"maxBackupRetentionDays\":5856868160780933935}],\"supportedServerVersions\":[{\"name\":\"hcjrefovgmk\",\"supportedSkus\":[]},{\"name\":\"yyvxyqjpkcattpn\",\"supportedSkus\":[]},{\"name\":\"cczsq\",\"supportedSkus\":[]}]}") - .toObject(ServerEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerEditionCapability model = new ServerEditionCapability(); - model = BinaryData.fromObject(model).toObject(ServerEditionCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java deleted file mode 100644 index c2e592cc3d8e5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; -import org.junit.jupiter.api.Assertions; - -public final class ServerRestartParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerRestartParameter model = - BinaryData - .fromString("{\"restartWithFailover\":\"Enabled\",\"maxFailoverSeconds\":99630495}") - .toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); - Assertions.assertEquals(99630495, model.maxFailoverSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerRestartParameter model = - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(99630495); - model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); - Assertions.assertEquals(99630495, model.maxFailoverSeconds()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java deleted file mode 100644 index 1176483e8f9f0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapability; - -public final class ServerVersionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVersionCapability model = - BinaryData - .fromString( - "{\"name\":\"upfh\",\"supportedSkus\":[{\"name\":\"rpmopjmc\",\"vCores\":2395939551856044935,\"supportedIops\":6897678654981048180,\"supportedMemoryPerVCoreMB\":2263429425422948962},{\"name\":\"uaodsfcpk\",\"vCores\":4623800830468359424,\"supportedIops\":5484313845577670913,\"supportedMemoryPerVCoreMB\":6217574440199654297}]}") - .toObject(ServerVersionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapability model = new ServerVersionCapability(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java deleted file mode 100644 index a0faee8125b80..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().delete("d", "lvwiwubmwmbesl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java deleted file mode 100644 index 96e976fc73af2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersFailoverMockTests { - @Test - public void testFailover() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().failover("tbobz", "opcjwvnhd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java deleted file mode 100644 index 6712ef4602130..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersRestartMockTests { - @Test - public void testRestart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .servers() - .restart( - "d", - "mgxcxrslpm", - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(306696017), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java deleted file mode 100644 index 4d12a206aab71..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().start("egrpkhj", "niyqslui", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java deleted file mode 100644 index 71de8797f962e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().stop("pdggkzzlvm", "mpaxmodfvuefywsb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java deleted file mode 100644 index 5a2e0db4391ed..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapability; - -public final class SkuCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapability model = - BinaryData - .fromString( - "{\"name\":\"ydagfuaxbe\",\"vCores\":1834993457183141824,\"supportedIops\":13185464662023528,\"supportedMemoryPerVCoreMB\":6990871855215979529}") - .toObject(SkuCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability(); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java deleted file mode 100644 index a061351042016..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = - BinaryData.fromString("{\"name\":\"flnrosfqpteehzz\",\"tier\":\"MemoryOptimized\"}").toObject(Sku.class); - Assertions.assertEquals("flnrosfqpteehzz", model.name()); - Assertions.assertEquals(SkuTier.MEMORY_OPTIMIZED, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("flnrosfqpteehzz").withTier(SkuTier.MEMORY_OPTIMIZED); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("flnrosfqpteehzz", 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 deleted file mode 100644 index 6fae62de0a053..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.StorageEditionCapability; - -public final class StorageEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"mdajv\",\"minStorageSize\":5255504053671338528,\"maxStorageSize\":2854905185891703166,\"minBackupRetentionDays\":23708408550027881,\"maxBackupRetentionDays\":7342412992819459793}") - .toObject(StorageEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageEditionCapability model = new StorageEditionCapability(); - model = BinaryData.fromObject(model).toObject(StorageEditionCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java deleted file mode 100644 index 5abc1d5ab3f75..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import org.junit.jupiter.api.Assertions; - -public final class StorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Storage model = - BinaryData - .fromString( - "{\"storageSizeGB\":491677014,\"iops\":62079989,\"autoGrow\":\"Disabled\",\"storageSku\":\"sqwpgrjb\",\"autoIoScaling\":\"Disabled\"}") - .toObject(Storage.class); - Assertions.assertEquals(491677014, model.storageSizeGB()); - Assertions.assertEquals(62079989, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoIoScaling()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = - new Storage() - .withStorageSizeGB(491677014) - .withIops(62079989) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withAutoIoScaling(EnableStatusEnum.DISABLED); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(491677014, model.storageSizeGB()); - Assertions.assertEquals(62079989, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoIoScaling()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java deleted file mode 100644 index c76a64487da20..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkSubnetUsageParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - BinaryData - .fromString("{\"virtualNetworkResourceId\":\"dxwzywqsmbsurexi\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("dxwzywqsmbsurexi", model.virtualNetworkResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("dxwzywqsmbsurexi"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("dxwzywqsmbsurexi", model.virtualNetworkResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java deleted file mode 100644 index 2562abdbfb66b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; - -public final class VirtualNetworkSubnetUsageResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = - BinaryData - .fromString( - "{\"location\":\"ryocfsfksymdd\",\"subscriptionId\":\"tki\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"qyud\",\"usage\":9109127487678619771},{\"subnetName\":\"nbpoczvyifqrvkdv\",\"usage\":3055369044346357730},{\"subnetName\":\"mvvd\",\"usage\":5974315112474207956},{\"subnetName\":\"pnpulexxbczwtru\",\"usage\":960586706113241957}]}") - .toObject(VirtualNetworkSubnetUsageResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } -}