From 3a406bc4a36be15cd8d168b509ae37be4af7e7ef Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 31 Oct 2023 22:17:15 +0000 Subject: [PATCH] CodeGen from PR 26184 in Azure/azure-rest-api-specs New version 2023-10-01-preview release for DBForMySQL (#26184) * copy base folder * update version * add new features * update readme * fix go error --- .../CHANGELOG.md | 4 +- .../README.md | 19 +- .../SAMPLE.md | 316 ++++-- .../pom.xml | 3 +- .../mysqlflexibleserver/MySqlManager.java | 74 +- ...dvancedThreatProtectionSettingsClient.java | 162 ++++ .../LocationBasedCapabilitySetsClient.java | 69 ++ .../fluent/MySqlManagementClient.java | 30 +- .../fluent/OperationResultsClient.java | 42 + .../fluent/ServersMigrationsClient.java | 70 ++ .../models/AdvancedThreatProtectionInner.java | 105 ++ .../AdvancedThreatProtectionProperties.java | 86 ++ ...ancedThreatProtectionUpdateProperties.java | 63 ++ .../models/AzureADAdministratorInner.java | 4 +- .../models/BackupAndExportResponseInner.java | 26 +- .../fluent/models/CapabilityInner.java | 89 ++ .../fluent/models/CapabilityPropertiesV2.java | 78 ++ .../fluent/models/ConfigurationInner.java | 4 +- .../fluent/models/DatabaseInner.java | 4 +- .../fluent/models/FirewallRuleInner.java | 4 +- .../fluent/models/LogFileInner.java | 4 +- .../OperationStatusExtendedResultInner.java | 115 +++ .../PrivateEndpointConnectionProperties.java | 128 +++ .../fluent/models/ServerBackupInner.java | 4 +- .../fluent/models/ServerInner.java | 55 +- .../fluent/models/ServerProperties.java | 50 + .../AdvancedThreatProtectionImpl.java | 61 ++ ...cedThreatProtectionSettingsClientImpl.java | 899 ++++++++++++++++++ .../AdvancedThreatProtectionSettingsImpl.java | 111 +++ .../AzureADAdministratorsClientImpl.java | 16 +- .../BackupAndExportResponseImpl.java | 5 + .../BackupAndExportsClientImpl.java | 8 +- .../implementation/BackupsClientImpl.java | 12 +- .../implementation/CapabilityImpl.java | 76 ++ .../CheckNameAvailabilitiesClientImpl.java | 4 +- ...vailabilityWithoutLocationsClientImpl.java | 4 +- ...kVirtualNetworkSubnetUsagesClientImpl.java | 4 +- .../ConfigurationsClientImpl.java | 20 +- .../implementation/DatabasesClientImpl.java | 16 +- .../FirewallRulesClientImpl.java | 16 +- .../GetPrivateDnsZoneSuffixesClientImpl.java | 4 +- .../LocationBasedCapabilitiesClientImpl.java | 4 +- ...LocationBasedCapabilitySetsClientImpl.java | 470 +++++++++ .../LocationBasedCapabilitySetsImpl.java | 71 ++ .../implementation/LogFilesClientImpl.java | 4 +- .../MySqlManagementClientBuilder.java | 6 +- .../MySqlManagementClientImpl.java | 62 +- .../OperationResultsClientImpl.java | 211 ++++ .../implementation/OperationResultsImpl.java | 60 ++ .../OperationStatusExtendedResultImpl.java | 85 ++ .../implementation/OperationsClientImpl.java | 4 +- .../implementation/ReplicasClientImpl.java | 4 +- .../implementation/ServerImpl.java | 33 +- .../implementation/ServersClientImpl.java | 44 +- .../ServersMigrationsClientImpl.java | 311 ++++++ .../implementation/ServersMigrationsImpl.java | 53 ++ .../implementation/Utils.java | 22 +- .../models/AdvancedThreatProtection.java | 69 ++ .../AdvancedThreatProtectionForUpdate.java | 68 ++ .../AdvancedThreatProtectionListResult.java | 59 ++ .../models/AdvancedThreatProtectionName.java | 44 + ...ncedThreatProtectionProvisioningState.java | 54 ++ .../AdvancedThreatProtectionSettings.java | 107 +++ .../models/AdvancedThreatProtectionState.java | 47 + .../models/AzureADAdministrator.java | 17 +- .../models/BackupAndExportResponse.java | 10 +- .../models/BackupFormat.java | 6 +- .../models/Capability.java | 68 ++ .../models/CapabilitySetsList.java | 59 ++ .../models/Configuration.java | 13 +- .../mysqlflexibleserver/models/Database.java | 11 +- .../models/FirewallRule.java | 11 +- .../models/ImportSourceProperties.java | 130 +++ .../models/ImportSourceStorageType.java | 44 + .../models/LocationBasedCapabilitySets.java | 62 ++ .../mysqlflexibleserver/models/LogFile.java | 2 +- ...Identity.java => MySqlServerIdentity.java} | 14 +- .../models/{Sku.java => MySqlServerSku.java} | 26 +- .../models/OperationResults.java | 36 + .../models/OperationStatusExtendedResult.java | 93 ++ .../models/OperationStatusResult.java | 262 +++++ .../models/PrivateEndpoint.java | 39 + .../models/PrivateEndpointConnection.java | 128 +++ ...teEndpointConnectionProvisioningState.java | 54 ++ ...rivateEndpointServiceConnectionStatus.java | 51 + .../PrivateLinkServiceConnectionState.java | 106 +++ .../mysqlflexibleserver/models/Server.java | 77 +- .../models/ServerBackup.java | 2 +- .../models/ServerEditionCapabilityV2.java | 106 +++ .../models/ServerForUpdate.java | 12 +- .../models/ServerGtidSetParameter.java | 8 +- .../models/ServerSkuTier.java | 50 + .../models/ServerVersionCapabilityV2.java | 39 + .../models/ServersMigrations.java | 35 + .../models/SkuCapabilityV2.java | 115 +++ .../mysqlflexibleserver/models/SkuTier.java | 50 - .../proxy-config.json | 1 + .../reflect-config.json | 516 ++++++++++ ...cedThreatProtectionSettingsGetSamples.java | 29 + ...edThreatProtectionSettingsListSamples.java | 23 + ...ThreatProtectionSettingsUpdateSamples.java | 52 + ...ADAdministratorsCreateOrUpdateSamples.java | 2 +- .../AzureADAdministratorsDeleteSamples.java | 2 +- .../AzureADAdministratorsGetSamples.java | 2 +- ...reADAdministratorsListByServerSamples.java | 2 +- .../BackupAndExportCreateSamples.java | 2 +- .../BackupAndExportValidateBackupSamples.java | 2 +- .../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 | 2 +- .../generated/ConfigurationsGetSamples.java | 2 +- .../ConfigurationsListByServerSamples.java | 2 +- .../ConfigurationsUpdateSamples.java | 2 +- .../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 +- .../LocationBasedCapabilitySetGetSamples.java | 20 + ...LocationBasedCapabilitySetListSamples.java | 20 + .../LogFilesListByServerSamples.java | 2 +- .../generated/OperationResultsGetSamples.java | 23 + .../generated/OperationsListSamples.java | 2 +- .../ReplicasListByServerSamples.java | 2 +- .../generated/ServersCreateSamples.java | 23 +- .../generated/ServersDeleteSamples.java | 2 +- .../generated/ServersFailoverSamples.java | 2 +- .../ServersGetByResourceGroupSamples.java | 4 +- .../ServersListByResourceGroupSamples.java | 2 +- .../generated/ServersListSamples.java | 2 +- ...rversMigrationCutoverMigrationSamples.java | 21 + .../generated/ServersResetGtidSamples.java | 2 +- .../generated/ServersRestartSamples.java | 2 +- .../generated/ServersStartSamples.java | 2 +- .../generated/ServersStopSamples.java | 2 +- .../generated/ServersUpdateSamples.java | 13 +- .../AdministratorListResultTests.java | 52 - .../AdministratorPropertiesTests.java | 43 - .../AzureADAdministratorInnerTests.java | 43 - ...AdministratorsCreateOrUpdateMockTests.java | 82 -- .../AzureADAdministratorsDeleteMockTests.java | 68 -- ...dministratorsGetWithResponseMockTests.java | 77 -- ...ADAdministratorsListByServerMockTests.java | 73 -- .../BackupAndExportRequestTests.java | 39 - .../BackupAndExportResponseInnerTests.java | 50 - ...ackupAndExportResponsePropertiesTests.java | 36 - .../BackupAndExportsCreateMockTests.java | 87 -- ...tsValidateBackupWithResponseMockTests.java | 69 -- .../generated/BackupRequestBaseTests.java | 35 - .../generated/BackupSettingsTests.java | 31 - .../generated/BackupStoreDetailsTests.java | 22 - .../generated/BackupTests.java | 32 - .../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 | 36 - .../generated/ConfigurationInnerTests.java | 37 - .../ConfigurationListForBatchUpdateTests.java | 54 -- .../ConfigurationListResultInnerTests.java | 50 - .../ConfigurationPropertiesTests.java | 37 - .../ConfigurationsBatchUpdateMockTests.java | 83 -- ...ConfigurationsCreateOrUpdateMockTests.java | 77 -- ...onfigurationsGetWithResponseMockTests.java | 73 -- .../ConfigurationsListByServerMockTests.java | 80 -- .../generated/DatabaseInnerTests.java | 30 - .../generated/DatabaseListResultTests.java | 41 - .../generated/DatabasePropertiesTests.java | 27 - .../DatabasesCreateOrUpdateMockTests.java | 74 -- .../generated/DatabasesDeleteMockTests.java | 61 -- .../DatabasesGetWithResponseMockTests.java | 71 -- .../DatabasesListByServerMockTests.java | 69 -- .../generated/DelegatedSubnetUsageTests.java | 24 - .../generated/FirewallRuleInnerTests.java | 30 - .../FirewallRuleListResultTests.java | 42 - .../FirewallRulePropertiesTests.java | 30 - .../FirewallRulesCreateOrUpdateMockTests.java | 74 -- .../FirewallRulesDeleteMockTests.java | 61 -- ...FirewallRulesGetWithResponseMockTests.java | 71 -- .../FirewallRulesListByServerMockTests.java | 69 -- .../FullBackupStoreDetailsTests.java | 30 - ...rivateDnsZoneSuffixResponseInnerTests.java | 28 - ...eSuffixesExecuteWithResponseMockTests.java | 66 -- .../generated/HighAvailabilityTests.java | 32 - .../generated/IdentityTests.java | 45 - ...ocationBasedCapabilitiesListMockTests.java | 65 -- .../generated/LogFileInnerTests.java | 43 - .../generated/LogFileListResultTests.java | 52 - .../generated/LogFilePropertiesTests.java | 43 - .../LogFilesListByServerMockTests.java | 73 -- .../generated/MaintenanceWindowTests.java | 39 - .../generated/NameAvailabilityInnerTests.java | 32 - .../NameAvailabilityRequestTests.java | 29 - .../generated/NetworkTests.java | 37 - .../generated/OperationDisplayTests.java | 39 - .../generated/OperationInnerTests.java | 71 -- .../generated/OperationListResultTests.java | 110 --- .../generated/OperationsListMockTests.java | 72 -- .../generated/ServerBackupInnerTests.java | 37 - .../ServerBackupListResultTests.java | 58 -- .../ServerBackupPropertiesTests.java | 37 - .../ServerEditionCapabilityTests.java | 25 - .../ServerGtidSetParameterTests.java | 25 - .../ServerRestartParameterTests.java | 33 - .../ServerVersionCapabilityTests.java | 25 - .../generated/ServersDeleteMockTests.java | 61 -- .../generated/ServersFailoverMockTests.java | 61 -- .../generated/ServersResetGtidMockTests.java | 68 -- .../generated/ServersRestartMockTests.java | 71 -- .../generated/ServersStartMockTests.java | 61 -- .../generated/ServersStopMockTests.java | 61 -- .../generated/SkuCapabilityTests.java | 25 - .../generated/SkuTests.java | 27 - .../StorageEditionCapabilityTests.java | 25 - .../generated/StorageTests.java | 43 - .../ValidateBackupResponseInnerTests.java | 27 - ...ValidateBackupResponsePropertiesTests.java | 28 - ...rtualNetworkSubnetUsageParameterTests.java | 28 - ...ualNetworkSubnetUsageResultInnerTests.java | 25 - 234 files changed, 6958 insertions(+), 4767 deletions(-) create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java rename sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/{Identity.java => MySqlServerIdentity.java} (86%) rename sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/{Sku.java => MySqlServerSku.java} (71%) create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/reflect-config.json create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationResultsGetSamples.java create mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersMigrationCutoverMigrationSamples.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/BackupAndExportRequestTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.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/ConfigurationsCreateOrUpdateMockTests.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/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/FullBackupStoreDetailsTests.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/ServerGtidSetParameterTests.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/ServersResetGtidMockTests.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/ValidateBackupResponseInnerTests.java delete mode 100644 sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.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 4247a55257534..751f8efe20dd1 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.1 (2023-10-31) + +- Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-10-01-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 abb17754c844e..7500f508cfd53 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md @@ -2,7 +2,7 @@ Azure Resource Manager MySql client library for Java. -This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2022-09-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-10-01-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.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -74,6 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +server = mysqlManager.servers() + .define(serverName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withAdministratorLogin(adminName) + .withAdministratorLoginPassword(adminPwd) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md) @@ -94,7 +103,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty @@ -103,3 +112,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fmysqlflexibleserver%2Fazure-resourcemanager-mysqlflexibleserver%2FREADME.png) diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md index 94e5f8ab17bf5..9c8ccee18f370 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md @@ -1,6 +1,12 @@ # Code snippets and samples +## AdvancedThreatProtectionSettings + +- [Get](#advancedthreatprotectionsettings_get) +- [List](#advancedthreatprotectionsettings_list) +- [Update](#advancedthreatprotectionsettings_update) + ## AzureADAdministrators - [CreateOrUpdate](#azureadadministrators_createorupdate) @@ -61,10 +67,19 @@ - [List](#locationbasedcapabilities_list) +## LocationBasedCapabilitySet + +- [Get](#locationbasedcapabilityset_get) +- [List](#locationbasedcapabilityset_list) + ## LogFiles - [ListByServer](#logfiles_listbyserver) +## OperationResults + +- [Get](#operationresults_get) + ## Operations - [List](#operations_list) @@ -86,6 +101,111 @@ - [Start](#servers_start) - [Stop](#servers_stop) - [Update](#servers_update) + +## ServersMigration + +- [CutoverMigration](#serversmigration_cutovermigration) +### AdvancedThreatProtectionSettings_Get + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; + +/** Samples for AdvancedThreatProtectionSettings Get. */ +public final class AdvancedThreatProtectionSettingsGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsGet.json + */ + /** + * Sample code: Get a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .getWithResponse( + "threatprotection-6852", + "threatprotection-2080", + AdvancedThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} +``` + +### AdvancedThreatProtectionSettings_List + +```java +/** Samples for AdvancedThreatProtectionSettings List. */ +public final class AdvancedThreatProtectionSettingsListSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsList.json + */ + /** + * Sample code: Get list of server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getListOfServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .list("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); + } +} +``` + +### AdvancedThreatProtectionSettings_Update + +```java +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; + +/** Samples for AdvancedThreatProtectionSettings Update. */ +public final class AdvancedThreatProtectionSettingsUpdateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsPatchDisabled.json + */ + /** + * Sample code: Disable a server's Advanced Threat Protection settings with all parameters. + * + * @param manager Entry point to MySqlManager. + */ + public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParameters( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .update( + "threatprotection-4799", + "threatprotection-6440", + AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsPatchEnabled.json + */ + /** + * Sample code: Enable a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void enableAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .update( + "threatprotection-4799", + "threatprotection-6440", + AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), + com.azure.core.util.Context.NONE); + } +} +``` + ### AzureADAdministrators_CreateOrUpdate ```java @@ -95,7 +215,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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorCreate.json */ /** * Sample code: Create an azure ad administrator. @@ -127,7 +247,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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorDelete.json */ /** * Sample code: Delete an azure ad administrator. @@ -151,7 +271,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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorGet.json */ /** * Sample code: Get an azure ad administrator. @@ -173,7 +293,7 @@ public final class AzureADAdministratorsGetSamples { /** Samples for AzureADAdministrators ListByServer. */ public final class AzureADAdministratorsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorsListByServer.json */ /** * Sample code: List Azure AD administrators in a server. @@ -198,7 +318,7 @@ 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupAndExport.json */ /** * Sample code: Create and Export Backup. @@ -226,7 +346,7 @@ public final class BackupAndExportCreateSamples { /** 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/ValidateBackup.json */ /** * Sample code: Validate Backup. @@ -247,7 +367,7 @@ public final class BackupAndExportValidateBackupSamples { /** Samples for Backups Get. */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. @@ -268,7 +388,7 @@ public final class BackupsGetSamples { /** Samples for Backups ListByServer. */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupsListByServer.json */ /** * Sample code: List backups for a server. @@ -287,7 +407,7 @@ public final class BackupsListByServerSamples { /** Samples for Backups Put. */ public final class BackupsPutSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupPut.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupPut.json */ /** * Sample code: Create backup for a server. @@ -308,7 +428,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/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ /** * Sample code: Check name availability. @@ -334,7 +454,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/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ /** * Sample code: Check name availability. @@ -359,7 +479,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/ServiceOperations/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CheckVirtualNetworkSubnetUsage.json */ /** * Sample code: CheckVirtualNetworkSubnetUsage. @@ -391,7 +511,7 @@ import java.util.Arrays; /** Samples for Configurations BatchUpdate. */ public final class ConfigurationsBatchUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsBatchUpdate.json */ /** * Sample code: ConfigurationList. @@ -424,7 +544,7 @@ 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationCreateOrUpdate.json */ /** * Sample code: ConfigurationCreateOrUpdate. @@ -449,7 +569,7 @@ public final class ConfigurationsCreateOrUpdateSamples { /** Samples for Configurations Get. */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationGet.json */ /** * Sample code: Get a configuration. @@ -470,7 +590,7 @@ public final class ConfigurationsGetSamples { /** Samples for Configurations ListByServer. */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsListByServer.json */ /** * Sample code: List all configurations for a server. @@ -495,7 +615,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; /** Samples for Configurations Update. */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. @@ -519,7 +639,7 @@ public final class ConfigurationsUpdateSamples { /** Samples for Databases CreateOrUpdate. */ public final class DatabasesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabaseCreate.json */ /** * Sample code: Create a database. @@ -544,7 +664,7 @@ public final class DatabasesCreateOrUpdateSamples { /** Samples for Databases Delete. */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabaseDelete.json */ /** * Sample code: Delete a database. @@ -563,7 +683,7 @@ public final class DatabasesDeleteSamples { /** Samples for Databases Get. */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabaseGet.json */ /** * Sample code: Get a database. @@ -582,7 +702,7 @@ public final class DatabasesGetSamples { /** Samples for Databases ListByServer. */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ /** * Sample code: List databases in a server. @@ -601,7 +721,7 @@ public final class DatabasesListByServerSamples { /** Samples for FirewallRules CreateOrUpdate. */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ /** * Sample code: Create a firewall rule. @@ -626,7 +746,7 @@ public final class FirewallRulesCreateOrUpdateSamples { /** Samples for FirewallRules Delete. */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleDelete.json */ /** * Sample code: Delete a firewall rule. @@ -645,7 +765,7 @@ public final class FirewallRulesDeleteSamples { /** Samples for FirewallRules Get. */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleGet.json */ /** * Sample code: Get a firewall rule. @@ -664,7 +784,7 @@ public final class FirewallRulesGetSamples { /** Samples for FirewallRules ListByServer. */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRulesListByServer.json */ /** * Sample code: List all firewall rules in a server. @@ -684,7 +804,7 @@ public final class FirewallRulesListByServerSamples { /** Samples for GetPrivateDnsZoneSuffix Execute. */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json */ /** * Sample code: GetPrivateDnsZoneSuffix. @@ -703,7 +823,7 @@ public final class GetPrivateDnsZoneSuffixExecuteSamples { /** Samples for LocationBasedCapabilities List. */ public final class LocationBasedCapabilitiesListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitiesByLocationList.json */ /** * Sample code: CapabilitiesList. @@ -716,13 +836,51 @@ public final class LocationBasedCapabilitiesListSamples { } ``` +### LocationBasedCapabilitySet_Get + +```java +/** Samples for LocationBasedCapabilitySet Get. */ +public final class LocationBasedCapabilitySetGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitySetByLocation.json + */ + /** + * Sample code: CapabilityResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilityResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().getWithResponse("WestUS", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### LocationBasedCapabilitySet_List + +```java +/** Samples for LocationBasedCapabilitySet List. */ +public final class LocationBasedCapabilitySetListSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitySetListByLocation.json + */ + /** + * Sample code: CapabilitySetsResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilitySetsResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().list("WestUS", com.azure.core.util.Context.NONE); + } +} +``` + ### LogFiles_ListByServer ```java /** Samples for LogFiles ListByServer. */ public final class LogFilesListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2023-06-01-preview/examples/LogFilesListByServer.json */ /** * Sample code: List all server log files for a server. @@ -736,13 +894,35 @@ public final class LogFilesListByServerSamples { } ``` +### OperationResults_Get + +```java +/** Samples for OperationResults Get. */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/OperationResults_Get.json + */ + /** + * Sample code: OperationResults_Get. + * + * @param manager Entry point to MySqlManager. + */ + public static void operationResultsGet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .operationResults() + .getWithResponse( + "westus", "resource-provisioning-id-farmBeatsResourceName", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/OperationsList.json */ /** * Sample code: OperationList. @@ -761,7 +941,7 @@ public final class OperationsListSamples { /** Samples for Replicas ListByServer. */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ReplicasListByServer.json */ /** * Sample code: List replicas for a server. @@ -786,11 +966,11 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; @@ -800,7 +980,7 @@ import java.util.Map; /** Samples for Servers Create. */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreateReplica.json */ /** * Sample code: Create a replica server. @@ -820,7 +1000,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -834,7 +1014,7 @@ public final class ServersCreateSamples { .withRegion("southeastasia") .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) - .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) @@ -848,7 +1028,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreateWithBYOK.json */ /** * Sample code: Create a server with byok. @@ -864,7 +1044,7 @@ public final class ServersCreateSamples { .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) .withIdentity( - new Identity() + new MySqlServerIdentity() .withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities( mapOf( @@ -872,7 +1052,7 @@ public final class ServersCreateSamples { SerializerFactory .createDefaultManagementSerializerAdapter() .deserialize("{}", Object.class, SerializerEncoding.JSON)))) - .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) @@ -895,7 +1075,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreateWithPointInTimeRestore.json */ /** * Sample code: Create a server as a point in time restore. @@ -910,7 +1090,7 @@ public final class ServersCreateSamples { .withRegion("SoutheastAsia") .withExistingResourceGroup("TargetResourceGroup") .withTags(mapOf("num", "1")) - .withSku(new Sku().withName("Standard_D14_v2").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE)) .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver") @@ -918,6 +1098,7 @@ public final class ServersCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -937,7 +1118,7 @@ public final class ServersCreateSamples { /** Samples for Servers Delete. */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerDelete.json */ /** * Sample code: Delete a server. @@ -956,7 +1137,7 @@ public final class ServersDeleteSamples { /** Samples for Servers Failover. */ public final class ServersFailoverSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerFailover.json */ /** * Sample code: Restart a server. @@ -975,7 +1156,7 @@ public final class ServersFailoverSamples { /** Samples for Servers GetByResourceGroup. */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerGetWithVnet.json */ /** * Sample code: Get a server with vnet. @@ -987,7 +1168,7 @@ public final class ServersGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerGet.json */ /** * Sample code: Get a server. @@ -1006,7 +1187,7 @@ public final class ServersGetByResourceGroupSamples { /** Samples for Servers List. */ public final class ServersListSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServersList.json */ /** * Sample code: List servers in a subscription. @@ -1025,7 +1206,7 @@ public final class ServersListSamples { /** Samples for Servers ListByResourceGroup. */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServersListByResourceGroup.json */ /** * Sample code: List servers in a resource group. @@ -1046,7 +1227,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParamet /** 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerResetGtid.json */ /** * Sample code: Reset GTID on a server. @@ -1074,7 +1255,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/FlexibleServers/preview/2022-09-30-preview/examples/ServerRestart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerRestart.json */ /** * Sample code: Restart a server. @@ -1101,7 +1282,7 @@ public final class ServersRestartSamples { /** Samples for Servers Start. */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerStart.json */ /** * Sample code: Start a server. @@ -1120,7 +1301,7 @@ public final class ServersStartSamples { /** Samples for Servers Stop. */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStop.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerStop.json */ /** * Sample code: Stop a server. @@ -1141,9 +1322,10 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; +import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -1153,7 +1335,7 @@ import java.util.Map; /** Samples for Servers Update. */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: Update server customer maintenance window. @@ -1179,7 +1361,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerUpdateWithBYOK.json */ /** * Sample code: Update server with byok. @@ -1196,7 +1378,7 @@ public final class ServersUpdateSamples { resource .update() .withIdentity( - new Identity() + new MySqlServerIdentity() .withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities( mapOf( @@ -1217,7 +1399,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerUpdate.json */ /** * Sample code: Update a server. @@ -1238,9 +1420,11 @@ public final class ServersUpdateSamples { .withIops(200) .withAutoGrow(EnableStatusEnum.DISABLED) .withAutoIoScaling(EnableStatusEnum.DISABLED)) + .withNetwork(new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1254,3 +1438,23 @@ public final class ServersUpdateSamples { } ``` +### ServersMigration_CutoverMigration + +```java +/** Samples for ServersMigration CutoverMigration. */ +public final class ServersMigrationCutoverMigrationSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/CutoverMigration.json + */ + /** + * Sample code: Cutover migration for MySQL import. + * + * @param manager Entry point to MySqlManager. + */ + public static void cutoverMigrationForMySQLImport( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.serversMigrations().cutoverMigration("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml index 7f20db0bda0c7..efb941cefab0a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for MySql Management - This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2022-09-30-preview. + This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-10-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true 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 11ce7bccb1098..935d37dfc5f31 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java @@ -24,6 +24,7 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.AdvancedThreatProtectionSettingsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsImpl; @@ -35,11 +36,15 @@ import com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitySetsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.LogFilesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationResultsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersImpl; +import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersMigrationsImpl; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; import com.azure.resourcemanager.mysqlflexibleserver.models.Backups; @@ -51,10 +56,13 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRules; import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixes; import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilities; +import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; import com.azure.resourcemanager.mysqlflexibleserver.models.LogFiles; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; import com.azure.resourcemanager.mysqlflexibleserver.models.Operations; import com.azure.resourcemanager.mysqlflexibleserver.models.Replicas; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -84,20 +92,28 @@ public final class MySqlManager { private Replicas replicas; + private ServersMigrations serversMigrations; + private LogFiles logFiles; private LocationBasedCapabilities locationBasedCapabilities; + private LocationBasedCapabilitySets locationBasedCapabilitySets; + private CheckVirtualNetworkSubnetUsages checkVirtualNetworkSubnetUsages; private CheckNameAvailabilities checkNameAvailabilities; private CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocations; + private OperationResults operationResults; + private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; private Operations operations; + private AdvancedThreatProtectionSettings advancedThreatProtectionSettings; + private final MySqlManagementClient clientObject; private MySqlManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -263,7 +279,7 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.mysqlflexibleserver") .append("/") - .append("1.0.0-beta.4"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -416,6 +432,18 @@ public Replicas replicas() { return replicas; } + /** + * Gets the resource collection API of ServersMigrations. + * + * @return Resource collection API of ServersMigrations. + */ + public ServersMigrations serversMigrations() { + if (this.serversMigrations == null) { + this.serversMigrations = new ServersMigrationsImpl(clientObject.getServersMigrations(), this); + } + return serversMigrations; + } + /** * Gets the resource collection API of LogFiles. * @@ -441,6 +469,19 @@ public LocationBasedCapabilities locationBasedCapabilities() { return locationBasedCapabilities; } + /** + * Gets the resource collection API of LocationBasedCapabilitySets. + * + * @return Resource collection API of LocationBasedCapabilitySets. + */ + public LocationBasedCapabilitySets locationBasedCapabilitySets() { + if (this.locationBasedCapabilitySets == null) { + this.locationBasedCapabilitySets = + new LocationBasedCapabilitySetsImpl(clientObject.getLocationBasedCapabilitySets(), this); + } + return locationBasedCapabilitySets; + } + /** * Gets the resource collection API of CheckVirtualNetworkSubnetUsages. * @@ -481,6 +522,18 @@ public CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocatio return checkNameAvailabilityWithoutLocations; } + /** + * Gets the resource collection API of OperationResults. + * + * @return Resource collection API of OperationResults. + */ + public OperationResults operationResults() { + if (this.operationResults == null) { + this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); + } + return operationResults; + } + /** * Gets the resource collection API of GetPrivateDnsZoneSuffixes. * @@ -507,8 +560,23 @@ public Operations operations() { } /** - * @return Wrapped service client MySqlManagementClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets the resource collection API of AdvancedThreatProtectionSettings. + * + * @return Resource collection API of AdvancedThreatProtectionSettings. + */ + public AdvancedThreatProtectionSettings advancedThreatProtectionSettings() { + if (this.advancedThreatProtectionSettings == null) { + this.advancedThreatProtectionSettings = + new AdvancedThreatProtectionSettingsImpl(clientObject.getAdvancedThreatProtectionSettings(), this); + } + return advancedThreatProtectionSettings; + } + + /** + * Gets wrapped service client MySqlManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client MySqlManagementClient. */ public MySqlManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java new file mode 100644 index 0000000000000..47f71192b577a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; + +/** + * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionSettingsClient. + */ +public interface AdvancedThreatProtectionSettingsClient { + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + Context context); + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner get( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdvancedThreatProtectionInner update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java new file mode 100644 index 0000000000000..65aa6ba456445 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; + +/** An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. */ +public interface LocationBasedCapabilitySetsClient { + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName, Context context); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, String capabilitySetName, Context context); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityInner get(String locationName, String capabilitySetName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java index 0ce57fc33beb5..06a1189d3ab06 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java @@ -10,7 +10,7 @@ /** The interface for MySqlManagementClient class. */ public interface MySqlManagementClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -93,6 +93,13 @@ public interface MySqlManagementClient { */ ReplicasClient getReplicas(); + /** + * Gets the ServersMigrationsClient object to access its operations. + * + * @return the ServersMigrationsClient object. + */ + ServersMigrationsClient getServersMigrations(); + /** * Gets the LogFilesClient object to access its operations. * @@ -107,6 +114,13 @@ public interface MySqlManagementClient { */ LocationBasedCapabilitiesClient getLocationBasedCapabilities(); + /** + * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * + * @return the LocationBasedCapabilitySetsClient object. + */ + LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets(); + /** * Gets the CheckVirtualNetworkSubnetUsagesClient object to access its operations. * @@ -128,6 +142,13 @@ public interface MySqlManagementClient { */ CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWithoutLocations(); + /** + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. + */ + OperationResultsClient getOperationResults(); + /** * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. * @@ -141,4 +162,11 @@ public interface MySqlManagementClient { * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * + * @return the AdvancedThreatProtectionSettingsClient object. + */ + AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java new file mode 100644 index 0000000000000..237c00ea9d755 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; + +/** An instance of this class provides access to all the operations defined in OperationResultsClient. */ +public interface OperationResultsClient { + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String locationName, String operationId, Context context); + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusExtendedResultInner get(String locationName, String operationId); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java new file mode 100644 index 0000000000000..3f7ca9cccd112 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; + +/** An instance of this class provides access to all the operations defined in ServersMigrationsClient. */ +public interface ServersMigrationsClient { + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerInner> beginCutoverMigration( + String resourceGroupName, String serverName, Context context); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerInner cutoverMigration(String resourceGroupName, String serverName); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java new file mode 100644 index 0000000000000..cf50b2e282939 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A server's Advanced Threat Protection. */ +@Fluent +public final class AdvancedThreatProtectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private AdvancedThreatProtectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AdvancedThreatProtectionInner class. */ + public AdvancedThreatProtectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private AdvancedThreatProtectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionInner object itself. + */ + public AdvancedThreatProtectionInner withState(AdvancedThreatProtectionState state) { + if (this.innerProperties() == null) { + this.innerProperties = new AdvancedThreatProtectionProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Threat Protection. + * + * @return the provisioningState value. + */ + public AdvancedThreatProtectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java new file mode 100644 index 0000000000000..3850977f03a96 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an Advanced Threat Protection setting. */ +@Fluent +public final class AdvancedThreatProtectionProperties { + /* + * Specifies the UTC creation time of the policy. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been + * applied yet on the specific database or server. + */ + @JsonProperty(value = "state") + private AdvancedThreatProtectionState state; + + /* + * Provisioning state of the Threat Protection. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AdvancedThreatProtectionProvisioningState provisioningState; + + /** Creates an instance of AdvancedThreatProtectionProperties class. */ + public AdvancedThreatProtectionProperties() { + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionProperties object itself. + */ + public AdvancedThreatProtectionProperties withState(AdvancedThreatProtectionState state) { + this.state = state; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Threat Protection. + * + * @return the provisioningState value. + */ + public AdvancedThreatProtectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java new file mode 100644 index 0000000000000..b6f31461690d0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Advanced Threat Protection that can be updated. */ +@Fluent +public final class AdvancedThreatProtectionUpdateProperties { + /* + * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been + * applied yet on the specific database or server. + */ + @JsonProperty(value = "state", required = true) + private AdvancedThreatProtectionState state; + + /** Creates an instance of AdvancedThreatProtectionUpdateProperties class. */ + public AdvancedThreatProtectionUpdateProperties() { + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionUpdateProperties object itself. + */ + public AdvancedThreatProtectionUpdateProperties withState(AdvancedThreatProtectionState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property state in model AdvancedThreatProtectionUpdateProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionUpdateProperties.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java index 8903f56b030d6..f5e3e16e0a2ca 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java @@ -20,7 +20,7 @@ public final class AzureADAdministratorInner extends ProxyResource { private AdministratorProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -39,7 +39,7 @@ private AdministratorProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ 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 index 0a0e178a7ee53..919f9588d284b 100644 --- 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; import com.fasterxml.jackson.annotation.JsonProperty; @@ -45,9 +46,13 @@ public final class BackupAndExportResponseInner extends ProxyResource { private BackupAndExportResponseProperties innerProperties; /* - * Error Response - * - * The BackupAndExport operation error response. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The error object. */ @JsonProperty(value = "error") private ManagementError error; @@ -146,9 +151,16 @@ private BackupAndExportResponseProperties innerProperties() { } /** - * Get the error property: Error Response + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - *

The BackupAndExport operation error response. + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the error property: The error object. * * @return the error value. */ @@ -157,9 +169,7 @@ public ManagementError error() { } /** - * Set the error property: Error Response - * - *

The BackupAndExport operation error response. + * Set the error property: The error object. * * @param error the error value to set. * @return the BackupAndExportResponseInner object itself. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java new file mode 100644 index 0000000000000..33d6206480224 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a location capability set. */ +@Immutable +public final class CapabilityInner extends ProxyResource { + /* + * The properties of a location capability set. + */ + @JsonProperty(value = "properties") + private CapabilityPropertiesV2 innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CapabilityInner class. */ + public CapabilityInner() { + } + + /** + * Get the innerProperties property: The properties of a location capability set. + * + * @return the innerProperties value. + */ + private CapabilityPropertiesV2 innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the supportedGeoBackupRegions property: supported geo backup regions. + * + * @return the supportedGeoBackupRegions value. + */ + public List supportedGeoBackupRegions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedGeoBackupRegions(); + } + + /** + * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. + * + * @return the supportedFlexibleServerEditions value. + */ + public List supportedFlexibleServerEditions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedFlexibleServerEditions(); + } + + /** + * Get the supportedServerVersions property: A list of supported server versions. + * + * @return the supportedServerVersions value. + */ + public List supportedServerVersions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedServerVersions(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java new file mode 100644 index 0000000000000..8295fd21bffa8 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Location capability. */ +@Immutable +public final class CapabilityPropertiesV2 { + /* + * supported geo backup regions + */ + @JsonProperty(value = "supportedGeoBackupRegions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedGeoBackupRegions; + + /* + * A list of supported flexible server editions. + */ + @JsonProperty(value = "supportedFlexibleServerEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedFlexibleServerEditions; + + /* + * A list of supported server versions. + */ + @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedServerVersions; + + /** Creates an instance of CapabilityPropertiesV2 class. */ + public CapabilityPropertiesV2() { + } + + /** + * Get the supportedGeoBackupRegions property: supported geo backup regions. + * + * @return the supportedGeoBackupRegions value. + */ + public List supportedGeoBackupRegions() { + return this.supportedGeoBackupRegions; + } + + /** + * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. + * + * @return the supportedFlexibleServerEditions value. + */ + public List supportedFlexibleServerEditions() { + return this.supportedFlexibleServerEditions; + } + + /** + * Get the supportedServerVersions property: A list of supported server versions. + * + * @return the supportedServerVersions value. + */ + public List supportedServerVersions() { + return this.supportedServerVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedFlexibleServerEditions() != null) { + supportedFlexibleServerEditions().forEach(e -> e.validate()); + } + if (supportedServerVersions() != null) { + supportedServerVersions().forEach(e -> e.validate()); + } + } +} 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 4357c0385ca3b..7ae574543cccd 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 @@ -23,7 +23,7 @@ public final class ConfigurationInner extends ProxyResource { private ConfigurationProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -42,7 +42,7 @@ private ConfigurationProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java index 5e05985e128cc..79d6d97cb8cdf 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/DatabaseInner.java @@ -19,7 +19,7 @@ public final class DatabaseInner extends ProxyResource { private DatabaseProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -38,7 +38,7 @@ private DatabaseProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java index 89fb5eb8a2804..a2074b6ae73b2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/FirewallRuleInner.java @@ -20,7 +20,7 @@ public final class FirewallRuleInner extends ProxyResource { private FirewallRuleProperties innerProperties = new FirewallRuleProperties(); /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -39,7 +39,7 @@ private FirewallRuleProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java index 511bd0fe65b31..727e90ad3b3aa 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java @@ -20,7 +20,7 @@ public final class LogFileInner extends ProxyResource { private LogFileProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -39,7 +39,7 @@ private LogFileProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java new file mode 100644 index 0000000000000..09dcbe2b4c7c0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents Operation Results API Response. */ +@Fluent +public final class OperationStatusExtendedResultInner extends OperationStatusResult { + /* + * The extended properties of Operation Results + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /** Creates an instance of OperationStatusExtendedResultInner class. */ + public OperationStatusExtendedResultInner() { + } + + /** + * Get the properties property: The extended properties of Operation Results. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: The extended properties of Operation Results. + * + * @param properties the properties value to set. + * @return the OperationStatusExtendedResultInner object itself. + */ + public OperationStatusExtendedResultInner withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withPercentComplete(Float percentComplete) { + super.withPercentComplete(percentComplete); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withOperations(List operations) { + super.withOperations(operations); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusExtendedResultInner withError(ManagementError error) { + super.withError(error); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..168998f51dd8b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The group ids for the private endpoint resource. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /* + * The private endpoint resource. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java index 207507edf9979..0285f8298b7f5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java @@ -20,7 +20,7 @@ public final class ServerBackupInner extends ProxyResource { private ServerBackupProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -39,7 +39,7 @@ private ServerBackupProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java index c413157dccf5a..0a774e9d742fd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java @@ -11,16 +11,19 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; +import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Represents a server. */ @@ -30,13 +33,13 @@ public final class ServerInner extends Resource { * The cmk identity for the server. */ @JsonProperty(value = "identity") - private Identity identity; + private MySqlServerIdentity identity; /* * The SKU (pricing tier) of the server. */ @JsonProperty(value = "sku") - private Sku sku; + private MySqlServerSku sku; /* * Properties of the server. @@ -45,7 +48,7 @@ public final class ServerInner extends Resource { private ServerProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -59,7 +62,7 @@ public ServerInner() { * * @return the identity value. */ - public Identity identity() { + public MySqlServerIdentity identity() { return this.identity; } @@ -69,7 +72,7 @@ public Identity identity() { * @param identity the identity value to set. * @return the ServerInner object itself. */ - public ServerInner withIdentity(Identity identity) { + public ServerInner withIdentity(MySqlServerIdentity identity) { this.identity = identity; return this; } @@ -79,7 +82,7 @@ public ServerInner withIdentity(Identity identity) { * * @return the sku value. */ - public Sku sku() { + public MySqlServerSku sku() { return this.sku; } @@ -89,7 +92,7 @@ public Sku sku() { * @param sku the sku value to set. * @return the ServerInner object itself. */ - public ServerInner withSku(Sku sku) { + public ServerInner withSku(MySqlServerSku sku) { this.sku = sku; return this; } @@ -104,7 +107,7 @@ private ServerProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -458,6 +461,15 @@ public ServerInner withNetwork(Network network) { return this; } + /** + * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -481,6 +493,29 @@ public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { return this; } + /** + * Get the importSourceProperties property: Source properties for import from storage. + * + * @return the importSourceProperties value. + */ + public ImportSourceProperties importSourceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().importSourceProperties(); + } + + /** + * Set the importSourceProperties property: Source properties for import from storage. + * + * @param importSourceProperties the importSourceProperties value to set. + * @return the ServerInner object itself. + */ + public ServerInner withImportSourceProperties(ImportSourceProperties importSourceProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); + } + this.innerProperties().withImportSourceProperties(importSourceProperties); + return this; + } + /** * Validates the instance. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java index 42bb3aaf094b1..fa5be895a5aea 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java @@ -9,14 +9,17 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; +import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; /** The properties of a server. */ @Fluent @@ -118,12 +121,24 @@ public final class ServerProperties { @JsonProperty(value = "network") private Network network; + /* + * PrivateEndpointConnections related properties of a server. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /* * Maintenance window of a server. */ @JsonProperty(value = "maintenanceWindow") private MaintenanceWindow maintenanceWindow; + /* + * Source properties for import from storage. + */ + @JsonProperty(value = "importSourceProperties") + private ImportSourceProperties importSourceProperties; + /** Creates an instance of ServerProperties class. */ public ServerProperties() { } @@ -421,6 +436,15 @@ public ServerProperties withNetwork(Network network) { return this; } + /** + * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -441,6 +465,26 @@ public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindo return this; } + /** + * Get the importSourceProperties property: Source properties for import from storage. + * + * @return the importSourceProperties value. + */ + public ImportSourceProperties importSourceProperties() { + return this.importSourceProperties; + } + + /** + * Set the importSourceProperties property: Source properties for import from storage. + * + * @param importSourceProperties the importSourceProperties value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withImportSourceProperties(ImportSourceProperties importSourceProperties) { + this.importSourceProperties = importSourceProperties; + return this; + } + /** * Validates the instance. * @@ -462,8 +506,14 @@ public void validate() { if (network() != null) { network().validate(); } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } if (maintenanceWindow() != null) { maintenanceWindow().validate(); } + if (importSourceProperties() != null) { + importSourceProperties().validate(); + } } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java new file mode 100644 index 0000000000000..c9eff5442a10d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; +import java.time.OffsetDateTime; + +public final class AdvancedThreatProtectionImpl implements AdvancedThreatProtection { + private AdvancedThreatProtectionInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + AdvancedThreatProtectionImpl( + AdvancedThreatProtectionInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public AdvancedThreatProtectionState state() { + return this.innerModel().state(); + } + + public AdvancedThreatProtectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public AdvancedThreatProtectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java new file mode 100644 index 0000000000000..4d787326756dc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java @@ -0,0 +1,899 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionListResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionSettingsClient. + */ +public final class AdvancedThreatProtectionSettingsClientImpl implements AdvancedThreatProtectionSettingsClient { + /** The proxy service used to perform REST calls. */ + private final AdvancedThreatProtectionSettingsService service; + + /** The service client containing this operation class. */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of AdvancedThreatProtectionSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AdvancedThreatProtectionSettingsClientImpl(MySqlManagementClientImpl client) { + this.service = + RestProxy + .create( + AdvancedThreatProtectionSettingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientAdvancedThreatProtectionSettings to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MySqlManagementClien") + public interface AdvancedThreatProtectionSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AdvancedThreatProtectionForUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (advancedThreatProtectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter advancedThreatProtectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serverName, + advancedThreatProtectionName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (advancedThreatProtectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter advancedThreatProtectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serverName, + advancedThreatProtectionName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { + return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + Context context) { + return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, context).block(); + } + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner get( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { + return getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, Context.NONE).getValue(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (advancedThreatProtectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter advancedThreatProtectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serverName, + advancedThreatProtectionName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (advancedThreatProtectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter advancedThreatProtectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serverName, + advancedThreatProtectionName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AdvancedThreatProtectionInner.class, + AdvancedThreatProtectionInner.class, + this.client.getContext()); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AdvancedThreatProtectionInner.class, + AdvancedThreatProtectionInner.class, + context); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + return this + .beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters) + .getSyncPoller(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + return updateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).block(); + } + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdvancedThreatProtectionInner update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context) { + return updateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).block(); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serverName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serverName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serverName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serverName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serverName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serverName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName) { + return new PagedIterable<>(listAsync(resourceGroupName, serverName)); + } + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's Advanced Threat Protection configurations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java new file mode 100644 index 0000000000000..bb850f234353f --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; + +public final class AdvancedThreatProtectionSettingsImpl implements AdvancedThreatProtectionSettings { + private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionSettingsImpl.class); + + private final AdvancedThreatProtectionSettingsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public AdvancedThreatProtectionSettingsImpl( + AdvancedThreatProtectionSettingsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AdvancedThreatProtectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AdvancedThreatProtection get( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { + AdvancedThreatProtectionInner inner = + this.serviceClient().get(resourceGroupName, serverName, advancedThreatProtectionName); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AdvancedThreatProtection update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters) { + AdvancedThreatProtectionInner inner = + this.serviceClient().update(resourceGroupName, serverName, advancedThreatProtectionName, parameters); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AdvancedThreatProtection update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context) { + AdvancedThreatProtectionInner inner = + this + .serviceClient() + .update(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); + if (inner != null) { + return new AdvancedThreatProtectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); + return Utils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serverName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serverName, context); + return Utils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); + } + + private AdvancedThreatProtectionSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java index ec983c8ec8674..d8048402daa34 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 @@ -183,7 +183,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -250,7 +250,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -506,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -562,7 +562,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -765,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -822,7 +822,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -923,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -983,7 +983,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 index 6200fdecdb31c..236b6c0f0d719 100644 --- 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; +import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; @@ -50,6 +51,10 @@ public Double percentComplete() { return this.innerModel().percentComplete(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ManagementError error() { return this.innerModel().error(); } 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 index 6eb944a5fa103..c4a86377b6acb 100644 --- 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 @@ -128,7 +128,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -186,7 +186,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -396,7 +396,7 @@ private Mono> validateBackupWithResponseAs 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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -447,7 +447,7 @@ private Mono> validateBackupWithResponseAs 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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 e3426f53af401..8ba0d9b9df643 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 @@ -147,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -202,7 +202,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -304,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -359,7 +359,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -457,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -516,7 +516,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java new file mode 100644 index 0000000000000..7f64025398f7e --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.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.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; +import java.util.Collections; +import java.util.List; + +public final class CapabilityImpl implements Capability { + private CapabilityInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + CapabilityImpl( + CapabilityInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List supportedGeoBackupRegions() { + List inner = this.innerModel().supportedGeoBackupRegions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedFlexibleServerEditions() { + List inner = this.innerModel().supportedFlexibleServerEditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedServerVersions() { + List inner = this.innerModel().supportedServerVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CapabilityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java index e8ade0c132261..3e0d3346c10d0 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 @@ -105,7 +105,7 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -159,7 +159,7 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 1d771a3629cbc..f20f4c681d4ca 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,7 +106,7 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -155,7 +155,7 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 4f32ae9315d0d..dc9046a63a5cd 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 @@ -106,7 +106,7 @@ private Mono> executeWithResponse } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -158,7 +158,7 @@ private Mono> executeWithResponse } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 ea282327b1ca4..c0788d4e29ce1 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 @@ -200,7 +200,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -267,7 +267,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -513,7 +513,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -580,7 +580,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -819,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -876,7 +876,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -980,7 +980,7 @@ private Mono>> batchUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1037,7 +1037,7 @@ private Mono>> batchUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1251,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1325,7 +1325,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 53bb088a30832..9aec861999bd0 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 @@ -177,7 +177,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -239,7 +239,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -460,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -515,7 +515,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -713,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -768,7 +768,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -866,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -925,7 +925,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 df8ca09c2eceb..2e10c00087233 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 @@ -178,7 +178,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -245,7 +245,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -485,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -541,7 +541,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -743,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -800,7 +800,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -898,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -957,7 +957,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 d2e657c1d9f66..ae9b1e24c0703 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,7 +79,7 @@ private Mono> executeWithResponse new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, accept, context)) @@ -104,7 +104,7 @@ private Mono> executeWithResponse new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(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 8c0c04a24a47e..f4eb29f7d57f8 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,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -161,7 +161,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java new file mode 100644 index 0000000000000..d4632d202a8bf --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitySetsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. */ +public final class LocationBasedCapabilitySetsClientImpl implements LocationBasedCapabilitySetsClient { + /** The proxy service used to perform REST calls. */ + private final LocationBasedCapabilitySetsService service; + + /** The service client containing this operation class. */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedCapabilitySetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationBasedCapabilitySetsClientImpl(MySqlManagementClientImpl client) { + this.service = + RestProxy + .create( + LocationBasedCapabilitySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientLocationBasedCapabilitySets to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MySqlManagementClien") + public interface LocationBasedCapabilitySetsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, + @PathParam("capabilitySetName") String capabilitySetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String locationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String apiVersion = "2023-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + locationName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String locationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String apiVersion = "2023-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName) { + return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName) { + return new PagedIterable<>(listAsync(locationName)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName, Context context) { + return new PagedIterable<>(listAsync(locationName, context)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName, String capabilitySetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (capabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilitySetName is required and cannot be null.")); + } + final String apiVersion = "2023-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + locationName, + capabilitySetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String capabilitySetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (capabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilitySetName is required and cannot be null.")); + } + final String apiVersion = "2023-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + locationName, + capabilitySetName, + accept, + context); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String capabilitySetName) { + return getWithResponseAsync(locationName, capabilitySetName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, String capabilitySetName, Context context) { + return getWithResponseAsync(locationName, capabilitySetName, context).block(); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityInner get(String locationName, String capabilitySetName) { + return getWithResponse(locationName, capabilitySetName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location capability set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java new file mode 100644 index 0000000000000..10d0e99338cd0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; +import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; + +public final class LocationBasedCapabilitySetsImpl implements LocationBasedCapabilitySets { + private static final ClientLogger LOGGER = new ClientLogger(LocationBasedCapabilitySetsImpl.class); + + private final LocationBasedCapabilitySetsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public LocationBasedCapabilitySetsImpl( + LocationBasedCapabilitySetsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String locationName) { + PagedIterable inner = this.serviceClient().list(locationName); + return Utils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); + } + + public PagedIterable list(String locationName, Context context) { + PagedIterable inner = this.serviceClient().list(locationName, context); + return Utils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); + } + + public Response getWithResponse(String locationName, String capabilitySetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(locationName, capabilitySetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapabilityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Capability get(String locationName, String capabilitySetName) { + CapabilityInner inner = this.serviceClient().get(locationName, capabilitySetName); + if (inner != null) { + return new CapabilityImpl(inner, this.manager()); + } else { + return null; + } + } + + private LocationBasedCapabilitySetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java index b0ee993e1081a..c6ba855c1aa68 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 @@ -111,7 +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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -170,7 +170,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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java index 1c4c5ba624885..c63b321580633 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java @@ -18,12 +18,12 @@ @ServiceClientBuilder(serviceClients = {MySqlManagementClientImpl.class}) public final class MySqlManagementClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the MySqlManagementClientBuilder. @@ -137,7 +137,7 @@ public MySqlManagementClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java index d342a6137625a..68f2c0bc670de 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java @@ -22,6 +22,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient; @@ -33,11 +34,14 @@ import com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -50,11 +54,11 @@ /** Initializes a new instance of the MySqlManagementClientImpl type. */ @ServiceClient(builder = MySqlManagementClientBuilder.class) public final class MySqlManagementClientImpl implements MySqlManagementClient { - /** The ID of the target subscription. */ + /** The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -206,6 +210,18 @@ public ReplicasClient getReplicas() { return this.replicas; } + /** The ServersMigrationsClient object to access its operations. */ + private final ServersMigrationsClient serversMigrations; + + /** + * Gets the ServersMigrationsClient object to access its operations. + * + * @return the ServersMigrationsClient object. + */ + public ServersMigrationsClient getServersMigrations() { + return this.serversMigrations; + } + /** The LogFilesClient object to access its operations. */ private final LogFilesClient logFiles; @@ -230,6 +246,18 @@ public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { return this.locationBasedCapabilities; } + /** The LocationBasedCapabilitySetsClient object to access its operations. */ + private final LocationBasedCapabilitySetsClient locationBasedCapabilitySets; + + /** + * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * + * @return the LocationBasedCapabilitySetsClient object. + */ + public LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets() { + return this.locationBasedCapabilitySets; + } + /** The CheckVirtualNetworkSubnetUsagesClient object to access its operations. */ private final CheckVirtualNetworkSubnetUsagesClient checkVirtualNetworkSubnetUsages; @@ -266,6 +294,18 @@ public CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWitho return this.checkNameAvailabilityWithoutLocations; } + /** The OperationResultsClient object to access its operations. */ + private final OperationResultsClient operationResults; + + /** + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. + */ + public OperationResultsClient getOperationResults() { + return this.operationResults; + } + /** The GetPrivateDnsZoneSuffixesClient object to access its operations. */ private final GetPrivateDnsZoneSuffixesClient getPrivateDnsZoneSuffixes; @@ -290,6 +330,18 @@ public OperationsClient getOperations() { return this.operations; } + /** The AdvancedThreatProtectionSettingsClient object to access its operations. */ + private final AdvancedThreatProtectionSettingsClient advancedThreatProtectionSettings; + + /** + * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * + * @return the AdvancedThreatProtectionSettingsClient object. + */ + public AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings() { + return this.advancedThreatProtectionSettings; + } + /** * Initializes an instance of MySqlManagementClient client. * @@ -297,7 +349,7 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ MySqlManagementClientImpl( @@ -320,13 +372,17 @@ public OperationsClient getOperations() { this.firewallRules = new FirewallRulesClientImpl(this); this.servers = new ServersClientImpl(this); this.replicas = new ReplicasClientImpl(this); + this.serversMigrations = new ServersMigrationsClientImpl(this); this.logFiles = new LogFilesClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); + this.locationBasedCapabilitySets = new LocationBasedCapabilitySetsClientImpl(this); this.checkVirtualNetworkSubnetUsages = new CheckVirtualNetworkSubnetUsagesClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); this.checkNameAvailabilityWithoutLocations = new CheckNameAvailabilityWithoutLocationsClientImpl(this); + this.operationResults = new OperationResultsClientImpl(this); this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); this.operations = new OperationsClientImpl(this); + this.advancedThreatProtectionSettings = new AdvancedThreatProtectionSettingsClientImpl(this); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java new file mode 100644 index 0000000000000..f8d8351942e2b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationResultsClient. */ +public final class OperationResultsClientImpl implements OperationResultsClient { + /** The proxy service used to perform REST calls. */ + private final OperationResultsService service; + + /** The service client containing this operation class. */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of OperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationResultsClientImpl(MySqlManagementClientImpl client) { + this.service = + RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientOperationResults to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MySqlManagementClien") + public interface OperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("locationName") String locationName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2023-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + locationName, + operationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2023-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + locationName, + operationId, + accept, + context); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String operationId) { + return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String locationName, String operationId, Context context) { + return getWithResponseAsync(locationName, operationId, context).block(); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusExtendedResultInner get(String locationName, String operationId) { + return getWithResponse(locationName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java new file mode 100644 index 0000000000000..f867a6c994e46 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; + +public final class OperationResultsImpl implements OperationResults { + private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); + + private final OperationResultsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public OperationResultsImpl( + OperationResultsClient innerClient, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String locationName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(locationName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusExtendedResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatusExtendedResult get(String locationName, String operationId) { + OperationStatusExtendedResultInner inner = this.serviceClient().get(locationName, operationId); + if (inner != null) { + return new OperationStatusExtendedResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java new file mode 100644 index 0000000000000..e406839809e4b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; +import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class OperationStatusExtendedResultImpl implements OperationStatusExtendedResult { + private OperationStatusExtendedResultInner innerObject; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + OperationStatusExtendedResultImpl( + OperationStatusExtendedResultInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationStatusExtendedResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java index 0421db5b1224f..81c3ee503441e 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,7 +93,7 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2021-12-01-preview"; + final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) @@ -127,7 +127,7 @@ 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 apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 ca2ddd3f5ef8b..ee20b279eab14 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 @@ -111,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -170,7 +170,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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service 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 6a239ccf4957a..e729509e27f10 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 @@ -12,9 +12,12 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; +import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; +import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; @@ -22,10 +25,10 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; public final class ServerImpl implements Server, Server.Definition, Server.Update { @@ -58,11 +61,11 @@ public Map tags() { } } - public Identity identity() { + public MySqlServerIdentity identity() { return this.innerModel().identity(); } - public Sku sku() { + public MySqlServerSku sku() { return this.innerModel().sku(); } @@ -134,10 +137,23 @@ public Network network() { return this.innerModel().network(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public MaintenanceWindow maintenanceWindow() { return this.innerModel().maintenanceWindow(); } + public ImportSourceProperties importSourceProperties() { + return this.innerModel().importSourceProperties(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -303,7 +319,7 @@ public ServerImpl withTags(Map tags) { } } - public ServerImpl withIdentity(Identity identity) { + public ServerImpl withIdentity(MySqlServerIdentity identity) { if (isInCreateMode()) { this.innerModel().withIdentity(identity); return this; @@ -313,7 +329,7 @@ public ServerImpl withIdentity(Identity identity) { } } - public ServerImpl withSku(Sku sku) { + public ServerImpl withSku(MySqlServerSku sku) { if (isInCreateMode()) { this.innerModel().withSku(sku); return this; @@ -428,6 +444,11 @@ public ServerImpl withNetwork(Network network) { } } + public ServerImpl withImportSourceProperties(ImportSourceProperties importSourceProperties) { + this.innerModel().withImportSourceProperties(importSourceProperties); + return this; + } + public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { this.updateParameters.withMaintenanceWindow(maintenanceWindow); return this; diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java index 170838e9d66af..2b78f4f8d8ffe 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 @@ -281,7 +281,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -338,7 +338,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -543,7 +543,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -601,7 +601,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -807,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -857,7 +857,7 @@ 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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1037,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1087,7 +1087,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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1176,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1230,7 +1230,7 @@ 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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1335,7 +1335,7 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1377,7 +1377,7 @@ 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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1477,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1527,7 +1527,7 @@ 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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1713,7 +1713,7 @@ private Mono>> restartWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1770,7 +1770,7 @@ private Mono>> restartWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1965,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2015,7 +2015,7 @@ 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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2193,7 +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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2243,7 +2243,7 @@ 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 apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2428,7 +2428,7 @@ private Mono>> resetGtidWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2485,7 +2485,7 @@ private Mono>> resetGtidWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-09-30-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java new file mode 100644 index 0000000000000..81e3f17a7e4a7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServersMigrationsClient. */ +public final class ServersMigrationsClientImpl implements ServersMigrationsClient { + /** The proxy service used to perform REST calls. */ + private final ServersMigrationsService service; + + /** The service client containing this operation class. */ + private final MySqlManagementClientImpl client; + + /** + * Initializes an instance of ServersMigrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServersMigrationsClientImpl(MySqlManagementClientImpl client) { + this.service = + RestProxy.create(ServersMigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MySqlManagementClientServersMigrations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MySqlManagementClien") + public interface ServersMigrationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cutoverMigration( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverMigrationWithResponseAsync( + String resourceGroupName, String serverName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cutoverMigration( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverMigrationWithResponseAsync( + String resourceGroupName, String serverName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String apiVersion = "2023-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cutoverMigration( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerInner> beginCutoverMigrationAsync( + String resourceGroupName, String serverName) { + Mono>> mono = cutoverMigrationWithResponseAsync(resourceGroupName, serverName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServerInner.class, ServerInner.class, this.client.getContext()); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerInner> beginCutoverMigrationAsync( + String resourceGroupName, String serverName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cutoverMigrationWithResponseAsync(resourceGroupName, serverName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServerInner.class, ServerInner.class, context); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerInner> beginCutoverMigration( + String resourceGroupName, String serverName) { + return this.beginCutoverMigrationAsync(resourceGroupName, serverName).getSyncPoller(); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerInner> beginCutoverMigration( + String resourceGroupName, String serverName, Context context) { + return this.beginCutoverMigrationAsync(resourceGroupName, serverName, context).getSyncPoller(); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverMigrationAsync(String resourceGroupName, String serverName) { + return beginCutoverMigrationAsync(resourceGroupName, serverName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverMigrationAsync(String resourceGroupName, String serverName, Context context) { + return beginCutoverMigrationAsync(resourceGroupName, serverName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerInner cutoverMigration(String resourceGroupName, String serverName) { + return cutoverMigrationAsync(resourceGroupName, serverName).block(); + } + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context) { + return cutoverMigrationAsync(resourceGroupName, serverName, context).block(); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java new file mode 100644 index 0000000000000..ff600c6f4f248 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.Server; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; + +public final class ServersMigrationsImpl implements ServersMigrations { + private static final ClientLogger LOGGER = new ClientLogger(ServersMigrationsImpl.class); + + private final ServersMigrationsClient innerClient; + + private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + + public ServersMigrationsImpl( + ServersMigrationsClient innerClient, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Server cutoverMigration(String resourceGroupName, String serverName) { + ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName); + if (inner != null) { + return new ServerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Server cutoverMigration(String resourceGroupName, String serverName, Context context) { + ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName, context); + if (inner != null) { + return new ServerImpl(inner, this.manager()); + } else { + return null; + } + } + + private ServersMigrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/Utils.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/Utils.java index fa57faf36a08d..a3cf7af7cc7f0 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/Utils.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/Utils.java @@ -20,6 +20,9 @@ import reactor.core.publisher.Flux; final class Utils { + private Utils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -133,30 +136,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +198,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java new file mode 100644 index 0000000000000..f6ed5485a4cb0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of AdvancedThreatProtection. */ +public interface AdvancedThreatProtection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + AdvancedThreatProtectionState state(); + + /** + * Gets the provisioningState property: Provisioning state of the Threat Protection. + * + * @return the provisioningState value. + */ + AdvancedThreatProtectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner object. + * + * @return the inner object. + */ + AdvancedThreatProtectionInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java new file mode 100644 index 0000000000000..a140396df7cf2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters allowed to update advanced threat protection for a server. */ +@Fluent +public final class AdvancedThreatProtectionForUpdate { + /* + * Resource update properties. + */ + @JsonProperty(value = "properties") + private AdvancedThreatProtectionUpdateProperties innerProperties; + + /** Creates an instance of AdvancedThreatProtectionForUpdate class. */ + public AdvancedThreatProtectionForUpdate() { + } + + /** + * Get the innerProperties property: Resource update properties. + * + * @return the innerProperties value. + */ + private AdvancedThreatProtectionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @return the state value. + */ + public AdvancedThreatProtectionState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled + * or a state has not been applied yet on the specific database or server. + * + * @param state the state value to set. + * @return the AdvancedThreatProtectionForUpdate object itself. + */ + public AdvancedThreatProtectionForUpdate withState(AdvancedThreatProtectionState state) { + if (this.innerProperties() == null) { + this.innerProperties = new AdvancedThreatProtectionUpdateProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java new file mode 100644 index 0000000000000..41e22a007d3e5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the server's Advanced Threat Protection configurations. */ +@Immutable +public final class AdvancedThreatProtectionListResult { + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of AdvancedThreatProtectionListResult class. */ + public AdvancedThreatProtectionListResult() { + } + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java new file mode 100644 index 0000000000000..7904073616015 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AdvancedThreatProtectionName. */ +public final class AdvancedThreatProtectionName extends ExpandableStringEnum { + /** Static value Default for AdvancedThreatProtectionName. */ + public static final AdvancedThreatProtectionName DEFAULT = fromString("Default"); + + /** + * Creates a new instance of AdvancedThreatProtectionName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedThreatProtectionName() { + } + + /** + * Creates or finds a AdvancedThreatProtectionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedThreatProtectionName. + */ + @JsonCreator + public static AdvancedThreatProtectionName fromString(String name) { + return fromString(name, AdvancedThreatProtectionName.class); + } + + /** + * Gets known AdvancedThreatProtectionName values. + * + * @return known AdvancedThreatProtectionName values. + */ + public static Collection values() { + return values(AdvancedThreatProtectionName.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java new file mode 100644 index 0000000000000..137f085ce78f0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +public final class AdvancedThreatProtectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for AdvancedThreatProtectionProvisioningState. */ + public static final AdvancedThreatProtectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for AdvancedThreatProtectionProvisioningState. */ + public static final AdvancedThreatProtectionProvisioningState UPDATING = fromString("Updating"); + + /** Static value Canceled for AdvancedThreatProtectionProvisioningState. */ + public static final AdvancedThreatProtectionProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for AdvancedThreatProtectionProvisioningState. */ + public static final AdvancedThreatProtectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of AdvancedThreatProtectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedThreatProtectionProvisioningState() { + } + + /** + * Creates or finds a AdvancedThreatProtectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedThreatProtectionProvisioningState. + */ + @JsonCreator + public static AdvancedThreatProtectionProvisioningState fromString(String name) { + return fromString(name, AdvancedThreatProtectionProvisioningState.class); + } + + /** + * Gets known AdvancedThreatProtectionProvisioningState values. + * + * @return known AdvancedThreatProtectionProvisioningState values. + */ + public static Collection values() { + return values(AdvancedThreatProtectionProvisioningState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java new file mode 100644 index 0000000000000..49c9218373276 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AdvancedThreatProtectionSettings. */ +public interface AdvancedThreatProtectionSettings { + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + Context context); + + /** + * Get a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection state. + */ + AdvancedThreatProtection get( + String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + AdvancedThreatProtection update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters); + + /** + * Updates a server's Advanced Threat Protection state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. + * @param parameters The server's Advanced Threat Protection body to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server's Advanced Threat Protection. + */ + AdvancedThreatProtection update( + String resourceGroupName, + String serverName, + AdvancedThreatProtectionName advancedThreatProtectionName, + AdvancedThreatProtectionForUpdate parameters, + Context context); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName); + + /** + * Gets a list of server's Advanced Threat Protection states. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java new file mode 100644 index 0000000000000..bd618b3ccf429 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.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; + +/** Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled on the server. */ +public final class AdvancedThreatProtectionState extends ExpandableStringEnum { + /** Static value Enabled for AdvancedThreatProtectionState. */ + public static final AdvancedThreatProtectionState ENABLED = fromString("Enabled"); + + /** Static value Disabled for AdvancedThreatProtectionState. */ + public static final AdvancedThreatProtectionState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AdvancedThreatProtectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvancedThreatProtectionState() { + } + + /** + * Creates or finds a AdvancedThreatProtectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvancedThreatProtectionState. + */ + @JsonCreator + public static AdvancedThreatProtectionState fromString(String name) { + return fromString(name, AdvancedThreatProtectionState.class); + } + + /** + * Gets known AdvancedThreatProtectionState values. + * + * @return known AdvancedThreatProtectionState values. + */ + public static Collection values() { + return values(AdvancedThreatProtectionState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java index edd1a5c2df805..3ae9529684bc2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java @@ -32,7 +32,7 @@ public interface AzureADAdministrator { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -91,11 +91,13 @@ public interface AzureADAdministrator { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The AzureADAdministrator definition stages. */ interface DefinitionStages { /** The first stage of the AzureADAdministrator definition. */ interface Blank extends WithParentResource { } + /** The stage of the AzureADAdministrator definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -107,6 +109,7 @@ interface WithParentResource { */ WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); } + /** * The stage of the AzureADAdministrator definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -132,6 +135,7 @@ interface WithCreate */ AzureADAdministrator create(Context context); } + /** The stage of the AzureADAdministrator definition allowing to specify administratorType. */ interface WithAdministratorType { /** @@ -142,6 +146,7 @@ interface WithAdministratorType { */ WithCreate withAdministratorType(AdministratorType administratorType); } + /** The stage of the AzureADAdministrator definition allowing to specify login. */ interface WithLogin { /** @@ -152,6 +157,7 @@ interface WithLogin { */ WithCreate withLogin(String login); } + /** The stage of the AzureADAdministrator definition allowing to specify sid. */ interface WithSid { /** @@ -162,6 +168,7 @@ interface WithSid { */ WithCreate withSid(String sid); } + /** The stage of the AzureADAdministrator definition allowing to specify tenantId. */ interface WithTenantId { /** @@ -172,6 +179,7 @@ interface WithTenantId { */ WithCreate withTenantId(String tenantId); } + /** The stage of the AzureADAdministrator definition allowing to specify identityResourceId. */ interface WithIdentityResourceId { /** @@ -183,6 +191,7 @@ interface WithIdentityResourceId { WithCreate withIdentityResourceId(String identityResourceId); } } + /** * Begins update for the AzureADAdministrator resource. * @@ -212,6 +221,7 @@ interface Update */ AzureADAdministrator apply(Context context); } + /** The AzureADAdministrator update stages. */ interface UpdateStages { /** The stage of the AzureADAdministrator update allowing to specify administratorType. */ @@ -224,6 +234,7 @@ interface WithAdministratorType { */ Update withAdministratorType(AdministratorType administratorType); } + /** The stage of the AzureADAdministrator update allowing to specify login. */ interface WithLogin { /** @@ -234,6 +245,7 @@ interface WithLogin { */ Update withLogin(String login); } + /** The stage of the AzureADAdministrator update allowing to specify sid. */ interface WithSid { /** @@ -244,6 +256,7 @@ interface WithSid { */ Update withSid(String sid); } + /** The stage of the AzureADAdministrator update allowing to specify tenantId. */ interface WithTenantId { /** @@ -254,6 +267,7 @@ interface WithTenantId { */ Update withTenantId(String tenantId); } + /** The stage of the AzureADAdministrator update allowing to specify identityResourceId. */ interface WithIdentityResourceId { /** @@ -265,6 +279,7 @@ interface WithIdentityResourceId { Update withIdentityResourceId(String identityResourceId); } } + /** * Refreshes the resource to sync with Azure. * 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 index c07bb27739b4b..c3d131d17ed7f 100644 --- 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; +import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; import java.time.OffsetDateTime; @@ -60,9 +61,14 @@ public interface BackupAndExportResponse { Double percentComplete(); /** - * Gets the error property: Error Response + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - *

The BackupAndExport operation error response. + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the error property: The error object. * * @return the error value. */ 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 index 187596ecf784c..ab876cfd297ec 100644 --- 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 @@ -10,12 +10,12 @@ /** 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"); + /** Static value Raw for BackupFormat. */ + public static final BackupFormat RAW = fromString("Raw"); + /** * Creates a new instance of BackupFormat value. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java new file mode 100644 index 0000000000000..d8025693a05a1 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import java.util.List; + +/** An immutable client-side representation of Capability. */ +public interface Capability { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the supportedGeoBackupRegions property: supported geo backup regions. + * + * @return the supportedGeoBackupRegions value. + */ + List supportedGeoBackupRegions(); + + /** + * Gets the supportedFlexibleServerEditions property: A list of supported flexible server editions. + * + * @return the supportedFlexibleServerEditions value. + */ + List supportedFlexibleServerEditions(); + + /** + * Gets the supportedServerVersions property: A list of supported server versions. + * + * @return the supportedServerVersions value. + */ + List supportedServerVersions(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner object. + * + * @return the inner object. + */ + CapabilityInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java new file mode 100644 index 0000000000000..ec2411cf53537 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** location capability set. */ +@Immutable +public final class CapabilitySetsList { + /* + * A list of supported capability sets. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of CapabilitySetsList class. */ + public CapabilitySetsList() { + } + + /** + * Get the value property: A list of supported capability sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 77190eb04a656..29d980241e6be 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 @@ -32,7 +32,7 @@ public interface Configuration { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -133,11 +133,13 @@ public interface Configuration { 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 { /** @@ -149,6 +151,7 @@ interface WithParentResource { */ 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. @@ -170,6 +173,7 @@ interface WithCreate */ Configuration create(Context context); } + /** The stage of the Configuration definition allowing to specify value. */ interface WithValue { /** @@ -180,6 +184,7 @@ interface WithValue { */ WithCreate withValue(String value); } + /** The stage of the Configuration definition allowing to specify currentValue. */ interface WithCurrentValue { /** @@ -190,6 +195,7 @@ interface WithCurrentValue { */ WithCreate withCurrentValue(String currentValue); } + /** The stage of the Configuration definition allowing to specify source. */ interface WithSource { /** @@ -201,6 +207,7 @@ interface WithSource { WithCreate withSource(ConfigurationSource source); } } + /** * Begins update for the Configuration resource. * @@ -225,6 +232,7 @@ interface Update extends UpdateStages.WithValue, UpdateStages.WithCurrentValue, */ Configuration apply(Context context); } + /** The Configuration update stages. */ interface UpdateStages { /** The stage of the Configuration update allowing to specify value. */ @@ -237,6 +245,7 @@ interface WithValue { */ Update withValue(String value); } + /** The stage of the Configuration update allowing to specify currentValue. */ interface WithCurrentValue { /** @@ -247,6 +256,7 @@ interface WithCurrentValue { */ Update withCurrentValue(String currentValue); } + /** The stage of the Configuration update allowing to specify source. */ interface WithSource { /** @@ -258,6 +268,7 @@ interface WithSource { Update withSource(ConfigurationSource source); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java index be335b0e9d1f6..11dd78d6cb1fb 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java @@ -32,7 +32,7 @@ public interface Database { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -70,11 +70,13 @@ public interface Database { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The Database definition stages. */ interface DefinitionStages { /** The first stage of the Database definition. */ interface Blank extends WithParentResource { } + /** The stage of the Database definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -86,6 +88,7 @@ interface WithParentResource { */ WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); } + /** * The stage of the Database definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -106,6 +109,7 @@ interface WithCreate extends DefinitionStages.WithCharset, DefinitionStages.With */ Database create(Context context); } + /** The stage of the Database definition allowing to specify charset. */ interface WithCharset { /** @@ -116,6 +120,7 @@ interface WithCharset { */ WithCreate withCharset(String charset); } + /** The stage of the Database definition allowing to specify collation. */ interface WithCollation { /** @@ -127,6 +132,7 @@ interface WithCollation { WithCreate withCollation(String collation); } } + /** * Begins update for the Database resource. * @@ -151,6 +157,7 @@ interface Update extends UpdateStages.WithCharset, UpdateStages.WithCollation { */ Database apply(Context context); } + /** The Database update stages. */ interface UpdateStages { /** The stage of the Database update allowing to specify charset. */ @@ -163,6 +170,7 @@ interface WithCharset { */ Update withCharset(String charset); } + /** The stage of the Database update allowing to specify collation. */ interface WithCollation { /** @@ -174,6 +182,7 @@ interface WithCollation { Update withCollation(String collation); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java index 47a4966d1ca58..04768fa460643 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java @@ -32,7 +32,7 @@ public interface FirewallRule { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -74,11 +74,13 @@ interface Definition DefinitionStages.WithEndIpAddress, DefinitionStages.WithCreate { } + /** The FirewallRule definition stages. */ interface DefinitionStages { /** The first stage of the FirewallRule definition. */ interface Blank extends WithParentResource { } + /** The stage of the FirewallRule definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -90,6 +92,7 @@ interface WithParentResource { */ WithStartIpAddress withExistingFlexibleServer(String resourceGroupName, String serverName); } + /** The stage of the FirewallRule definition allowing to specify startIpAddress. */ interface WithStartIpAddress { /** @@ -101,6 +104,7 @@ interface WithStartIpAddress { */ WithEndIpAddress withStartIpAddress(String startIpAddress); } + /** The stage of the FirewallRule definition allowing to specify endIpAddress. */ interface WithEndIpAddress { /** @@ -112,6 +116,7 @@ interface WithEndIpAddress { */ WithCreate withEndIpAddress(String endIpAddress); } + /** * The stage of the FirewallRule definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -133,6 +138,7 @@ interface WithCreate { FirewallRule create(Context context); } } + /** * Begins update for the FirewallRule resource. * @@ -157,6 +163,7 @@ interface Update extends UpdateStages.WithStartIpAddress, UpdateStages.WithEndIp */ FirewallRule apply(Context context); } + /** The FirewallRule update stages. */ interface UpdateStages { /** The stage of the FirewallRule update allowing to specify startIpAddress. */ @@ -170,6 +177,7 @@ interface WithStartIpAddress { */ Update withStartIpAddress(String startIpAddress); } + /** The stage of the FirewallRule update allowing to specify endIpAddress. */ interface WithEndIpAddress { /** @@ -182,6 +190,7 @@ interface WithEndIpAddress { Update withEndIpAddress(String endIpAddress); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java new file mode 100644 index 0000000000000..d8c78a93a7aaa --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Import source related properties. */ +@Fluent +public final class ImportSourceProperties { + /* + * Storage type of import source. + */ + @JsonProperty(value = "storageType") + private ImportSourceStorageType storageType; + + /* + * Uri of the import source storage. + */ + @JsonProperty(value = "storageUrl") + private String storageUrl; + + /* + * Sas token for accessing source storage. Read and list permissions are required for sas token. + */ + @JsonProperty(value = "sasToken") + private String sasToken; + + /* + * Relative path of data directory in storage. + */ + @JsonProperty(value = "dataDirPath") + private String dataDirPath; + + /** Creates an instance of ImportSourceProperties class. */ + public ImportSourceProperties() { + } + + /** + * Get the storageType property: Storage type of import source. + * + * @return the storageType value. + */ + public ImportSourceStorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type of import source. + * + * @param storageType the storageType value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withStorageType(ImportSourceStorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the storageUrl property: Uri of the import source storage. + * + * @return the storageUrl value. + */ + public String storageUrl() { + return this.storageUrl; + } + + /** + * Set the storageUrl property: Uri of the import source storage. + * + * @param storageUrl the storageUrl value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withStorageUrl(String storageUrl) { + this.storageUrl = storageUrl; + return this; + } + + /** + * Get the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas + * token. + * + * @return the sasToken value. + */ + public String sasToken() { + return this.sasToken; + } + + /** + * Set the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas + * token. + * + * @param sasToken the sasToken value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withSasToken(String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * Get the dataDirPath property: Relative path of data directory in storage. + * + * @return the dataDirPath value. + */ + public String dataDirPath() { + return this.dataDirPath; + } + + /** + * Set the dataDirPath property: Relative path of data directory in storage. + * + * @param dataDirPath the dataDirPath value to set. + * @return the ImportSourceProperties object itself. + */ + public ImportSourceProperties withDataDirPath(String dataDirPath) { + this.dataDirPath = dataDirPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java new file mode 100644 index 0000000000000..d1b6a392eac30 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java @@ -0,0 +1,44 @@ +// Copyright (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; + +/** Storage type of import source. */ +public final class ImportSourceStorageType extends ExpandableStringEnum { + /** Static value AzureBlob for ImportSourceStorageType. */ + public static final ImportSourceStorageType AZURE_BLOB = fromString("AzureBlob"); + + /** + * Creates a new instance of ImportSourceStorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImportSourceStorageType() { + } + + /** + * Creates or finds a ImportSourceStorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImportSourceStorageType. + */ + @JsonCreator + public static ImportSourceStorageType fromString(String name) { + return fromString(name, ImportSourceStorageType.class); + } + + /** + * Gets known ImportSourceStorageType values. + * + * @return known ImportSourceStorageType values. + */ + public static Collection values() { + return values(ImportSourceStorageType.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java new file mode 100644 index 0000000000000..68ce3f349b71a --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LocationBasedCapabilitySets. */ +public interface LocationBasedCapabilitySets { + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String locationName); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String locationName, Context context); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription along with {@link Response}. + */ + Response getWithResponse(String locationName, String capabilitySetName, Context context); + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param capabilitySetName Name of capability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + Capability get(String locationName, String capabilitySetName); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java index c76a9d25a7c11..9ae439b0e7dd1 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java @@ -32,7 +32,7 @@ public interface LogFile { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java similarity index 86% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java index c46b12ed9533e..2ebaed6454f35 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/MySqlServerIdentity.java @@ -11,7 +11,7 @@ /** Properties to configure Identity for Bring your Own Keys. */ @Fluent -public final class Identity { +public final class MySqlServerIdentity { /* * ObjectId from the KeyVault */ @@ -37,8 +37,8 @@ public final class Identity { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; - /** Creates an instance of Identity class. */ - public Identity() { + /** Creates an instance of MySqlServerIdentity class. */ + public MySqlServerIdentity() { } /** @@ -72,9 +72,9 @@ public ManagedServiceIdentityType type() { * Set the type property: Type of managed service identity. * * @param type the type value to set. - * @return the Identity object itself. + * @return the MySqlServerIdentity object itself. */ - public Identity withType(ManagedServiceIdentityType type) { + public MySqlServerIdentity withType(ManagedServiceIdentityType type) { this.type = type; return this; } @@ -92,9 +92,9 @@ public Map userAssignedIdentities() { * Set the userAssignedIdentities property: Metadata of user assigned identity. * * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the Identity object itself. + * @return the MySqlServerIdentity object itself. */ - public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + public MySqlServerIdentity withUserAssignedIdentities(Map userAssignedIdentities) { this.userAssignedIdentities = userAssignedIdentities; return this; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java similarity index 71% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java index cfab9ff4e5e2e..f97797db0d416 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java @@ -10,7 +10,7 @@ /** Billing information related properties of a server. */ @Fluent -public final class Sku { +public final class MySqlServerSku { /* * The name of the sku, e.g. Standard_D32s_v3. */ @@ -21,10 +21,10 @@ public final class Sku { * The tier of the particular SKU, e.g. GeneralPurpose. */ @JsonProperty(value = "tier", required = true) - private SkuTier tier; + private ServerSkuTier tier; - /** Creates an instance of Sku class. */ - public Sku() { + /** Creates an instance of MySqlServerSku class. */ + public MySqlServerSku() { } /** @@ -40,9 +40,9 @@ public String name() { * Set the name property: The name of the sku, e.g. Standard_D32s_v3. * * @param name the name value to set. - * @return the Sku object itself. + * @return the MySqlServerSku object itself. */ - public Sku withName(String name) { + public MySqlServerSku withName(String name) { this.name = name; return this; } @@ -52,7 +52,7 @@ public Sku withName(String name) { * * @return the tier value. */ - public SkuTier tier() { + public ServerSkuTier tier() { return this.tier; } @@ -60,9 +60,9 @@ public SkuTier tier() { * Set the tier property: The tier of the particular SKU, e.g. GeneralPurpose. * * @param tier the tier value to set. - * @return the Sku object itself. + * @return the MySqlServerSku object itself. */ - public Sku withTier(SkuTier tier) { + public MySqlServerSku withTier(ServerSkuTier tier) { this.tier = tier; return this; } @@ -75,13 +75,15 @@ public Sku withTier(SkuTier tier) { public void validate() { if (name() == null) { throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model MySqlServerSku")); } if (tier() == null) { throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property tier in model Sku")); + .logExceptionAsError( + new IllegalArgumentException("Missing required property tier in model MySqlServerSku")); } } - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + private static final ClientLogger LOGGER = new ClientLogger(MySqlServerSku.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java new file mode 100644 index 0000000000000..dd2f94a7e14d7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationResults. */ +public interface OperationResults { + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation along with {@link Response}. + */ + Response getWithResponse(String locationName, String operationId, Context context); + + /** + * Get the operation result for a long running operation. + * + * @param locationName The name of the location. + * @param operationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a long running operation. + */ + OperationStatusExtendedResult get(String locationName, String operationId); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java new file mode 100644 index 0000000000000..14decb749d0e2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of OperationStatusExtendedResult. */ +public interface OperationStatusExtendedResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Float percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the properties property: The extended properties of Operation Results. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner + * object. + * + * @return the inner object. + */ + OperationStatusExtendedResultInner innerModel(); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java new file mode 100644 index 0000000000000..e4fbf610e636b --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The current status of an async operation. */ +@Fluent +public class OperationStatusResult { + /* + * Fully qualified ID for the async operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * Name of the async operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * Percent of the operation that is complete. + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The operations list. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * If present, details of the operation error. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of OperationStatusResult class. */ + public OperationStatusResult() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model OperationStatusResult")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResult.class); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..92d493cc1bb66 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for private endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..0b321cca21ea5 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnection extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateEndpointConnection class. */ + public PrivateEndpointConnection() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..743ffdfa31980 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..5da0888a86a0d --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..14cf8b7a05b59 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java index 0defb712482f3..cc28e00b67832 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 @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Server. */ @@ -53,17 +54,17 @@ public interface Server { * * @return the identity value. */ - Identity identity(); + MySqlServerIdentity identity(); /** * Gets the sku property: The SKU (pricing tier) of the server. * * @return the sku value. */ - Sku sku(); + MySqlServerSku sku(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -184,6 +185,13 @@ public interface Server { */ Network network(); + /** + * Gets the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * Gets the maintenanceWindow property: Maintenance window of a server. * @@ -191,6 +199,13 @@ public interface Server { */ MaintenanceWindow maintenanceWindow(); + /** + * Gets the importSourceProperties property: Source properties for import from storage. + * + * @return the importSourceProperties value. + */ + ImportSourceProperties importSourceProperties(); + /** * Gets the region of the resource. * @@ -226,11 +241,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The Server definition stages. */ interface DefinitionStages { /** The first stage of the Server definition. */ interface Blank extends WithLocation { } + /** The stage of the Server definition allowing to specify location. */ interface WithLocation { /** @@ -249,6 +266,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the Server definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -259,6 +277,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Server definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. @@ -279,7 +298,8 @@ interface WithCreate DefinitionStages.WithStorage, DefinitionStages.WithBackup, DefinitionStages.WithHighAvailability, - DefinitionStages.WithNetwork { + DefinitionStages.WithNetwork, + DefinitionStages.WithImportSourceProperties { /** * Executes the create request. * @@ -295,6 +315,7 @@ interface WithCreate */ Server create(Context context); } + /** The stage of the Server definition allowing to specify tags. */ interface WithTags { /** @@ -305,6 +326,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Server definition allowing to specify identity. */ interface WithIdentity { /** @@ -313,8 +335,9 @@ interface WithIdentity { * @param identity The cmk identity for the server. * @return the next definition stage. */ - WithCreate withIdentity(Identity identity); + WithCreate withIdentity(MySqlServerIdentity identity); } + /** The stage of the Server definition allowing to specify sku. */ interface WithSku { /** @@ -323,8 +346,9 @@ interface WithSku { * @param sku The SKU (pricing tier) of the server. * @return the next definition stage. */ - WithCreate withSku(Sku sku); + WithCreate withSku(MySqlServerSku sku); } + /** The stage of the Server definition allowing to specify administratorLogin. */ interface WithAdministratorLogin { /** @@ -337,6 +361,7 @@ interface WithAdministratorLogin { */ WithCreate withAdministratorLogin(String administratorLogin); } + /** The stage of the Server definition allowing to specify administratorLoginPassword. */ interface WithAdministratorLoginPassword { /** @@ -348,6 +373,7 @@ interface WithAdministratorLoginPassword { */ WithCreate withAdministratorLoginPassword(String administratorLoginPassword); } + /** The stage of the Server definition allowing to specify version. */ interface WithVersion { /** @@ -358,6 +384,7 @@ interface WithVersion { */ WithCreate withVersion(ServerVersion version); } + /** The stage of the Server definition allowing to specify availabilityZone. */ interface WithAvailabilityZone { /** @@ -368,6 +395,7 @@ interface WithAvailabilityZone { */ WithCreate withAvailabilityZone(String availabilityZone); } + /** The stage of the Server definition allowing to specify createMode. */ interface WithCreateMode { /** @@ -378,6 +406,7 @@ interface WithCreateMode { */ WithCreate withCreateMode(CreateMode createMode); } + /** The stage of the Server definition allowing to specify sourceServerResourceId. */ interface WithSourceServerResourceId { /** @@ -388,6 +417,7 @@ interface WithSourceServerResourceId { */ WithCreate withSourceServerResourceId(String sourceServerResourceId); } + /** The stage of the Server definition allowing to specify restorePointInTime. */ interface WithRestorePointInTime { /** @@ -400,6 +430,7 @@ interface WithRestorePointInTime { */ WithCreate withRestorePointInTime(OffsetDateTime restorePointInTime); } + /** The stage of the Server definition allowing to specify replicationRole. */ interface WithReplicationRole { /** @@ -410,6 +441,7 @@ interface WithReplicationRole { */ WithCreate withReplicationRole(ReplicationRole replicationRole); } + /** The stage of the Server definition allowing to specify dataEncryption. */ interface WithDataEncryption { /** @@ -420,6 +452,7 @@ interface WithDataEncryption { */ WithCreate withDataEncryption(DataEncryption dataEncryption); } + /** The stage of the Server definition allowing to specify storage. */ interface WithStorage { /** @@ -430,6 +463,7 @@ interface WithStorage { */ WithCreate withStorage(Storage storage); } + /** The stage of the Server definition allowing to specify backup. */ interface WithBackup { /** @@ -440,6 +474,7 @@ interface WithBackup { */ WithCreate withBackup(Backup backup); } + /** The stage of the Server definition allowing to specify highAvailability. */ interface WithHighAvailability { /** @@ -450,6 +485,7 @@ interface WithHighAvailability { */ WithCreate withHighAvailability(HighAvailability highAvailability); } + /** The stage of the Server definition allowing to specify network. */ interface WithNetwork { /** @@ -460,7 +496,19 @@ interface WithNetwork { */ WithCreate withNetwork(Network network); } + + /** The stage of the Server definition allowing to specify importSourceProperties. */ + interface WithImportSourceProperties { + /** + * Specifies the importSourceProperties property: Source properties for import from storage.. + * + * @param importSourceProperties Source properties for import from storage. + * @return the next definition stage. + */ + WithCreate withImportSourceProperties(ImportSourceProperties importSourceProperties); + } } + /** * Begins update for the Server resource. * @@ -497,6 +545,7 @@ interface Update */ Server apply(Context context); } + /** The Server update stages. */ interface UpdateStages { /** The stage of the Server update allowing to specify tags. */ @@ -509,6 +558,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Server update allowing to specify identity. */ interface WithIdentity { /** @@ -517,8 +567,9 @@ interface WithIdentity { * @param identity The cmk identity for the server. * @return the next definition stage. */ - Update withIdentity(Identity identity); + Update withIdentity(MySqlServerIdentity identity); } + /** The stage of the Server update allowing to specify sku. */ interface WithSku { /** @@ -527,8 +578,9 @@ interface WithSku { * @param sku The SKU (pricing tier) of the server. * @return the next definition stage. */ - Update withSku(Sku sku); + Update withSku(MySqlServerSku sku); } + /** The stage of the Server update allowing to specify administratorLoginPassword. */ interface WithAdministratorLoginPassword { /** @@ -539,6 +591,7 @@ interface WithAdministratorLoginPassword { */ Update withAdministratorLoginPassword(String administratorLoginPassword); } + /** The stage of the Server update allowing to specify version. */ interface WithVersion { /** @@ -549,6 +602,7 @@ interface WithVersion { */ Update withVersion(ServerVersion version); } + /** The stage of the Server update allowing to specify storage. */ interface WithStorage { /** @@ -559,6 +613,7 @@ interface WithStorage { */ Update withStorage(Storage storage); } + /** The stage of the Server update allowing to specify backup. */ interface WithBackup { /** @@ -569,6 +624,7 @@ interface WithBackup { */ Update withBackup(Backup backup); } + /** The stage of the Server update allowing to specify highAvailability. */ interface WithHighAvailability { /** @@ -579,6 +635,7 @@ interface WithHighAvailability { */ Update withHighAvailability(HighAvailability highAvailability); } + /** The stage of the Server update allowing to specify maintenanceWindow. */ interface WithMaintenanceWindow { /** @@ -589,6 +646,7 @@ interface WithMaintenanceWindow { */ Update withMaintenanceWindow(MaintenanceWindow maintenanceWindow); } + /** The stage of the Server update allowing to specify replicationRole. */ interface WithReplicationRole { /** @@ -599,6 +657,7 @@ interface WithReplicationRole { */ Update withReplicationRole(ReplicationRole replicationRole); } + /** The stage of the Server update allowing to specify dataEncryption. */ interface WithDataEncryption { /** @@ -609,6 +668,7 @@ interface WithDataEncryption { */ Update withDataEncryption(DataEncryption dataEncryption); } + /** The stage of the Server update allowing to specify network. */ interface WithNetwork { /** @@ -620,6 +680,7 @@ interface WithNetwork { Update withNetwork(Network network); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java index 60f3877a34470..c1ee893321031 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java @@ -32,7 +32,7 @@ public interface ServerBackup { String type(); /** - * Gets the systemData property: The system metadata relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java new file mode 100644 index 0000000000000..aa075d2bae7ba --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Server edition capabilities. */ +@Immutable +public final class ServerEditionCapabilityV2 { + /* + * Server edition name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Default Sku name + */ + @JsonProperty(value = "defaultSku", access = JsonProperty.Access.WRITE_ONLY) + private String defaultSku; + + /* + * Default storage size + */ + @JsonProperty(value = "defaultStorageSize", access = JsonProperty.Access.WRITE_ONLY) + private Integer defaultStorageSize; + + /* + * A list of supported storage editions + */ + @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedStorageEditions; + + /* + * A list of supported Skus + */ + @JsonProperty(value = "supportedSkus", access = JsonProperty.Access.WRITE_ONLY) + private List supportedSkus; + + /** Creates an instance of ServerEditionCapabilityV2 class. */ + public ServerEditionCapabilityV2() { + } + + /** + * Get the name property: Server edition name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the defaultSku property: Default Sku name. + * + * @return the defaultSku value. + */ + public String defaultSku() { + return this.defaultSku; + } + + /** + * Get the defaultStorageSize property: Default storage size. + * + * @return the defaultStorageSize value. + */ + public Integer defaultStorageSize() { + return this.defaultStorageSize; + } + + /** + * Get the supportedStorageEditions property: A list of supported storage editions. + * + * @return the supportedStorageEditions value. + */ + public List supportedStorageEditions() { + return this.supportedStorageEditions; + } + + /** + * Get the supportedSkus property: A list of supported Skus. + * + * @return the supportedSkus value. + */ + public List supportedSkus() { + return this.supportedSkus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedStorageEditions() != null) { + supportedStorageEditions().forEach(e -> e.validate()); + } + if (supportedSkus() != null) { + supportedSkus().forEach(e -> e.validate()); + } + } +} 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 a1a61efddc3e2..0c078c9b56e2e 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 @@ -17,13 +17,13 @@ public final class ServerForUpdate { * The cmk identity for the server. */ @JsonProperty(value = "identity") - private Identity identity; + private MySqlServerIdentity identity; /* * The SKU (pricing tier) of the server. */ @JsonProperty(value = "sku") - private Sku sku; + private MySqlServerSku sku; /* * The properties that can be updated for a server. @@ -47,7 +47,7 @@ public ServerForUpdate() { * * @return the identity value. */ - public Identity identity() { + public MySqlServerIdentity identity() { return this.identity; } @@ -57,7 +57,7 @@ public Identity identity() { * @param identity the identity value to set. * @return the ServerForUpdate object itself. */ - public ServerForUpdate withIdentity(Identity identity) { + public ServerForUpdate withIdentity(MySqlServerIdentity identity) { this.identity = identity; return this; } @@ -67,7 +67,7 @@ public ServerForUpdate withIdentity(Identity identity) { * * @return the sku value. */ - public Sku sku() { + public MySqlServerSku sku() { return this.sku; } @@ -77,7 +77,7 @@ public Sku sku() { * @param sku the sku value to set. * @return the ServerForUpdate object itself. */ - public ServerForUpdate withSku(Sku sku) { + public ServerForUpdate withSku(MySqlServerSku sku) { this.sku = sku; return this; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java index 43a2f45351179..a197da44bc3fe 100644 --- 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 @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Server gtid set parameters. */ +/** Server Gtid set parameters. */ @Fluent public final class ServerGtidSetParameter { /* - * The gtid set of server. + * The Gtid set of server. */ @JsonProperty(value = "gtidSet") private String gtidSet; @@ -21,7 +21,7 @@ public ServerGtidSetParameter() { } /** - * Get the gtidSet property: The gtid set of server. + * Get the gtidSet property: The Gtid set of server. * * @return the gtidSet value. */ @@ -30,7 +30,7 @@ public String gtidSet() { } /** - * Set the gtidSet property: The gtid set of server. + * Set the gtidSet property: The Gtid set of server. * * @param gtidSet the gtidSet value to set. * @return the ServerGtidSetParameter object itself. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java new file mode 100644 index 0000000000000..000d96e967e08 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The tier of the particular SKU, e.g. GeneralPurpose. */ +public final class ServerSkuTier extends ExpandableStringEnum { + /** Static value Burstable for ServerSkuTier. */ + public static final ServerSkuTier BURSTABLE = fromString("Burstable"); + + /** Static value GeneralPurpose for ServerSkuTier. */ + public static final ServerSkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** Static value MemoryOptimized for ServerSkuTier. */ + public static final ServerSkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Creates a new instance of ServerSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerSkuTier() { + } + + /** + * Creates or finds a ServerSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerSkuTier. + */ + @JsonCreator + public static ServerSkuTier fromString(String name) { + return fromString(name, ServerSkuTier.class); + } + + /** + * Gets known ServerSkuTier values. + * + * @return known ServerSkuTier values. + */ + public static Collection values() { + return values(ServerSkuTier.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java new file mode 100644 index 0000000000000..cb9b4578b6f12 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server version capabilities. */ +@Immutable +public final class ServerVersionCapabilityV2 { + /* + * server version + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** Creates an instance of ServerVersionCapabilityV2 class. */ + public ServerVersionCapabilityV2() { + } + + /** + * Get the name property: server version. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java new file mode 100644 index 0000000000000..b5e9b18793397 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.util.Context; + +/** Resource collection API of ServersMigrations. */ +public interface ServersMigrations { + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server. + */ + Server cutoverMigration(String resourceGroupName, String serverName); + + /** + * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a server. + */ + Server cutoverMigration(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java new file mode 100644 index 0000000000000..c7d0b2dd51ae9 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sku capability. */ +@Immutable +public final class SkuCapabilityV2 { + /* + * vCore name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * supported vCores + */ + @JsonProperty(value = "vCores", access = JsonProperty.Access.WRITE_ONLY) + private Long vCores; + + /* + * supported IOPS + */ + @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) + private Long supportedIops; + + /* + * supported memory per vCore in MB + */ + @JsonProperty(value = "supportedMemoryPerVCoreMB", access = JsonProperty.Access.WRITE_ONLY) + private Long supportedMemoryPerVCoreMB; + + /* + * Supported zones + */ + @JsonProperty(value = "supportedZones", access = JsonProperty.Access.WRITE_ONLY) + private List supportedZones; + + /* + * Supported high availability mode + */ + @JsonProperty(value = "supportedHAMode", access = JsonProperty.Access.WRITE_ONLY) + private List supportedHAMode; + + /** Creates an instance of SkuCapabilityV2 class. */ + public SkuCapabilityV2() { + } + + /** + * Get the name property: vCore name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the vCores property: supported vCores. + * + * @return the vCores value. + */ + public Long vCores() { + return this.vCores; + } + + /** + * Get the supportedIops property: supported IOPS. + * + * @return the supportedIops value. + */ + public Long supportedIops() { + return this.supportedIops; + } + + /** + * Get the supportedMemoryPerVCoreMB property: supported memory per vCore in MB. + * + * @return the supportedMemoryPerVCoreMB value. + */ + public Long supportedMemoryPerVCoreMB() { + return this.supportedMemoryPerVCoreMB; + } + + /** + * Get the supportedZones property: Supported zones. + * + * @return the supportedZones value. + */ + public List supportedZones() { + return this.supportedZones; + } + + /** + * Get the supportedHAMode property: Supported high availability mode. + * + * @return the supportedHAMode value. + */ + public List supportedHAMode() { + return this.supportedHAMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java deleted file mode 100644 index 2774f9ff1cc25..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The tier of the particular SKU, e.g. GeneralPurpose. */ -public final class SkuTier extends ExpandableStringEnum { - /** Static value Burstable for SkuTier. */ - public static final SkuTier BURSTABLE = fromString("Burstable"); - - /** Static value GeneralPurpose for SkuTier. */ - public static final SkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); - - /** Static value MemoryOptimized for SkuTier. */ - public static final SkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); - - /** - * Creates a new instance of SkuTier value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SkuTier() { - } - - /** - * Creates or finds a SkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuTier. - */ - @JsonCreator - public static SkuTier fromString(String name) { - return fromString(name, SkuTier.class); - } - - /** - * Gets known SkuTier values. - * - * @return known SkuTier values. - */ - public static Collection values() { - return values(SkuTier.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json new file mode 100644 index 0000000000000..f82ff2b113830 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsClientImpl$AzureADAdministratorsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsClientImpl$BackupsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsClientImpl$BackupAndExportsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersClientImpl$ServersService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersMigrationsClientImpl$ServersMigrationsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitySetsClientImpl$LocationBasedCapabilitySetsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckVirtualNetworkSubnetUsagesClientImpl$CheckVirtualNetworkSubnetUsagesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsClientImpl$CheckNameAvailabilityWithoutLocationsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationResultsClientImpl$OperationResultsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.mysqlflexibleserver.implementation.AdvancedThreatProtectionSettingsClientImpl$AdvancedThreatProtectionSettingsService" ] ] \ No newline at end of file diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/reflect-config.json b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/reflect-config.json new file mode 100644 index 0000000000000..3396ec11a4ddb --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mysqlflexibleserver/reflect-config.json @@ -0,0 +1,516 @@ +[ { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdministratorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.BackupRequestBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationForBatchUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.DatabaseListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRuleListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.Storage", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.Backup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.Network", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerPropertiesForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.LogFileListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitiesListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.StorageEditionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitySetsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesV2", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapabilityV2", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.DelegatedSubnetUsage", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.NameAvailabilityInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.IsConfigPendingRestart", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ServerState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceStorageType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java new file mode 100644 index 0000000000000..d86c3393faf93 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) 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.AdvancedThreatProtectionName; + +/** Samples for AdvancedThreatProtectionSettings Get. */ +public final class AdvancedThreatProtectionSettingsGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsGet.json + */ + /** + * Sample code: Get a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .getWithResponse( + "threatprotection-6852", + "threatprotection-2080", + AdvancedThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java new file mode 100644 index 0000000000000..2da668255ffdc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** Samples for AdvancedThreatProtectionSettings List. */ +public final class AdvancedThreatProtectionSettingsListSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsList.json + */ + /** + * Sample code: Get list of server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void getListOfServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .list("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.java new file mode 100644 index 0000000000000..a4ad44c52d8d3 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateSamples.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.generated; + +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; +import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; + +/** Samples for AdvancedThreatProtectionSettings Update. */ +public final class AdvancedThreatProtectionSettingsUpdateSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsPatchDisabled.json + */ + /** + * Sample code: Disable a server's Advanced Threat Protection settings with all parameters. + * + * @param manager Entry point to MySqlManager. + */ + public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParameters( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .update( + "threatprotection-4799", + "threatprotection-6440", + AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/AdvancedThreatProtectionSettingsPatchEnabled.json + */ + /** + * Sample code: Enable a server's Advanced Threat Protection settings. + * + * @param manager Entry point to MySqlManager. + */ + public static void enableAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .advancedThreatProtectionSettings() + .update( + "threatprotection-4799", + "threatprotection-6440", + AdvancedThreatProtectionName.DEFAULT, + new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), + com.azure.core.util.Context.NONE); + } +} 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 60d686e6cba1f..b3b93c368625e 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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorCreate.json */ /** * Sample code: Create an azure ad administrator. 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 abb971dbfb546..6cec0ee59e17d 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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorDelete.json */ /** * Sample code: Delete an azure ad administrator. 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 d4fb98587e0d3..f98ce64c425df 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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorGet.json */ /** * Sample code: Get an azure ad administrator. 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 956453d8bda36..6457e8b209d85 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/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorsListByServer.json */ /** * Sample code: List Azure AD administrators in a server. 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 index fbb01d91eb1db..68d04eba6ca17 100644 --- 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 @@ -12,7 +12,7 @@ /** 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupAndExport.json */ /** * Sample code: Create and Export Backup. 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 index 4f4c7cee72adc..552a3da12b77a 100644 --- 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 @@ -7,7 +7,7 @@ /** 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/ValidateBackup.json */ /** * Sample code: Validate Backup. 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 5108efd68a111..0c6c9cbc8f834 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/Backups/preview/2022-09-30-preview/examples/BackupGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-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 e3246d23dfb77..db4acd5dc7d42 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/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-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 b2e49f72cf080..43d5a1668d8a6 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/Backups/preview/2022-09-30-preview/examples/BackupPut.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-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 1b4d85575b47e..720963b4c04d3 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/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-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 a6c68f9eed147..2a52b2a6ac055 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/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-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 aceed539d542e..3e934ec91fb8b 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/ServiceOperations/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-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 159cdf8e709a5..a9d818c3c3453 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/Configurations/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-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 index 224db98d89536..44091ef0854d8 100644 --- 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 @@ -9,7 +9,7 @@ /** 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationCreateOrUpdate.json */ /** * Sample code: ConfigurationCreateOrUpdate. 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 2b2cbe872d5b1..f42d5d6386cb5 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/Configurations/preview/2021-12-01-preview/examples/ConfigurationGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-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 00b9fc9391a04..aae22490672af 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/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsListByServer.json */ /** * Sample code: List all configurations for a server. 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 a5900438681be..a6cdcc5cd950c 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 @@ -10,7 +10,7 @@ /** Samples for Configurations Update. */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. 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 90661cded5603..790d9b3f79a4c 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/Databases/preview/2021-12-01-preview/examples/DatabaseCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-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 f01b8aa2696dc..e03f599029fbd 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/Databases/preview/2021-12-01-preview/examples/DatabaseDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-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 4d3c65bca5aec..5e10441abc748 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/Databases/preview/2021-12-01-preview/examples/DatabaseGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-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 bb91f676dc8f8..9733501cd5c15 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/Databases/preview/2021-12-01-preview/examples/DatabasesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ /** * Sample code: List databases in a server. 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 84ecda3c44954..bdf8e3e994016 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/Firewall/preview/2021-12-01-preview/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ /** * Sample code: Create a firewall rule. 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 77e5e69ca4a3f..5cc19e1620e29 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/Firewall/preview/2021-12-01-preview/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleDelete.json */ /** * Sample code: Delete a firewall rule. 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 853bfe5a56f97..6c8e6da0401c0 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/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-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 fd00664fab19f..addecb6070a52 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/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-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 d38883b660733..2e1f66fabd403 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/ServiceOperations/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-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 a71984ac15fe4..45bdeaede77ec 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/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitiesByLocationList.json */ /** * Sample code: CapabilitiesList. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java new file mode 100644 index 0000000000000..211fe8cddf6c7 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) 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 LocationBasedCapabilitySet Get. */ +public final class LocationBasedCapabilitySetGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitySetByLocation.json + */ + /** + * Sample code: CapabilityResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilityResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().getWithResponse("WestUS", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java new file mode 100644 index 0000000000000..fcc64518a53c0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) 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 LocationBasedCapabilitySet List. */ +public final class LocationBasedCapabilitySetListSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitySetListByLocation.json + */ + /** + * Sample code: CapabilitySetsResult. + * + * @param manager Entry point to MySqlManager. + */ + public static void capabilitySetsResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilitySets().list("WestUS", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerSamples.java index ba4d000715f48..f9b3f3d8e21f0 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/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2023-06-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/OperationResultsGetSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationResultsGetSamples.java new file mode 100644 index 0000000000000..84d441e98b0c2 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationResultsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +/** Samples for OperationResults Get. */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/OperationResults_Get.json + */ + /** + * Sample code: OperationResults_Get. + * + * @param manager Entry point to MySqlManager. + */ + public static void operationResultsGet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager + .operationResults() + .getWithResponse( + "westus", "resource-provisioning-id-farmBeatsResourceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListSamples.java index 6c9412e341660..7e0c4659699ea 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/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-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 ae11afaf78b6f..692e1c04fac5b 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/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 3cbba0731a774..68b6224674454 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 @@ -13,11 +13,11 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; +import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; @@ -27,7 +27,7 @@ /** Samples for Servers Create. */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -61,7 +61,7 @@ public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserve .withRegion("southeastasia") .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) - .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) @@ -75,7 +75,7 @@ public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserve } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreateWithBYOK.json */ /** * Sample code: Create a server with byok. @@ -91,7 +91,7 @@ public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexible .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) .withIdentity( - new Identity() + new MySqlServerIdentity() .withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities( mapOf( @@ -99,7 +99,7 @@ public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexible SerializerFactory .createDefaultManagementSerializerAdapter() .deserialize("{}", Object.class, SerializerEncoding.JSON)))) - .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) @@ -122,7 +122,7 @@ public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexible } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerCreateWithPointInTimeRestore.json */ /** * Sample code: Create a server as a point in time restore. @@ -137,7 +137,7 @@ public static void createAServerAsAPointInTimeRestore( .withRegion("SoutheastAsia") .withExistingResourceGroup("TargetResourceGroup") .withTags(mapOf("num", "1")) - .withSku(new Sku().withName("Standard_D14_v2").withTier(SkuTier.GENERAL_PURPOSE)) + .withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE)) .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver") @@ -145,6 +145,7 @@ public static void createAServerAsAPointInTimeRestore( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 8b1976e48c45b..d1d19c62d76c3 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/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 e88d37df85c6e..9d263d34d6ca5 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/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 077beb7a1c2ab..343e6cb92526c 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/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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/FlexibleServers/preview/2022-09-30-preview/examples/ServerGet.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 e7681a57173fd..0d0e9d48df41e 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/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 26654ceac75f4..7f9f386d24e0b 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/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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/ServersMigrationCutoverMigrationSamples.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersMigrationCutoverMigrationSamples.java new file mode 100644 index 0000000000000..3c47c52e512c0 --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/samples/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersMigrationCutoverMigrationSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) 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 ServersMigration CutoverMigration. */ +public final class ServersMigrationCutoverMigrationSamples { + /* + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/CutoverMigration.json + */ + /** + * Sample code: Cutover migration for MySQL import. + * + * @param manager Entry point to MySqlManager. + */ + public static void cutoverMigrationForMySQLImport( + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.serversMigrations().cutoverMigration("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/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 index b9c14cb05698b..49684045ff019 100644 --- 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 @@ -9,7 +9,7 @@ /** 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 + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerResetGtid.json */ /** * Sample code: Reset GTID on a server. 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 f2a73a6fd27fa..a0467405fcd8e 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/FlexibleServers/preview/2022-09-30-preview/examples/ServerRestart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 96d9bbee285f0..5aa605e975075 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/FlexibleServers/preview/2022-09-30-preview/examples/ServerStart.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 5ae8062333809..a4273e5ef0464 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/FlexibleServers/preview/2022-09-30-preview/examples/ServerStop.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-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 1bcbeeccb91bd..4a6f03e1838e3 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 @@ -9,9 +9,10 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; +import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -21,7 +22,7 @@ /** Samples for Servers Update. */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: Update server customer maintenance window. @@ -47,7 +48,7 @@ public static void updateServerCustomerMaintenanceWindow( } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerUpdateWithBYOK.json */ /** * Sample code: Update server with byok. @@ -64,7 +65,7 @@ public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibles resource .update() .withIdentity( - new Identity() + new MySqlServerIdentity() .withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities( mapOf( @@ -85,7 +86,7 @@ public static void updateServerWithByok(com.azure.resourcemanager.mysqlflexibles } /* - * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-10-01-preview/examples/ServerUpdate.json */ /** * Sample code: Update a server. @@ -106,9 +107,11 @@ public static void updateAServer(com.azure.resourcemanager.mysqlflexibleserver.M .withIops(200) .withAutoGrow(EnableStatusEnum.DISABLED) .withAutoIoScaling(EnableStatusEnum.DISABLED)) + .withNetwork(new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 088aed1629bfb..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorListResultTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"dznrbtcqq\",\"sid\":\"qglhq\",\"tenantId\":\"ufo\",\"identityResourceId\":\"jywif\"},\"id\":\"esaagdfm\",\"name\":\"lzl\",\"type\":\"j\"}],\"nextLink\":\"ifkwmrvktsizntoc\"}") - .toObject(AdministratorListResult.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); - Assertions.assertEquals("dznrbtcqq", model.value().get(0).login()); - Assertions.assertEquals("qglhq", model.value().get(0).sid()); - Assertions.assertEquals("ufo", model.value().get(0).tenantId()); - Assertions.assertEquals("jywif", model.value().get(0).identityResourceId()); - Assertions.assertEquals("ifkwmrvktsizntoc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorListResult model = - new AdministratorListResult() - .withValue( - Arrays - .asList( - new AzureADAdministratorInner() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("dznrbtcqq") - .withSid("qglhq") - .withTenantId("ufo") - .withIdentityResourceId("jywif"))) - .withNextLink("ifkwmrvktsizntoc"); - model = BinaryData.fromObject(model).toObject(AdministratorListResult.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.value().get(0).administratorType()); - Assertions.assertEquals("dznrbtcqq", model.value().get(0).login()); - Assertions.assertEquals("qglhq", model.value().get(0).sid()); - Assertions.assertEquals("ufo", model.value().get(0).tenantId()); - Assertions.assertEquals("jywif", model.value().get(0).identityResourceId()); - Assertions.assertEquals("ifkwmrvktsizntoc", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdministratorPropertiesTests.java deleted file mode 100644 index 8f3b2a85142c2..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\":\"muf\",\"sid\":\"wnoi\",\"tenantId\":\"wlrxyb\",\"identityResourceId\":\"oqijgkdmbpaz\"}") - .toObject(AdministratorProperties.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("muf", model.login()); - Assertions.assertEquals("wnoi", model.sid()); - Assertions.assertEquals("wlrxyb", model.tenantId()); - Assertions.assertEquals("oqijgkdmbpaz", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorProperties model = - new AdministratorProperties() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("muf") - .withSid("wnoi") - .withTenantId("wlrxyb") - .withIdentityResourceId("oqijgkdmbpaz"); - model = BinaryData.fromObject(model).toObject(AdministratorProperties.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("muf", model.login()); - Assertions.assertEquals("wnoi", model.sid()); - Assertions.assertEquals("wlrxyb", model.tenantId()); - Assertions.assertEquals("oqijgkdmbpaz", model.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java deleted file mode 100644 index c8d38d73a0adb..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\":\"uv\",\"sid\":\"xpyb\",\"tenantId\":\"m\",\"identityResourceId\":\"mtz\"},\"id\":\"bsphrupidgsybbe\",\"name\":\"hphoycm\",\"type\":\"xaobhdxbmtqioqjz\"}") - .toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("uv", model.login()); - Assertions.assertEquals("xpyb", model.sid()); - Assertions.assertEquals("m", model.tenantId()); - Assertions.assertEquals("mtz", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureADAdministratorInner model = - new AzureADAdministratorInner() - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("uv") - .withSid("xpyb") - .withTenantId("m") - .withIdentityResourceId("mtz"); - model = BinaryData.fromObject(model).toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("uv", model.login()); - Assertions.assertEquals("xpyb", model.sid()); - Assertions.assertEquals("m", model.tenantId()); - Assertions.assertEquals("mtz", model.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java deleted file mode 100644 index a39b4423e33f6..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\":\"n\",\"sid\":\"bpzkafkuwbc\",\"tenantId\":\"wbme\",\"identityResourceId\":\"seyvj\"},\"id\":\"rts\",\"name\":\"hspkdeemao\",\"type\":\"mx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = - manager - .azureADAdministrators() - .define(AdministratorName.ACTIVE_DIRECTORY) - .withExistingFlexibleServer("azqugxywpmueefj", "wfqkquj") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("nobglaocq") - .withSid("ccm") - .withTenantId("udxytlmoyrx") - .withIdentityResourceId("fudwpznt") - .create(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("n", response.login()); - Assertions.assertEquals("bpzkafkuwbc", response.sid()); - Assertions.assertEquals("wbme", response.tenantId()); - Assertions.assertEquals("seyvj", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java deleted file mode 100644 index 0abb99561fb40..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .azureADAdministrators() - .delete( - "vlopwiyighx", - "kdwzbaiuebbaumny", - AdministratorName.ACTIVE_DIRECTORY, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java deleted file mode 100644 index a986bf6c24620..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"esap\",\"sid\":\"rdqmhjjdhtldwkyz\",\"tenantId\":\"utknc\",\"identityResourceId\":\"cwsvlxotog\"},\"id\":\"rupqsxvnmicy\",\"name\":\"vce\",\"type\":\"vei\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = - manager - .azureADAdministrators() - .getWithResponse( - "ped", "ojnabckhsmtxpsie", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("esap", response.login()); - Assertions.assertEquals("rdqmhjjdhtldwkyz", response.sid()); - Assertions.assertEquals("utknc", response.tenantId()); - Assertions.assertEquals("cwsvlxotog", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java deleted file mode 100644 index f61a8acf8b867..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\":\"wpn\",\"sid\":\"t\",\"tenantId\":\"nermcl\",\"identityResourceId\":\"lphox\"},\"id\":\"crpab\",\"name\":\"ye\",\"type\":\"sbj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.azureADAdministrators().listByServer("ovnotyfjfcnjbkcn", "dhbt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.iterator().next().administratorType()); - Assertions.assertEquals("wpn", response.iterator().next().login()); - Assertions.assertEquals("t", response.iterator().next().sid()); - Assertions.assertEquals("nermcl", response.iterator().next().tenantId()); - Assertions.assertEquals("lphox", response.iterator().next().identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java deleted file mode 100644 index 80663d6b1251c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportRequest model = - BinaryData - .fromString( - "{\"targetDetails\":{\"objectType\":\"BackupStoreDetails\"},\"backupSettings\":{\"backupName\":\"ixjsprozvcputeg\",\"backupFormat\":\"CollatedFormat\"}}") - .toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportRequest model = - new BackupAndExportRequest() - .withBackupSettings( - new BackupSettings() - .withBackupName("ixjsprozvcputeg") - .withBackupFormat(BackupFormat.COLLATED_FORMAT)) - .withTargetDetails(new BackupStoreDetails()); - model = BinaryData.fromObject(model).toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java deleted file mode 100644 index e0b534adfa36e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseInner model = - BinaryData - .fromString( - "{\"status\":\"CancelInProgress\",\"startTime\":\"2021-01-15T00:39:28Z\",\"endTime\":\"2021-04-04T07:45:50Z\",\"percentComplete\":13.198921536177277,\"properties\":{\"datasourceSizeInBytes\":8699509419424523906,\"dataTransferredInBytes\":7670793912698215607,\"backupMetadata\":\"jdpvwryo\"},\"id\":\"soacctazakl\",\"name\":\"lahbcryff\",\"type\":\"fdosyg\"}") - .toObject(BackupAndExportResponseInner.class); - Assertions.assertEquals(OperationStatus.CANCEL_IN_PROGRESS, model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T00:39:28Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T07:45:50Z"), model.endTime()); - Assertions.assertEquals(13.198921536177277D, model.percentComplete()); - Assertions.assertEquals(8699509419424523906L, model.datasourceSizeInBytes()); - Assertions.assertEquals(7670793912698215607L, model.dataTransferredInBytes()); - Assertions.assertEquals("jdpvwryo", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseInner model = - new BackupAndExportResponseInner() - .withStatus(OperationStatus.CANCEL_IN_PROGRESS) - .withStartTime(OffsetDateTime.parse("2021-01-15T00:39:28Z")) - .withEndTime(OffsetDateTime.parse("2021-04-04T07:45:50Z")) - .withPercentComplete(13.198921536177277D) - .withDatasourceSizeInBytes(8699509419424523906L) - .withDataTransferredInBytes(7670793912698215607L) - .withBackupMetadata("jdpvwryo"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseInner.class); - Assertions.assertEquals(OperationStatus.CANCEL_IN_PROGRESS, model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T00:39:28Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T07:45:50Z"), model.endTime()); - Assertions.assertEquals(13.198921536177277D, model.percentComplete()); - Assertions.assertEquals(8699509419424523906L, model.datasourceSizeInBytes()); - Assertions.assertEquals(7670793912698215607L, model.dataTransferredInBytes()); - Assertions.assertEquals("jdpvwryo", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java deleted file mode 100644 index ebbcadca87575..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseProperties model = - BinaryData - .fromString( - "{\"datasourceSizeInBytes\":4700894301237220319,\"dataTransferredInBytes\":1611067142281819203,\"backupMetadata\":\"hmsbzjhcrzevdp\"}") - .toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(4700894301237220319L, model.datasourceSizeInBytes()); - Assertions.assertEquals(1611067142281819203L, model.dataTransferredInBytes()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseProperties model = - new BackupAndExportResponseProperties() - .withDatasourceSizeInBytes(4700894301237220319L) - .withDataTransferredInBytes(1611067142281819203L) - .withBackupMetadata("hmsbzjhcrzevdp"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(4700894301237220319L, model.datasourceSizeInBytes()); - Assertions.assertEquals(1611067142281819203L, model.dataTransferredInBytes()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java deleted file mode 100644 index aa66ee2d20f2d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsCreateMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupAndExportsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"status\":\"Failed\",\"startTime\":\"2021-05-12T14:09:32Z\",\"endTime\":\"2021-06-10T19:37:21Z\",\"percentComplete\":85.74714071493332,\"properties\":{\"datasourceSizeInBytes\":6987699562222584934,\"dataTransferredInBytes\":4063358469478582470,\"backupMetadata\":\"bpbewtghfgb\"},\"id\":\"gw\",\"name\":\"zvlvqhjkbegib\",\"type\":\"nmxiebwwaloayqc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BackupAndExportResponse response = - manager - .backupAndExports() - .create( - "xujznbmpowu", - "przqlveu", - new BackupAndExportRequest() - .withBackupSettings( - new BackupSettings().withBackupName("lupj").withBackupFormat(BackupFormat.COLLATED_FORMAT)) - .withTargetDetails(new BackupStoreDetails()), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OperationStatus.FAILED, response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-12T14:09:32Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T19:37:21Z"), response.endTime()); - Assertions.assertEquals(85.74714071493332D, response.percentComplete()); - Assertions.assertEquals(6987699562222584934L, response.datasourceSizeInBytes()); - Assertions.assertEquals(4063358469478582470L, response.dataTransferredInBytes()); - Assertions.assertEquals("bpbewtghfgb", response.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java deleted file mode 100644 index 570f099b41220..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupAndExportsValidateBackupWithResponseMockTests { - @Test - public void testValidateBackupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"properties\":{\"numberOfContainers\":1242740761}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateBackupResponse response = - manager - .backupAndExports() - .validateBackupWithResponse("wrtz", "uzgwyzmhtx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1242740761, response.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java deleted file mode 100644 index 7937d01993052..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupRequestBase; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupRequestBase model = - BinaryData - .fromString( - "{\"backupSettings\":{\"backupName\":\"mfdatscmdvpj\",\"backupFormat\":\"CollatedFormat\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model = - new BackupRequestBase() - .withBackupSettings( - new BackupSettings().withBackupName("mfdatscmdvpj").withBackupFormat(BackupFormat.COLLATED_FORMAT)); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java deleted file mode 100644 index 4bede4e9d10ae..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupSettings model = - BinaryData - .fromString("{\"backupName\":\"suuv\",\"backupFormat\":\"CollatedFormat\"}") - .toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = - new BackupSettings().withBackupName("suuv").withBackupFormat(BackupFormat.COLLATED_FORMAT); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.COLLATED_FORMAT, model.backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java deleted file mode 100644 index 5df0c431be493..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; - -public final class BackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupStoreDetails model = - BinaryData.fromString("{\"objectType\":\"BackupStoreDetails\"}").toObject(BackupStoreDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupStoreDetails model = new BackupStoreDetails(); - model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java deleted file mode 100644 index c2641e8df5e81..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Backup; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import org.junit.jupiter.api.Assertions; - -public final class BackupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Backup model = - BinaryData - .fromString( - "{\"backupRetentionDays\":227486860,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-01-07T23:05:24Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(227486860, model.backupRetentionDays()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model = - new Backup().withBackupRetentionDays(227486860).withGeoRedundantBackup(EnableStatusEnum.DISABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(227486860, model.backupRetentionDays()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java deleted file mode 100644 index cc8bf8daf5c10..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\":\"ooxdjebwpuc\",\"completedTime\":\"2021-03-31T11:05:30Z\",\"source\":\"ovbvmeueciv\"},\"id\":\"zceuojgjrw\",\"name\":\"ueiotwmcdyt\",\"type\":\"x\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = - manager - .backups() - .getWithResponse("urqhaka", "hashsfwxosow", "xcug", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ooxdjebwpuc", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T11:05:30Z"), response.completedTime()); - Assertions.assertEquals("ovbvmeueciv", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java deleted file mode 100644 index dd719234c2a22..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\":\"isk\",\"completedTime\":\"2021-05-28T01:48:43Z\",\"source\":\"py\"},\"id\":\"klwndnhjdauwhv\",\"name\":\"l\",\"type\":\"zbtd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.backups().listByServer("it", "nrjawgqwg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("isk", response.iterator().next().backupType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-28T01:48:43Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("py", response.iterator().next().source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java deleted file mode 100644 index ca4d6c5e4f7c0..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\":\"pvfadmwsrcr\",\"completedTime\":\"2021-06-09T13:42:27Z\",\"source\":\"vgomz\"},\"id\":\"misgwbnb\",\"name\":\"e\",\"type\":\"dawkzbali\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = - manager - .backups() - .putWithResponse("gkvtmelmqkrhah", "ljuahaquhcdh", "duala", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pvfadmwsrcr", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T13:42:27Z"), response.completedTime()); - Assertions.assertEquals("vgomz", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java deleted file mode 100644 index c3e9c99e5e1ad..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\":\"jcrcczsqpjhvmda\",\"supportedHAMode\":[\"ysou\",\"q\"],\"supportedGeoBackupRegions\":[\"noae\"],\"supportedFlexibleServerEditions\":[]}],\"nextLink\":\"yhltrpmopjmcm\"}") - .toObject(CapabilitiesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesListResult model = new CapabilitiesListResult(); - model = BinaryData.fromObject(model).toObject(CapabilitiesListResult.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java deleted file mode 100644 index 431b825bd161c..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\":\"u\",\"supportedHAMode\":[\"hfuiuaodsfc\",\"kvxod\",\"uozmyzydagfua\",\"bezy\"],\"supportedGeoBackupRegions\":[\"kktwhrdxw\",\"ywqsmbsurexim\",\"ryocfsfksymdd\"],\"supportedFlexibleServerEditions\":[{\"name\":\"i\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]}]}") - .toObject(CapabilityPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesInner model = new CapabilityPropertiesInner(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesInner.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java deleted file mode 100644 index 6a60ca5ef57e4..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\":\"eptra\",\"nameAvailable\":false,\"reason\":\"zwl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilities() - .executeWithResponse( - "xiilivpdtiirqt", - new NameAvailabilityRequest().withName("qoaxoruzfgs").withType("yfxrx"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eptra", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("zwl", response.reason()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java deleted file mode 100644 index ef6277d6f7592..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\":\"bw\",\"nameAvailable\":false,\"reason\":\"emmsbvdkc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilityWithoutLocations() - .executeWithResponse( - new NameAvailabilityRequest().withName("nwxuqlcvydyp").withType("dooaojkniodko"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bw", response.message()); - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("emmsbvdkc", response.reason()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java deleted file mode 100644 index 777d653612161..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\":\"dfnbyxbaaabjyv\",\"subscriptionId\":\"ffimrzrtuzqogsex\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"dnw\",\"usage\":8846945468622284044},{\"subnetName\":\"zsyyceuzso\",\"usage\":8701091086223812338},{\"subnetName\":\"pfrxtrthzvay\",\"usage\":7184151913556268269},{\"subnetName\":\"brqubp\",\"usage\":134576264669262403}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualNetworkSubnetUsageResult response = - manager - .checkVirtualNetworkSubnetUsages() - .executeWithResponse( - "qmzqalkrmnjijpx", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("q"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java deleted file mode 100644 index 31e0105b4412a..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\":\"ftyxolniw\",\"source\":\"cukjf\"}") - .toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("ftyxolniw", model.value()); - Assertions.assertEquals("cukjf", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForBatchUpdateProperties model = - new ConfigurationForBatchUpdateProperties().withValue("ftyxolniw").withSource("cukjf"); - model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("ftyxolniw", model.value()); - Assertions.assertEquals("cukjf", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java deleted file mode 100644 index 86f0f887d506f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForBatchUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForBatchUpdate model = - BinaryData - .fromString( - "{\"name\":\"ldhugjzzdatqxh\",\"properties\":{\"value\":\"geablgphuticndvk\",\"source\":\"zwyiftyhxhur\"}}") - .toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.name()); - Assertions.assertEquals("geablgphuticndvk", model.value()); - Assertions.assertEquals("zwyiftyhxhur", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForBatchUpdate model = - new ConfigurationForBatchUpdate() - .withName("ldhugjzzdatqxh") - .withValue("geablgphuticndvk") - .withSource("zwyiftyhxhur"); - model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.name()); - Assertions.assertEquals("geablgphuticndvk", model.value()); - Assertions.assertEquals("zwyiftyhxhur", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java deleted file mode 100644 index 9380677896c77..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationInner model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"qtrgqjbpfzfsinzg\",\"currentValue\":\"cjrwzoxxjtfellu\",\"description\":\"zitonpeqfpjkjl\",\"documentationLink\":\"fpdvhpfxxypi\",\"defaultValue\":\"nmayhuybb\",\"dataType\":\"odepoogin\",\"allowedValues\":\"amiheognarxz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"yevc\",\"name\":\"iqihn\",\"type\":\"un\"}") - .toObject(ConfigurationInner.class); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.value()); - Assertions.assertEquals("cjrwzoxxjtfellu", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationInner model = - new ConfigurationInner() - .withValue("qtrgqjbpfzfsinzg") - .withCurrentValue("cjrwzoxxjtfellu") - .withSource(ConfigurationSource.SYSTEM_DEFAULT); - model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("qtrgqjbpfzfsinzg", model.value()); - Assertions.assertEquals("cjrwzoxxjtfellu", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java deleted file mode 100644 index fc5d91649ff20..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationListForBatchUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListForBatchUpdate model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"skcqvkocrcjd\",\"properties\":{\"value\":\"nh\",\"source\":\"njbiksqrglssain\"}},{\"name\":\"jwnzlljfmp\",\"properties\":{\"value\":\"bvmgxsabkyqduuji\",\"source\":\"jczdzevndh\"}},{\"name\":\"wpdappdsbdkv\",\"properties\":{\"value\":\"jfeusnh\",\"source\":\"je\"}}],\"resetAllToDefault\":\"True\"}") - .toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("skcqvkocrcjd", model.value().get(0).name()); - Assertions.assertEquals("nh", model.value().get(0).value()); - Assertions.assertEquals("njbiksqrglssain", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.TRUE, model.resetAllToDefault()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListForBatchUpdate model = - new ConfigurationListForBatchUpdate() - .withValue( - Arrays - .asList( - new ConfigurationForBatchUpdate() - .withName("skcqvkocrcjd") - .withValue("nh") - .withSource("njbiksqrglssain"), - new ConfigurationForBatchUpdate() - .withName("jwnzlljfmp") - .withValue("bvmgxsabkyqduuji") - .withSource("jczdzevndh"), - new ConfigurationForBatchUpdate() - .withName("wpdappdsbdkv") - .withValue("jfeusnh") - .withSource("je"))) - .withResetAllToDefault(ResetAllToDefault.TRUE); - model = BinaryData.fromObject(model).toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("skcqvkocrcjd", model.value().get(0).name()); - Assertions.assertEquals("nh", model.value().get(0).value()); - Assertions.assertEquals("njbiksqrglssain", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.TRUE, model.resetAllToDefault()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java deleted file mode 100644 index 2b06e57009056..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"value\":\"xklrypl\",\"currentValue\":\"kbasyypn\",\"description\":\"hsgcbacphejkot\",\"documentationLink\":\"qgoulznd\",\"defaultValue\":\"kwy\",\"dataType\":\"gfgibm\",\"allowedValues\":\"gakeqsr\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"tbciqfouflmm\",\"name\":\"kzsmodm\",\"type\":\"lougpbkw\"},{\"properties\":{\"value\":\"tduqktapspwgcuer\",\"currentValue\":\"mkdo\",\"description\":\"qw\",\"documentationLink\":\"mdgbbjfdd\",\"defaultValue\":\"bmbexppbhtqqro\",\"dataType\":\"p\",\"allowedValues\":\"s\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"yjgzjaoyfhrtxiln\",\"name\":\"rkujy\",\"type\":\"vlejuvfqa\"}],\"nextLink\":\"lyxwjkcprbnwbx\"}") - .toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("xklrypl", model.value().get(0).value()); - Assertions.assertEquals("kbasyypn", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("lyxwjkcprbnwbx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResultInner model = - new ConfigurationListResultInner() - .withValue( - Arrays - .asList( - new ConfigurationInner() - .withValue("xklrypl") - .withCurrentValue("kbasyypn") - .withSource(ConfigurationSource.USER_OVERRIDE), - new ConfigurationInner() - .withValue("tduqktapspwgcuer") - .withCurrentValue("mkdo") - .withSource(ConfigurationSource.SYSTEM_DEFAULT))) - .withNextLink("lyxwjkcprbnwbx"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("xklrypl", model.value().get(0).value()); - Assertions.assertEquals("kbasyypn", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("lyxwjkcprbnwbx", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java deleted file mode 100644 index 9a4bbb46998a9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationProperties model = - BinaryData - .fromString( - "{\"value\":\"wjzrnfygxgisp\",\"currentValue\":\"vtz\",\"description\":\"ufubl\",\"documentationLink\":\"fxqeof\",\"defaultValue\":\"e\",\"dataType\":\"hqjbasvmsmj\",\"allowedValues\":\"lngsntnbybkzgcwr\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}") - .toObject(ConfigurationProperties.class); - Assertions.assertEquals("wjzrnfygxgisp", model.value()); - Assertions.assertEquals("vtz", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationProperties model = - new ConfigurationProperties() - .withValue("wjzrnfygxgisp") - .withCurrentValue("vtz") - .withSource(ConfigurationSource.USER_OVERRIDE); - model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("wjzrnfygxgisp", model.value()); - Assertions.assertEquals("vtz", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java deleted file mode 100644 index 50c77450d1f09..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsBatchUpdateMockTests { - @Test - public void testBatchUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"luu\",\"name\":\"dttouwaboekqvkel\",\"type\":\"smv\"}],\"nextLink\":\"wyjsflhhcaalnjix\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationListResult response = - manager - .configurations() - .batchUpdate( - "pjzu", - "e", - new ConfigurationListForBatchUpdate() - .withValue( - Arrays - .asList( - new ConfigurationForBatchUpdate().withName("ltskzbbtd"), - new ConfigurationForBatchUpdate().withName("veekgpwozuhkfp"))) - .withResetAllToDefault(ResetAllToDefault.TRUE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wyjsflhhcaalnjix", response.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java deleted file mode 100644 index 8b43de778fc70..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"crsbfovasr\",\"currentValue\":\"v\",\"description\":\"hsqfsubcgjbirxbp\",\"documentationLink\":\"srfbjfdtwss\",\"defaultValue\":\"ftpvjzbexil\",\"dataType\":\"nfqqnvwp\",\"allowedValues\":\"taruoujmkcj\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"wj\",\"name\":\"wgdrjervnaenqp\",\"type\":\"hin\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .define("bpvjymjhx") - .withExistingFlexibleServer("grcfb", "nrmfqjhhk") - .withValue("n") - .withCurrentValue("divkrt") - .withSource(ConfigurationSource.SYSTEM_DEFAULT) - .create(); - - Assertions.assertEquals("crsbfovasr", response.value()); - Assertions.assertEquals("v", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index e16d7c4eb0a74..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"qtayri\",\"currentValue\":\"ro\",\"description\":\"bexrmcq\",\"documentationLink\":\"ycnojvknmefqsg\",\"defaultValue\":\"ah\",\"dataType\":\"jyzhpvgq\",\"allowedValues\":\"j\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"xkvugfhzov\",\"name\":\"wjvzunluthnn\",\"type\":\"rnxipei\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .getWithResponse("ts", "vjcbpwxqpsrknf", "guvriuhprwmd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qtayri", response.value()); - Assertions.assertEquals("ro", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java deleted file mode 100644 index 119a7b9b1852a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"value\":\"nalaulppg\",\"currentValue\":\"tpnapnyiropuhpig\",\"description\":\"gylgqgitxmedjvcs\",\"documentationLink\":\"n\",\"defaultValue\":\"wncwzzhxgktrmg\",\"dataType\":\"napkteoellw\",\"allowedValues\":\"fdygpfqbuaceopz\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"pcqeqx\",\"name\":\"lzdahzxctobgbkdm\",\"type\":\"izpost\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .configurations() - .listByServer( - "sxyawjoyaqcs", - "yjpkiidzyexz", - "eli", - "hnrztfol", - 1201064167, - 315550434, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nalaulppg", response.iterator().next().value()); - Assertions.assertEquals("tpnapnyiropuhpig", response.iterator().next().currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.iterator().next().source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java deleted file mode 100644 index 3cf9918015214..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\":\"tbvpysszdnru\",\"collation\":\"guhmuouqfpr\"},\"id\":\"wbnguitnwui\",\"name\":\"gazxuf\",\"type\":\"zuckyfi\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("tbvpysszdnru", model.charset()); - Assertions.assertEquals("guhmuouqfpr", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("tbvpysszdnru").withCollation("guhmuouqfpr"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("tbvpysszdnru", model.charset()); - Assertions.assertEquals("guhmuouqfpr", model.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java deleted file mode 100644 index d6785f02af91b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.DatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"charset\":\"dkfthwxmnt\",\"collation\":\"waopvkmijcmmxd\"},\"id\":\"fufsrpymzi\",\"name\":\"nsez\",\"type\":\"xtbzsgfyccsne\"},{\"properties\":{\"charset\":\"wzjeiach\",\"collation\":\"osfln\"},\"id\":\"sfqpteehz\",\"name\":\"vypyqrimzinpv\",\"type\":\"wjdk\"}],\"nextLink\":\"soodqxhcrmnoh\"}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("dkfthwxmnt", model.value().get(0).charset()); - Assertions.assertEquals("waopvkmijcmmxd", model.value().get(0).collation()); - Assertions.assertEquals("soodqxhcrmnoh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = - new DatabaseListResult() - .withValue( - Arrays - .asList( - new DatabaseInner().withCharset("dkfthwxmnt").withCollation("waopvkmijcmmxd"), - new DatabaseInner().withCharset("wzjeiach").withCollation("osfln"))) - .withNextLink("soodqxhcrmnoh"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("dkfthwxmnt", model.value().get(0).charset()); - Assertions.assertEquals("waopvkmijcmmxd", model.value().get(0).collation()); - Assertions.assertEquals("soodqxhcrmnoh", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java deleted file mode 100644 index 77a0b2d32d0b1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.DatabaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseProperties model = - BinaryData.fromString("{\"charset\":\"fidfvzw\",\"collation\":\"uht\"}").toObject(DatabaseProperties.class); - Assertions.assertEquals("fidfvzw", model.charset()); - Assertions.assertEquals("uht", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("fidfvzw").withCollation("uht"); - model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("fidfvzw", model.charset()); - Assertions.assertEquals("uht", model.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java deleted file mode 100644 index 8388fbdd42c61..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\":\"r\",\"collation\":\"dkwobdagx\"},\"id\":\"bqdxbx\",\"name\":\"akbogqxndlkzgxh\",\"type\":\"ripl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .define("nkww") - .withExistingFlexibleServer("d", "lvwiwubmwmbesl") - .withCharset("jflcxog") - .withCollation("konzmnsik") - .create(); - - Assertions.assertEquals("r", response.charset()); - Assertions.assertEquals("dkwobdagx", response.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java deleted file mode 100644 index 2f8dba8931b56..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("oygmift", "nzdndslgna", "qig", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java deleted file mode 100644 index e1be42ac73523..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\":\"ccymvaolpsslql\",\"collation\":\"mdnbbglzpswiy\"},\"id\":\"cwyhzdxssa\",\"name\":\"bzmnvdfznud\",\"type\":\"od\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .getWithResponse("nduhavhqlkthum", "qolbgyc", "uie", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ccymvaolpsslql", response.charset()); - Assertions.assertEquals("mdnbbglzpswiy", response.collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java deleted file mode 100644 index b167cfc09163b..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\":\"ucerscdntnevfi\",\"collation\":\"mygtdssls\"},\"id\":\"mweriofzpy\",\"name\":\"semwabnet\",\"type\":\"hhszh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.databases().listByServer("xzb", "cblylpstdbhhxsr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ucerscdntnevfi", response.iterator().next().charset()); - Assertions.assertEquals("mygtdssls", response.iterator().next().collation()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java deleted file mode 100644 index 3c525ee6c43b0..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\":\"tko\",\"usage\":3980056682158656120}") - .toObject(DelegatedSubnetUsage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelegatedSubnetUsage model = new DelegatedSubnetUsage(); - model = BinaryData.fromObject(model).toObject(DelegatedSubnetUsage.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java deleted file mode 100644 index ffc8b1ccd7086..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\":\"t\",\"endIpAddress\":\"kwh\"},\"id\":\"oifiyipjxsqwpgr\",\"name\":\"bznorcjxvsnby\",\"type\":\"qabnmoc\"}") - .toObject(FirewallRuleInner.class); - Assertions.assertEquals("t", model.startIpAddress()); - Assertions.assertEquals("kwh", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleInner model = new FirewallRuleInner().withStartIpAddress("t").withEndIpAddress("kwh"); - model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("t", model.startIpAddress()); - Assertions.assertEquals("kwh", model.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java deleted file mode 100644 index fdef3651c42bd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRuleListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"idtqajzyu\",\"endIpAddress\":\"pku\"},\"id\":\"krlkhbzhfepg\",\"name\":\"gqexzlocxs\",\"type\":\"paierh\"},{\"properties\":{\"startIpAddress\":\"bcsglumma\",\"endIpAddress\":\"tjaodxobnb\"},\"id\":\"k\",\"name\":\"pxokajionp\",\"type\":\"mexgstxgcp\"},{\"properties\":{\"startIpAddress\":\"dg\",\"endIpAddress\":\"aajrm\"},\"id\":\"jwzrl\",\"name\":\"vmclw\",\"type\":\"ijcoejctb\"}],\"nextLink\":\"qsqsy\"}") - .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("idtqajzyu", model.value().get(0).startIpAddress()); - Assertions.assertEquals("pku", model.value().get(0).endIpAddress()); - Assertions.assertEquals("qsqsy", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = - new FirewallRuleListResult() - .withValue( - Arrays - .asList( - new FirewallRuleInner().withStartIpAddress("idtqajzyu").withEndIpAddress("pku"), - new FirewallRuleInner().withStartIpAddress("bcsglumma").withEndIpAddress("tjaodxobnb"), - new FirewallRuleInner().withStartIpAddress("dg").withEndIpAddress("aajrm"))) - .withNextLink("qsqsy"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("idtqajzyu", model.value().get(0).startIpAddress()); - Assertions.assertEquals("pku", model.value().get(0).endIpAddress()); - Assertions.assertEquals("qsqsy", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java deleted file mode 100644 index 9f429a2a233e5..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\":\"cyshurzafbljjgp\",\"endIpAddress\":\"toqcjmklja\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("cyshurzafbljjgp", model.startIpAddress()); - Assertions.assertEquals("toqcjmklja", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleProperties model = - new FirewallRuleProperties().withStartIpAddress("cyshurzafbljjgp").withEndIpAddress("toqcjmklja"); - model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("cyshurzafbljjgp", model.startIpAddress()); - Assertions.assertEquals("toqcjmklja", model.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java deleted file mode 100644 index 0e069a2df5620..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\":\"sotbob\",\"endIpAddress\":\"dopcjwvnh\"},\"id\":\"d\",\"name\":\"mgxcxrslpm\",\"type\":\"twuoegrpkhjwni\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .define("pfuflrw") - .withExistingFlexibleServer("iiswacffgdkzze", "kfvhqcrailvpn") - .withStartIpAddress("mh") - .withEndIpAddress("lxyjr") - .create(); - - Assertions.assertEquals("sotbob", response.startIpAddress()); - Assertions.assertEquals("dopcjwvnh", response.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java deleted file mode 100644 index 0c6d516b6d1a0..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("podxunkb", "bxmubyynt", "lrb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java deleted file mode 100644 index 1d493a48d0423..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\":\"xbmp\",\"endIpAddress\":\"cjefuzmu\"},\"id\":\"bttdumorppxe\",\"name\":\"mnzb\",\"type\":\"bhjpglkfgohdne\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .getWithResponse("tkoievseotgq", "l", "tmuwlauwzi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xbmp", response.startIpAddress()); - Assertions.assertEquals("cjefuzmu", response.endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java deleted file mode 100644 index 40644a5e54145..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\":\"fikdowwqu\",\"endIpAddress\":\"v\"},\"id\":\"xclvit\",\"name\":\"hqzonosggbhcoh\",\"type\":\"wdsjnkalju\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.firewallRules().listByServer("el", "phsdyhto", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fikdowwqu", response.iterator().next().startIpAddress()); - Assertions.assertEquals("v", response.iterator().next().endIpAddress()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java deleted file mode 100644 index 12dfe3403df6a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FullBackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FullBackupStoreDetails model = - BinaryData - .fromString( - "{\"objectType\":\"FullBackupStoreDetails\",\"sasUriList\":[\"fpl\",\"mg\",\"xnkjzkdesl\"]}") - .toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("fpl", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FullBackupStoreDetails model = - new FullBackupStoreDetails().withSasUriList(Arrays.asList("fpl", "mg", "xnkjzkdesl")); - model = BinaryData.fromObject(model).toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("fpl", model.sasUriList().get(0)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java deleted file mode 100644 index b8fee4bec6c8e..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\":\"yp\"}") - .toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("yp", model.privateDnsZoneSuffix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = - new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("yp"); - model = BinaryData.fromObject(model).toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("yp", model.privateDnsZoneSuffix()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java deleted file mode 100644 index eb721b56b334c..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\":\"dtjinfw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GetPrivateDnsZoneSuffixResponse response = - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("dtjinfw", response.privateDnsZoneSuffix()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java deleted file mode 100644 index 2754e3f344f21..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\":\"Disabled\",\"state\":\"Healthy\",\"standbyAvailabilityZone\":\"vynhzgpphrcg\"}") - .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("vynhzgpphrcg", model.standbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailability model = - new HighAvailability().withMode(HighAvailabilityMode.DISABLED).withStandbyAvailabilityZone("vynhzgpphrcg"); - model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("vynhzgpphrcg", model.standbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java deleted file mode 100644 index 424fe9937c3a7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; -import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"icxm\",\"tenantId\":\"iwqvhkh\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"og\":\"datadtopbob\",\"w\":\"datam\",\"a\":\"dataa\"}}") - .toObject(Identity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = - new Identity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("og", "datadtopbob", "w", "datam", "a", "dataa")); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java deleted file mode 100644 index 9b796604d2519..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\":\"jwosytxitcskfck\",\"supportedHAMode\":[\"miekkezzikhlyfjh\",\"gqggebdunygae\",\"idb\"],\"supportedGeoBackupRegions\":[\"t\",\"xllrxcyjm\"],\"supportedFlexibleServerEditions\":[{\"name\":\"uvarmywdmjsjq\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"xrwlyc\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"xkgymareqnajxqu\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]},{\"name\":\"ubeddg\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[]}]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.locationBasedCapabilities().list("jrvxaglrv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java deleted file mode 100644 index 49711026fbb55..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\":4120497332139202867,\"createdTime\":\"2021-11-07T06:02Z\",\"type\":\"ynnaam\",\"lastModifiedTime\":\"2021-01-19T03:02:26Z\",\"url\":\"eh\"},\"id\":\"qsc\",\"name\":\"eypvhezrkg\",\"type\":\"hcjrefovgmk\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(4120497332139202867L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T06:02Z"), model.createdTime()); - Assertions.assertEquals("ynnaam", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T03:02:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("eh", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = - new LogFileInner() - .withSizeInKB(4120497332139202867L) - .withCreatedTime(OffsetDateTime.parse("2021-11-07T06:02Z")) - .withTypePropertiesType("ynnaam") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-19T03:02:26Z")) - .withUrl("eh"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(4120497332139202867L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T06:02Z"), model.createdTime()); - Assertions.assertEquals("ynnaam", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T03:02:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("eh", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java deleted file mode 100644 index dcf3be0f4c4a4..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFileListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogFileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"sizeInKB\":8576241637170958939,\"createdTime\":\"2021-04-30T01:01:25Z\",\"type\":\"ohctbqvudwx\",\"lastModifiedTime\":\"2021-03-23T22:55:01Z\",\"url\":\"vo\"},\"id\":\"ujjugwdkcglh\",\"name\":\"lazjdyggdtjixhbk\",\"type\":\"ofqweykhmenevfye\"}],\"nextLink\":\"whybcib\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(8576241637170958939L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T01:01:25Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("ohctbqvudwx", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T22:55:01Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("vo", model.value().get(0).url()); - Assertions.assertEquals("whybcib", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = - new LogFileListResult() - .withValue( - Arrays - .asList( - new LogFileInner() - .withSizeInKB(8576241637170958939L) - .withCreatedTime(OffsetDateTime.parse("2021-04-30T01:01:25Z")) - .withTypePropertiesType("ohctbqvudwx") - .withLastModifiedTime(OffsetDateTime.parse("2021-03-23T22:55:01Z")) - .withUrl("vo"))) - .withNextLink("whybcib"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(8576241637170958939L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T01:01:25Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("ohctbqvudwx", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T22:55:01Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("vo", model.value().get(0).url()); - Assertions.assertEquals("whybcib", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java deleted file mode 100644 index d33018466d0a8..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\":6110578012532965907,\"createdTime\":\"2021-08-20T18:32:02Z\",\"type\":\"xyqj\",\"lastModifiedTime\":\"2021-03-22T06:48:14Z\",\"url\":\"t\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(6110578012532965907L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T18:32:02Z"), model.createdTime()); - Assertions.assertEquals("xyqj", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T06:48:14Z"), model.lastModifiedTime()); - Assertions.assertEquals("t", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = - new LogFileProperties() - .withSizeInKB(6110578012532965907L) - .withCreatedTime(OffsetDateTime.parse("2021-08-20T18:32:02Z")) - .withType("xyqj") - .withLastModifiedTime(OffsetDateTime.parse("2021-03-22T06:48:14Z")) - .withUrl("t"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(6110578012532965907L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T18:32:02Z"), model.createdTime()); - Assertions.assertEquals("xyqj", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T06:48:14Z"), model.lastModifiedTime()); - Assertions.assertEquals("t", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java deleted file mode 100644 index 3909ae1b9dcf8..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\":2787297702458911120,\"createdTime\":\"2021-01-04T11:20:29Z\",\"type\":\"wneaiv\",\"lastModifiedTime\":\"2021-02-14T15:05:44Z\",\"url\":\"elpcirelsfeaenwa\"},\"id\":\"atklddxbjhwuaa\",\"name\":\"oz\",\"type\":\"osphyoul\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.logFiles().listByServer("mszkkfo", "rey", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(2787297702458911120L, response.iterator().next().sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T11:20:29Z"), response.iterator().next().createdTime()); - Assertions.assertEquals("wneaiv", response.iterator().next().typePropertiesType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-14T15:05:44Z"), response.iterator().next().lastModifiedTime()); - Assertions.assertEquals("elpcirelsfeaenwa", response.iterator().next().url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java deleted file mode 100644 index 318924cd151bb..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\":\"jqabcypmivkwlzuv\",\"startHour\":1436675141,\"startMinute\":1704525857,\"dayOfWeek\":1351999022}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("jqabcypmivkwlzuv", model.customWindow()); - Assertions.assertEquals(1436675141, model.startHour()); - Assertions.assertEquals(1704525857, model.startMinute()); - Assertions.assertEquals(1351999022, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = - new MaintenanceWindow() - .withCustomWindow("jqabcypmivkwlzuv") - .withStartHour(1436675141) - .withStartMinute(1704525857) - .withDayOfWeek(1351999022); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("jqabcypmivkwlzuv", model.customWindow()); - Assertions.assertEquals(1436675141, model.startHour()); - Assertions.assertEquals(1704525857, model.startMinute()); - Assertions.assertEquals(1351999022, model.dayOfWeek()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java deleted file mode 100644 index 30e4a72af9920..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\":\"azyxoegukg\",\"nameAvailable\":false,\"reason\":\"ucgygevqz\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals("azyxoegukg", model.message()); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("ucgygevqz", model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = - new NameAvailabilityInner().withMessage("azyxoegukg").withNameAvailable(false).withReason("ucgygevqz"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals("azyxoegukg", model.message()); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("ucgygevqz", model.reason()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java deleted file mode 100644 index 05d780a465c71..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"uknvudwti\",\"type\":\"bldngkpoc\"}") - .toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("uknvudwti", model.name()); - Assertions.assertEquals("bldngkpoc", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityRequest model = new NameAvailabilityRequest().withName("uknvudwti").withType("bldngkpoc"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("uknvudwti", model.name()); - Assertions.assertEquals("bldngkpoc", model.type()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java deleted file mode 100644 index 15f70b1ae7b88..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Network model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Disabled\",\"delegatedSubnetResourceId\":\"cpecfvmmcoofs\",\"privateDnsZoneResourceId\":\"zevgb\"}") - .toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("cpecfvmmcoofs", model.delegatedSubnetResourceId()); - Assertions.assertEquals("zevgb", model.privateDnsZoneResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Network model = - new Network() - .withPublicNetworkAccess(EnableStatusEnum.DISABLED) - .withDelegatedSubnetResourceId("cpecfvmmcoofs") - .withPrivateDnsZoneResourceId("zevgb"); - model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("cpecfvmmcoofs", model.delegatedSubnetResourceId()); - Assertions.assertEquals("zevgb", model.privateDnsZoneResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java deleted file mode 100644 index d8c88cd362af9..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\":\"vplwzbhv\",\"resource\":\"u\",\"operation\":\"osvmk\",\"description\":\"sxqu\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("vplwzbhv", model.provider()); - Assertions.assertEquals("u", model.resource()); - Assertions.assertEquals("osvmk", model.operation()); - Assertions.assertEquals("sxqu", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("vplwzbhv") - .withResource("u") - .withOperation("osvmk") - .withDescription("sxqu"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("vplwzbhv", model.provider()); - Assertions.assertEquals("u", model.resource()); - Assertions.assertEquals("osvmk", model.operation()); - Assertions.assertEquals("sxqu", model.description()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java deleted file mode 100644 index 0ec343fed873a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"nrs\",\"display\":{\"provider\":\"qidybyx\",\"resource\":\"fclhaaxdbabphlwr\",\"operation\":\"fkts\",\"description\":\"sucocmnyyazttbtw\"},\"origin\":\"qpuedckzywbiex\",\"properties\":{\"qwalmuzyoxaepd\":\"datayueaxibxujwb\",\"d\":\"datazjancuxr\",\"dbpgnxytxhp\":\"databavxbniwdjswzt\",\"lcuhxwtctyqiklb\":\"dataxbzpfzab\"}}") - .toObject(OperationInner.class); - Assertions.assertEquals("nrs", model.name()); - Assertions.assertEquals("qidybyx", model.display().provider()); - Assertions.assertEquals("fclhaaxdbabphlwr", model.display().resource()); - Assertions.assertEquals("fkts", model.display().operation()); - Assertions.assertEquals("sucocmnyyazttbtw", model.display().description()); - Assertions.assertEquals("qpuedckzywbiex", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = - new OperationInner() - .withName("nrs") - .withDisplay( - new OperationDisplay() - .withProvider("qidybyx") - .withResource("fclhaaxdbabphlwr") - .withOperation("fkts") - .withDescription("sucocmnyyazttbtw")) - .withOrigin("qpuedckzywbiex") - .withProperties( - mapOf( - "qwalmuzyoxaepd", - "datayueaxibxujwb", - "d", - "datazjancuxr", - "dbpgnxytxhp", - "databavxbniwdjswzt", - "lcuhxwtctyqiklb", - "dataxbzpfzab")); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("nrs", model.name()); - Assertions.assertEquals("qidybyx", model.display().provider()); - Assertions.assertEquals("fclhaaxdbabphlwr", model.display().resource()); - Assertions.assertEquals("fkts", model.display().operation()); - Assertions.assertEquals("sucocmnyyazttbtw", model.display().description()); - Assertions.assertEquals("qpuedckzywbiex", model.origin()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java deleted file mode 100644 index 8874fc9a19c1b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationDisplay; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"izcdrqjsd\",\"display\":{\"provider\":\"nfyhx\",\"resource\":\"oejzi\",\"operation\":\"ifsjttgzfbishcb\",\"description\":\"ajdeyeamdphaga\"},\"origin\":\"buxwgip\",\"properties\":{\"nkixzbinj\":\"datanowkgshw\",\"tmryw\":\"datapu\"}},{\"name\":\"zoqftiyqzrnkcqvy\",\"display\":{\"provider\":\"hzls\",\"resource\":\"ohoqqnwvlryav\",\"operation\":\"heun\",\"description\":\"qhgyxzkonocukok\"},\"origin\":\"axuconuq\",\"properties\":{\"rmjmwvvjektc\":\"datakbeype\",\"frzpwvlqdqgb\":\"datasenhwlrs\"}},{\"name\":\"ylihkaetckt\",\"display\":{\"provider\":\"ivfsnk\",\"resource\":\"uctqhjfbe\",\"operation\":\"jcxerfuwu\",\"description\":\"txfvjrbirph\"},\"origin\":\"pcyvahfnljkyqx\",\"properties\":{\"jljyoxgv\":\"dataujqgidok\",\"szzhbijhtxfvgxbf\":\"dataltbgsncghkj\",\"ec\":\"datamxnehmp\",\"gr\":\"datagodebfqkkrbmpu\"}},{\"name\":\"flz\",\"display\":{\"provider\":\"xzpuzycisp\",\"resource\":\"zahmgkbrpyydhibn\",\"operation\":\"qkpikadrgvtqagnb\",\"description\":\"nhijggmebfsi\"},\"origin\":\"butr\",\"properties\":{\"zmhjrunmp\":\"datana\",\"nkxmyskpbhenbtk\":\"datattdbhrbnl\"}}],\"nextLink\":\"ywn\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("izcdrqjsd", model.value().get(0).name()); - Assertions.assertEquals("nfyhx", model.value().get(0).display().provider()); - Assertions.assertEquals("oejzi", model.value().get(0).display().resource()); - Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).display().operation()); - Assertions.assertEquals("ajdeyeamdphaga", model.value().get(0).display().description()); - Assertions.assertEquals("buxwgip", model.value().get(0).origin()); - Assertions.assertEquals("ywn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = - new OperationListResult() - .withValue( - Arrays - .asList( - new OperationInner() - .withName("izcdrqjsd") - .withDisplay( - new OperationDisplay() - .withProvider("nfyhx") - .withResource("oejzi") - .withOperation("ifsjttgzfbishcb") - .withDescription("ajdeyeamdphaga")) - .withOrigin("buxwgip") - .withProperties(mapOf("nkixzbinj", "datanowkgshw", "tmryw", "datapu")), - new OperationInner() - .withName("zoqftiyqzrnkcqvy") - .withDisplay( - new OperationDisplay() - .withProvider("hzls") - .withResource("ohoqqnwvlryav") - .withOperation("heun") - .withDescription("qhgyxzkonocukok")) - .withOrigin("axuconuq") - .withProperties(mapOf("rmjmwvvjektc", "datakbeype", "frzpwvlqdqgb", "datasenhwlrs")), - new OperationInner() - .withName("ylihkaetckt") - .withDisplay( - new OperationDisplay() - .withProvider("ivfsnk") - .withResource("uctqhjfbe") - .withOperation("jcxerfuwu") - .withDescription("txfvjrbirph")) - .withOrigin("pcyvahfnljkyqx") - .withProperties( - mapOf( - "jljyoxgv", - "dataujqgidok", - "szzhbijhtxfvgxbf", - "dataltbgsncghkj", - "ec", - "datamxnehmp", - "gr", - "datagodebfqkkrbmpu")), - new OperationInner() - .withName("flz") - .withDisplay( - new OperationDisplay() - .withProvider("xzpuzycisp") - .withResource("zahmgkbrpyydhibn") - .withOperation("qkpikadrgvtqagnb") - .withDescription("nhijggmebfsi")) - .withOrigin("butr") - .withProperties(mapOf("zmhjrunmp", "datana", "nkxmyskpbhenbtk", "datattdbhrbnl")))) - .withNextLink("ywn"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("izcdrqjsd", model.value().get(0).name()); - Assertions.assertEquals("nfyhx", model.value().get(0).display().provider()); - Assertions.assertEquals("oejzi", model.value().get(0).display().resource()); - Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).display().operation()); - Assertions.assertEquals("ajdeyeamdphaga", model.value().get(0).display().description()); - Assertions.assertEquals("buxwgip", model.value().get(0).origin()); - Assertions.assertEquals("ywn", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java deleted file mode 100644 index 25adadc91f099..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\":\"fltkacjv\",\"display\":{\"provider\":\"dlfoakggkfp\",\"resource\":\"ao\",\"operation\":\"ulpqblylsyxkqjn\",\"description\":\"ervtiagxs\"},\"origin\":\"zuempsbzkf\",\"properties\":{\"dxrbuukzcle\":\"datayvpnqicvinvkjj\",\"fn\":\"datayhmlwpaztzp\",\"fz\":\"datackw\",\"feqztppriol\":\"datawhxxbuyqax\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fltkacjv", response.iterator().next().name()); - Assertions.assertEquals("dlfoakggkfp", response.iterator().next().display().provider()); - Assertions.assertEquals("ao", response.iterator().next().display().resource()); - Assertions.assertEquals("ulpqblylsyxkqjn", response.iterator().next().display().operation()); - Assertions.assertEquals("ervtiagxs", response.iterator().next().display().description()); - Assertions.assertEquals("zuempsbzkf", response.iterator().next().origin()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java deleted file mode 100644 index b08a84759d5aa..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\":\"ouajpsqucmpoyf\",\"completedTime\":\"2021-02-06T21:08:58Z\",\"source\":\"gknygjofjddeqs\"},\"id\":\"eupewnwreitjz\",\"name\":\"flusarhmof\",\"type\":\"qhsmyurkdtml\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = - new ServerBackupInner() - .withBackupType("ouajpsqucmpoyf") - .withCompletedTime(OffsetDateTime.parse("2021-02-06T21:08:58Z")) - .withSource("gknygjofjddeqs"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java deleted file mode 100644 index 2a912fbd6c1e8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"t\",\"completedTime\":\"2021-02-24T11:34:50Z\",\"source\":\"hmwhfpmrqo\"},\"id\":\"tu\",\"name\":\"knryrtihfxtij\",\"type\":\"pzvgnwzsymglzufc\"},{\"properties\":{\"backupType\":\"ohdbihanufh\",\"completedTime\":\"2021-01-11T10:02:32Z\",\"source\":\"y\"},\"id\":\"git\",\"name\":\"xqhabi\",\"type\":\"pikxwczbyscnpqxu\"},{\"properties\":{\"backupType\":\"y\",\"completedTime\":\"2021-06-17T16:29:35Z\",\"source\":\"b\"},\"id\":\"rkxvdum\",\"name\":\"grtfwvu\",\"type\":\"xgaudccs\"},{\"properties\":{\"backupType\":\"jcny\",\"completedTime\":\"2021-04-04T05:13:51Z\",\"source\":\"ryhtnapczwlokjy\"},\"id\":\"kkvnipjox\",\"name\":\"jnchgej\",\"type\":\"podmailzydehojwy\"}],\"nextLink\":\"uxinpmqnjaq\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals("t", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T11:34:50Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hmwhfpmrqo", model.value().get(0).source()); - Assertions.assertEquals("uxinpmqnjaq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model = - new ServerBackupListResult() - .withValue( - Arrays - .asList( - new ServerBackupInner() - .withBackupType("t") - .withCompletedTime(OffsetDateTime.parse("2021-02-24T11:34:50Z")) - .withSource("hmwhfpmrqo"), - new ServerBackupInner() - .withBackupType("ohdbihanufh") - .withCompletedTime(OffsetDateTime.parse("2021-01-11T10:02:32Z")) - .withSource("y"), - new ServerBackupInner() - .withBackupType("y") - .withCompletedTime(OffsetDateTime.parse("2021-06-17T16:29:35Z")) - .withSource("b"), - new ServerBackupInner() - .withBackupType("jcny") - .withCompletedTime(OffsetDateTime.parse("2021-04-04T05:13:51Z")) - .withSource("ryhtnapczwlokjy"))) - .withNextLink("uxinpmqnjaq"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals("t", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T11:34:50Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hmwhfpmrqo", model.value().get(0).source()); - Assertions.assertEquals("uxinpmqnjaq", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java deleted file mode 100644 index 437ee3b16beba..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\":\"ekuksjtx\",\"completedTime\":\"2021-01-21T08:28Z\",\"source\":\"mparcryuanzw\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = - new ServerBackupProperties() - .withBackupType("ekuksjtx") - .withCompletedTime(OffsetDateTime.parse("2021-01-21T08:28Z")) - .withSource("mparcryuanzw"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java deleted file mode 100644 index baf7e07041175..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\":\"udxorrqn\",\"supportedStorageEditions\":[{\"name\":\"zvyifqrvkdvj\",\"minStorageSize\":3602114313463571295,\"maxStorageSize\":5675151701558960603,\"minBackupRetentionDays\":628578749185712506,\"maxBackupRetentionDays\":524078729547921435},{\"name\":\"n\",\"minStorageSize\":2611651142530368234,\"maxStorageSize\":3827252947498209847,\"minBackupRetentionDays\":9207665581714486982,\"maxBackupRetentionDays\":5624751011195276042}],\"supportedServerVersions\":[{\"name\":\"zb\",\"supportedSkus\":[]},{\"name\":\"ovm\",\"supportedSkus\":[]}]}") - .toObject(ServerEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerEditionCapability model = new ServerEditionCapability(); - model = BinaryData.fromObject(model).toObject(ServerEditionCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java deleted file mode 100644 index 51be22043872c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import org.junit.jupiter.api.Assertions; - -public final class ServerGtidSetParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerGtidSetParameter model = - BinaryData.fromString("{\"gtidSet\":\"esnzwde\"}").toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("esnzwde", model.gtidSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerGtidSetParameter model = new ServerGtidSetParameter().withGtidSet("esnzwde"); - model = BinaryData.fromObject(model).toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("esnzwde", model.gtidSet()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java deleted file mode 100644 index 93d2ff7db7297..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\":1752385169}") - .toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); - Assertions.assertEquals(1752385169, model.maxFailoverSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerRestartParameter model = - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(1752385169); - model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover()); - Assertions.assertEquals(1752385169, model.maxFailoverSeconds()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java deleted file mode 100644 index db65042c447cd..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\":\"zjuqkhrsaj\",\"supportedSkus\":[{\"name\":\"ofoskghs\",\"vCores\":7334574875693973004,\"supportedIops\":6549860277400431394,\"supportedMemoryPerVCoreMB\":5129594388409222078}]}") - .toObject(ServerVersionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapability model = new ServerVersionCapability(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java deleted file mode 100644 index 3b296668c3d64..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("qsluicp", "ggkzzlvmbmpa", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java deleted file mode 100644 index 617d3370a27cd..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("plsaknynfsynljph", "op", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java deleted file mode 100644 index fd8d8099a8f71..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersResetGtidMockTests { - @Test - public void testResetGtid() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MySqlManager manager = - MySqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .servers() - .resetGtid( - "cdpu", - "nzgmwznmabik", - new ServerGtidSetParameter().withGtidSet("orgjhxbldt"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java deleted file mode 100644 index ffe2344ca81f4..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( - "odlqiyntor", - "ihleos", - new ServerRestartParameter() - .withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(2014449644), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java deleted file mode 100644 index 1e0f887af4d4b..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("mslyzrpzbchckqqz", "ioxiysuiizyn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java deleted file mode 100644 index 68335a94dd406..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("edyatrwyhqmibzyh", "itsmypyyn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java deleted file mode 100644 index 02c0a3e6c4dc4..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\":\"duugidyjr\",\"vCores\":3682891038702940178,\"supportedIops\":7621842593771814376,\"supportedMemoryPerVCoreMB\":122532505466115624}") - .toObject(SkuCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability(); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java deleted file mode 100644 index a8255ad4d5c91..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"hrzayvvtpgvdf\",\"tier\":\"Burstable\"}").toObject(Sku.class); - Assertions.assertEquals("hrzayvvtpgvdf", model.name()); - Assertions.assertEquals(SkuTier.BURSTABLE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("hrzayvvtpgvdf").withTier(SkuTier.BURSTABLE); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("hrzayvvtpgvdf", model.name()); - Assertions.assertEquals(SkuTier.BURSTABLE, model.tier()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java deleted file mode 100644 index f17266284eab3..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\":\"cspkwlhzdobpxjmf\",\"minStorageSize\":885653517533476770,\"maxStorageSize\":6115186458339394637,\"minBackupRetentionDays\":5158769929678256713,\"maxBackupRetentionDays\":8269509488732598965}") - .toObject(StorageEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageEditionCapability model = new StorageEditionCapability(); - model = BinaryData.fromObject(model).toObject(StorageEditionCapability.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java deleted file mode 100644 index e57eb6c8e246f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; -import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; -import org.junit.jupiter.api.Assertions; - -public final class StorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Storage model = - BinaryData - .fromString( - "{\"storageSizeGB\":1338183758,\"iops\":837766841,\"autoGrow\":\"Disabled\",\"logOnDisk\":\"Disabled\",\"storageSku\":\"owskanyktz\",\"autoIoScaling\":\"Enabled\"}") - .toObject(Storage.class); - Assertions.assertEquals(1338183758, model.storageSizeGB()); - Assertions.assertEquals(837766841, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = - new Storage() - .withStorageSizeGB(1338183758) - .withIops(837766841) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withLogOnDisk(EnableStatusEnum.DISABLED) - .withAutoIoScaling(EnableStatusEnum.ENABLED); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(1338183758, model.storageSizeGB()); - Assertions.assertEquals(837766841, model.iops()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java deleted file mode 100644 index 5393e709416d5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ValidateBackupResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateBackupResponseInner model = - BinaryData - .fromString("{\"properties\":{\"numberOfContainers\":148902907}}") - .toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(148902907, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseInner model = new ValidateBackupResponseInner().withNumberOfContainers(148902907); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(148902907, model.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java deleted file mode 100644 index 912134480d1c8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class ValidateBackupResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateBackupResponseProperties model = - BinaryData - .fromString("{\"numberOfContainers\":757345112}") - .toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(757345112, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseProperties model = - new ValidateBackupResponseProperties().withNumberOfContainers(757345112); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(757345112, model.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java deleted file mode 100644 index ecb2818a5cf8d..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\":\"sonpclhocohs\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("sonpclhocohs", model.virtualNetworkResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("sonpclhocohs"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("sonpclhocohs", model.virtualNetworkResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java deleted file mode 100644 index 673e18f9e1cd8..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\":\"ev\",\"subscriptionId\":\"ggzfbu\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"faxkffeii\",\"usage\":8222423909788566095},{\"subnetName\":\"ez\",\"usage\":9115490458846755949},{\"subnetName\":\"mzsb\",\"usage\":3522178877698458456},{\"subnetName\":\"igrxwburvjxxjn\",\"usage\":8439639335334985317}]}") - .toObject(VirtualNetworkSubnetUsageResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } -}