From bb8e7c7d01feca9d480e6bf58077fd5f9971fe62 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Mar 2023 06:20:22 +0000 Subject: [PATCH] CodeGen from PR 22799 in Azure/azure-rest-api-specs Merge c6cfcca472a62d030b068143dd2cb613a5db4b52 into aa85f59e259c4b12197b57b221067c40fa2fe3f1 --- .../CHANGELOG.md | 4 +- .../README.md | 27 +- .../SAMPLE.md | 201 +-- .../pom.xml | 10 +- .../SqlVirtualMachineManager.java | 19 +- .../AvailabilityGroupListenersClient.java | 24 +- .../fluent/SqlVirtualMachineGroupsClient.java | 12 +- .../SqlVirtualMachineManagementClient.java | 7 + .../SqlVirtualMachineTroubleshootsClient.java | 81 ++ .../fluent/SqlVirtualMachinesClient.java | 200 +-- .../AvailabilityGroupListenerInner.java | 4 + .../AvailabilityGroupListenerProperties.java | 4 + .../fluent/models/OperationInner.java | 4 + .../models/SqlVirtualMachineGroupInner.java | 4 + .../SqlVirtualMachineGroupProperties.java | 4 + .../fluent/models/SqlVirtualMachineInner.java | 18 +- .../models/SqlVirtualMachineProperties.java | 29 +- .../models/SqlVmTroubleshootingInner.java | 149 +++ .../AvailabilityGroupListenersClientImpl.java | 75 +- .../AvailabilityGroupListenersImpl.java | 22 +- .../implementation/OperationsClientImpl.java | 2 +- .../SqlVirtualMachineGroupsClientImpl.java | 40 +- .../SqlVirtualMachineGroupsImpl.java | 20 +- .../implementation/SqlVirtualMachineImpl.java | 5 + ...SqlVirtualMachineManagementClientImpl.java | 16 +- ...VirtualMachineTroubleshootsClientImpl.java | 367 ++++++ .../SqlVirtualMachineTroubleshootsImpl.java | 57 + .../SqlVirtualMachinesClientImpl.java | 1091 ++++++++--------- .../SqlVirtualMachinesImpl.java | 52 +- .../SqlVmTroubleshootingImpl.java | 52 + .../models/AadAuthenticationSettings.java | 53 + ...dditionalFeaturesServerConfigurations.java | 4 + .../models/AgConfiguration.java | 4 + .../sqlvirtualmachine/models/AgReplica.java | 4 + .../models/AssessmentSettings.java | 24 +- .../models/AutoBackupDaysOfWeek.java | 9 + .../models/AutoBackupSettings.java | 4 + .../models/AutoPatchingSettings.java | 4 + .../AvailabilityGroupListenerListResult.java | 4 + .../models/AvailabilityGroupListeners.java | 24 +- .../models/BackupScheduleType.java | 9 + .../models/ClusterConfiguration.java | 9 + .../models/ClusterManagerType.java | 9 + .../models/ClusterSubnetType.java | 9 + .../sqlvirtualmachine/models/Commit.java | 9 + .../models/ConnectivityType.java | 9 + .../models/DiskConfigurationType.java | 9 + .../sqlvirtualmachine/models/Failover.java | 9 + .../models/FullBackupFrequencyType.java | 9 + .../models/IdentityType.java | 9 + .../models/KeyVaultCredentialSettings.java | 4 + .../models/LeastPrivilegeMode.java | 12 + .../models/LoadBalancerConfiguration.java | 4 + .../models/MultiSubnetIpConfiguration.java | 4 + .../models/OperationDisplay.java | 4 + .../models/OperationListResult.java | 4 + .../models/OperationOrigin.java | 9 + .../models/PrivateIpAddress.java | 4 + .../models/ReadableSecondary.java | 9 + .../models/ResourceIdentity.java | 4 + .../sqlvirtualmachine/models/Role.java | 9 + .../sqlvirtualmachine/models/ScaleType.java | 9 + .../sqlvirtualmachine/models/Schedule.java | 4 + ...erverConfigurationsManagementSettings.java | 34 + .../models/SqlConnectivityUpdateSettings.java | 4 + .../sqlvirtualmachine/models/SqlImageSku.java | 9 + .../models/SqlInstanceSettings.java | 4 + .../models/SqlManagementMode.java | 9 + .../models/SqlServerLicenseType.java | 9 + .../models/SqlStorageSettings.java | 4 + .../models/SqlStorageUpdateSettings.java | 4 + .../models/SqlTempDbSettings.java | 4 + .../models/SqlVirtualMachine.java | 21 +- .../SqlVirtualMachineGroupListResult.java | 4 + .../models/SqlVirtualMachineGroupUpdate.java | 4 + .../models/SqlVirtualMachineGroups.java | 12 +- .../models/SqlVirtualMachineListResult.java | 4 + .../SqlVirtualMachineTroubleshoots.java | 42 + .../models/SqlVirtualMachineUpdate.java | 4 + .../models/SqlVirtualMachines.java | 58 +- .../models/SqlVmGroupImageSku.java | 9 + .../models/SqlVmTroubleshooting.java | 53 + .../models/SqlWorkloadType.java | 9 + .../models/SqlWorkloadTypeUpdateSettings.java | 4 + .../models/StorageConfigurationSettings.java | 4 + .../models/StorageWorkloadType.java | 9 + .../TroubleshootingAdditionalProperties.java | 53 + .../models/TroubleshootingScenario.java | 44 + .../models/TroubleshootingStatus.java | 118 ++ .../models/UnhealthyReplicaInfo.java | 50 + .../models/WsfcDomainCredentials.java | 4 + .../models/WsfcDomainProfile.java | 4 + ...tyGroupListenersCreateOrUpdateSamples.java | 4 +- ...ailabilityGroupListenersDeleteSamples.java | 8 +- .../AvailabilityGroupListenersGetSamples.java | 8 +- ...ilityGroupListenersListByGroupSamples.java | 6 +- .../generated/OperationsListSamples.java | 6 +- ...ualMachineGroupsCreateOrUpdateSamples.java | 4 +- .../SqlVirtualMachineGroupsDeleteSamples.java | 6 +- ...achineGroupsGetByResourceGroupSamples.java | 8 +- ...chineGroupsListByResourceGroupSamples.java | 6 +- .../SqlVirtualMachineGroupsListSamples.java | 6 +- .../SqlVirtualMachineGroupsUpdateSamples.java | 5 +- ...achineTroubleshootTroubleshootSamples.java | 39 + ...lVirtualMachinesCreateOrUpdateSamples.java | 35 +- .../SqlVirtualMachinesDeleteSamples.java | 6 +- ...tualMachinesGetByResourceGroupSamples.java | 8 +- ...ualMachinesListByResourceGroupSamples.java | 6 +- ...irtualMachinesListBySqlVmGroupSamples.java | 6 +- .../SqlVirtualMachinesListSamples.java | 6 +- .../SqlVirtualMachinesRedeploySamples.java | 10 +- ...VirtualMachinesStartAssessmentSamples.java | 10 +- .../SqlVirtualMachinesUpdateSamples.java | 5 +- ...onalFeaturesServerConfigurationsTests.java | 29 - .../generated/AgConfigurationTests.java | 53 - .../generated/AgReplicaTests.java | 47 - .../generated/AssessmentSettingsTests.java | 53 - .../generated/AutoBackupSettingsTests.java | 80 -- .../generated/AutoPatchingSettingsTests.java | 41 - .../AvailabilityGroupListenerInnerTests.java | 79 -- ...ilabilityGroupListenerListResultTests.java | 26 - ...ilabilityGroupListenerPropertiesTests.java | 144 --- ...lityGroupListenersCreateOrUpdateTests.java | 81 -- ...AvailabilityGroupListenersDeleteTests.java | 62 - ...abilityGroupListenersListByGroupTests.java | 71 -- .../KeyVaultCredentialSettingsTests.java | 43 - .../LoadBalancerConfigurationTests.java | 47 - .../MultiSubnetIpConfigurationTests.java | 38 - .../generated/OperationDisplayTests.java | 26 - .../generated/OperationInnerTests.java | 26 - .../generated/OperationListResultTests.java | 26 - .../generated/OperationsListTests.java | 65 - .../generated/PrivateIpAddressTests.java | 31 - .../generated/ResourceIdentityTests.java | 27 - .../generated/ScheduleTests.java | 44 - ...ConfigurationsManagementSettingsTests.java | 92 -- .../SqlConnectivityUpdateSettingsTests.java | 41 - .../generated/SqlInstanceSettingsTests.java | 49 - .../generated/SqlStorageSettingsTests.java | 32 - .../SqlStorageUpdateSettingsTests.java | 38 - .../generated/SqlTempDbSettingsTests.java | 56 - ...SqlVirtualMachineGroupListResultTests.java | 26 - ...SqlVirtualMachineGroupPropertiesTests.java | 66 - .../SqlVirtualMachineGroupUpdateTests.java | 42 - ...rtualMachineGroupsCreateOrUpdateTests.java | 114 -- .../SqlVirtualMachineGroupsDeleteTests.java | 62 - ...MachineGroupsListByResourceGroupTests.java | 85 -- .../SqlVirtualMachineGroupsListTests.java | 88 -- .../SqlVirtualMachineInnerTests.java | 214 ---- .../SqlVirtualMachineListResultTests.java | 26 - .../SqlVirtualMachinePropertiesTests.java | 410 ------- .../SqlVirtualMachineUpdateTests.java | 53 - ...SqlVirtualMachinesCreateOrUpdateTests.java | 203 --- .../SqlVirtualMachinesDeleteTests.java | 62 - ...rtualMachinesListByResourceGroupTests.java | 144 --- ...lVirtualMachinesListBySqlVmGroupTests.java | 141 --- .../SqlVirtualMachinesListTests.java | 140 --- .../SqlVirtualMachinesRedeployTests.java | 62 - ...qlVirtualMachinesStartAssessmentTests.java | 62 - .../SqlWorkloadTypeUpdateSettingsTests.java | 28 - .../StorageConfigurationSettingsTests.java | 87 -- .../generated/WsfcDomainCredentialsTests.java | 41 - .../generated/WsfcDomainProfileTests.java | 56 - 163 files changed, 2655 insertions(+), 4697 deletions(-) create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineTroubleshootsClient.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVmTroubleshootingInner.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsClientImpl.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsImpl.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVmTroubleshootingImpl.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AadAuthenticationSettings.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineTroubleshoots.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVmTroubleshooting.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/TroubleshootingAdditionalProperties.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/TroubleshootingScenario.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/TroubleshootingStatus.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/UnhealthyReplicaInfo.java create mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineTroubleshootTroubleshootSamples.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AdditionalFeaturesServerConfigurationsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgConfigurationTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgReplicaTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AssessmentSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoBackupSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoPatchingSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerInnerTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerListResultTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerPropertiesTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/KeyVaultCredentialSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/LoadBalancerConfigurationTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/MultiSubnetIpConfigurationTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationDisplayTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationInnerTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationListResultTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/PrivateIpAddressTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ResourceIdentityTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ScheduleTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ServerConfigurationsManagementSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlConnectivityUpdateSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlInstanceSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageUpdateSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlTempDbSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupListResultTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupPropertiesTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupUpdateTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineInnerTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineListResultTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinePropertiesTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineUpdateTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeployTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlWorkloadTypeUpdateSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/StorageConfigurationSettingsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainCredentialsTests.java delete mode 100644 sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainProfileTests.java diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/CHANGELOG.md b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/CHANGELOG.md index c1972db0aa17f..49250bfaf86ec 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/CHANGELOG.md +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-03-01) + +- Azure Resource Manager SqlVirtualMachine client library for Java. This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-08. 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/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/README.md b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/README.md index fc2e4204793b0..539895933bd4f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/README.md +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/README.md @@ -2,7 +2,7 @@ Azure Resource Manager SqlVirtualMachine client library for Java. -This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-07. 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 SqlVirtualMachine Management SDK. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-08. 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-sqlvirtualmachine - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory 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. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/SAMPLE.md b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/SAMPLE.md index 29254831c28a8..6f710c51e77d2 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/SAMPLE.md +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/SAMPLE.md @@ -21,6 +21,10 @@ - [ListByResourceGroup](#sqlvirtualmachinegroups_listbyresourcegroup) - [Update](#sqlvirtualmachinegroups_update) +## SqlVirtualMachineTroubleshoot + +- [Troubleshoot](#sqlvirtualmachinetroubleshoot_troubleshoot) + ## SqlVirtualMachines - [CreateOrUpdate](#sqlvirtualmachines_createorupdate) @@ -43,7 +47,7 @@ import java.util.Arrays; /** Samples for AvailabilityGroupListeners CreateOrUpdate. */ public final class AvailabilityGroupListenersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.json */ /** * Sample code: Creates or updates an availability group listener using load balancer. This is used for VMs present @@ -81,7 +85,7 @@ public final class AvailabilityGroupListenersCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateAvailabilityGroupListenerWithMultiSubnet.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListenerWithMultiSubnet.json */ /** * Sample code: Creates or updates an availability group listener. This is used for VMs present in multi subnet. @@ -123,12 +127,10 @@ public final class AvailabilityGroupListenersCreateOrUpdateSamples { ### AvailabilityGroupListeners_Delete ```java -import com.azure.core.util.Context; - /** Samples for AvailabilityGroupListeners Delete. */ public final class AvailabilityGroupListenersDeleteSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/DeleteAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteAvailabilityGroupListener.json */ /** * Sample code: Deletes an availability group listener. @@ -137,7 +139,9 @@ public final class AvailabilityGroupListenersDeleteSamples { */ public static void deletesAnAvailabilityGroupListener( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.availabilityGroupListeners().delete("testrg", "testvmgroup", "agl-test", Context.NONE); + manager + .availabilityGroupListeners() + .delete("testrg", "testvmgroup", "agl-test", com.azure.core.util.Context.NONE); } } ``` @@ -145,12 +149,10 @@ public final class AvailabilityGroupListenersDeleteSamples { ### AvailabilityGroupListeners_Get ```java -import com.azure.core.util.Context; - /** Samples for AvailabilityGroupListeners Get. */ public final class AvailabilityGroupListenersGetSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/GetAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetAvailabilityGroupListener.json */ /** * Sample code: Gets an availability group listener. @@ -159,7 +161,9 @@ public final class AvailabilityGroupListenersGetSamples { */ public static void getsAnAvailabilityGroupListener( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.availabilityGroupListeners().getWithResponse("testrg", "testvmgroup", "agl-test", null, Context.NONE); + manager + .availabilityGroupListeners() + .getWithResponse("testrg", "testvmgroup", "agl-test", null, com.azure.core.util.Context.NONE); } } ``` @@ -167,12 +171,10 @@ public final class AvailabilityGroupListenersGetSamples { ### AvailabilityGroupListeners_ListByGroup ```java -import com.azure.core.util.Context; - /** Samples for AvailabilityGroupListeners ListByGroup. */ public final class AvailabilityGroupListenersListByGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListByGroupAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByGroupAvailabilityGroupListener.json */ /** * Sample code: Lists all availability group listeners in a SQL virtual machine group. @@ -181,7 +183,7 @@ public final class AvailabilityGroupListenersListByGroupSamples { */ public static void listsAllAvailabilityGroupListenersInASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.availabilityGroupListeners().listByGroup("testrg", "testvmgroup", Context.NONE); + manager.availabilityGroupListeners().listByGroup("testrg", "testvmgroup", com.azure.core.util.Context.NONE); } } ``` @@ -189,12 +191,10 @@ public final class AvailabilityGroupListenersListByGroupSamples { ### Operations_List ```java -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListOperation.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListOperation.json */ /** * Sample code: Lists all of the available SQL Virtual Machine Rest API operations. @@ -203,7 +203,7 @@ public final class OperationsListSamples { */ public static void listsAllOfTheAvailableSQLVirtualMachineRestAPIOperations( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -220,7 +220,7 @@ import java.util.Map; /** Samples for SqlVirtualMachineGroups CreateOrUpdate. */ public final class SqlVirtualMachineGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.json */ /** * Sample code: Creates or updates a SQL virtual machine group. @@ -245,7 +245,7 @@ public final class SqlVirtualMachineGroupsCreateOrUpdateSamples { .withClusterOperatorAccount("testrp@testdomain.com") .withSqlServiceAccount("sqlservice@testdomain.com") .withStorageAccountUrl("https://storgact.blob.core.windows.net/") - .withStorageAccountPrimaryKey("") + .withStorageAccountPrimaryKey("fakeTokenPlaceholder") .withClusterSubnetType(ClusterSubnetType.MULTI_SUBNET)) .create(); } @@ -266,12 +266,10 @@ public final class SqlVirtualMachineGroupsCreateOrUpdateSamples { ### SqlVirtualMachineGroups_Delete ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups Delete. */ public final class SqlVirtualMachineGroupsDeleteSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/DeleteSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachineGroup.json */ /** * Sample code: Deletes a SQL virtual machine group. @@ -280,7 +278,7 @@ public final class SqlVirtualMachineGroupsDeleteSamples { */ public static void deletesASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().delete("testrg", "testvmgroup", Context.NONE); + manager.sqlVirtualMachineGroups().delete("testrg", "testvmgroup", com.azure.core.util.Context.NONE); } } ``` @@ -288,12 +286,10 @@ public final class SqlVirtualMachineGroupsDeleteSamples { ### SqlVirtualMachineGroups_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups GetByResourceGroup. */ public final class SqlVirtualMachineGroupsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/GetSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachineGroup.json */ /** * Sample code: Gets a SQL virtual machine group. @@ -302,7 +298,9 @@ public final class SqlVirtualMachineGroupsGetByResourceGroupSamples { */ public static void getsASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().getByResourceGroupWithResponse("testrg", "testvmgroup", Context.NONE); + manager + .sqlVirtualMachineGroups() + .getByResourceGroupWithResponse("testrg", "testvmgroup", com.azure.core.util.Context.NONE); } } ``` @@ -310,12 +308,10 @@ public final class SqlVirtualMachineGroupsGetByResourceGroupSamples { ### SqlVirtualMachineGroups_List ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups List. */ public final class SqlVirtualMachineGroupsListSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json */ /** * Sample code: Gets all SQL virtual machine groups in a subscription. @@ -324,7 +320,7 @@ public final class SqlVirtualMachineGroupsListSamples { */ public static void getsAllSQLVirtualMachineGroupsInASubscription( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().list(Context.NONE); + manager.sqlVirtualMachineGroups().list(com.azure.core.util.Context.NONE); } } ``` @@ -332,12 +328,10 @@ public final class SqlVirtualMachineGroupsListSamples { ### SqlVirtualMachineGroups_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups ListByResourceGroup. */ public final class SqlVirtualMachineGroupsListByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json */ /** * Sample code: Gets all SQL virtual machine groups in a resource group. @@ -346,7 +340,7 @@ public final class SqlVirtualMachineGroupsListByResourceGroupSamples { */ public static void getsAllSQLVirtualMachineGroupsInAResourceGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().listByResourceGroup("testrg", Context.NONE); + manager.sqlVirtualMachineGroups().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -354,7 +348,6 @@ public final class SqlVirtualMachineGroupsListByResourceGroupSamples { ### SqlVirtualMachineGroups_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroup; import java.util.HashMap; import java.util.Map; @@ -362,7 +355,7 @@ import java.util.Map; /** Samples for SqlVirtualMachineGroups Update. */ public final class SqlVirtualMachineGroupsUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/UpdateSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachineGroup.json */ /** * Sample code: Updates a SQL virtual machine group tags. @@ -374,7 +367,7 @@ public final class SqlVirtualMachineGroupsUpdateSamples { SqlVirtualMachineGroup resource = manager .sqlVirtualMachineGroups() - .getByResourceGroupWithResponse("testrg", "testvmgroup", Context.NONE) + .getByResourceGroupWithResponse("testrg", "testvmgroup", com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("mytag", "myval")).apply(); } @@ -392,9 +385,48 @@ public final class SqlVirtualMachineGroupsUpdateSamples { } ``` +### SqlVirtualMachineTroubleshoot_Troubleshoot + +```java +import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingAdditionalProperties; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingScenario; +import com.azure.resourcemanager.sqlvirtualmachine.models.UnhealthyReplicaInfo; +import java.time.OffsetDateTime; + +/** Samples for SqlVirtualMachineTroubleshoot Troubleshoot. */ +public final class SqlVirtualMachineTroubleshootTroubleshootSamples { + /* + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/TroubleshootSqlVirtualMachine.json + */ + /** + * Sample code: Start SQL virtual machine troubleshooting operation. + * + * @param manager Entry point to SqlVirtualMachineManager. + */ + public static void startSQLVirtualMachineTroubleshootingOperation( + com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { + manager + .sqlVirtualMachineTroubleshoots() + .troubleshoot( + "testrg", + "testvm", + new SqlVmTroubleshootingInner() + .withStartTimeUtc(OffsetDateTime.parse("2022-07-09T17:10:00Z")) + .withEndTimeUtc(OffsetDateTime.parse("2022-07-09T22:10:00Z")) + .withTroubleshootingScenario(TroubleshootingScenario.UNHEALTHY_REPLICA) + .withProperties( + new TroubleshootingAdditionalProperties() + .withUnhealthyReplicaInfo(new UnhealthyReplicaInfo().withAvailabilityGroupName("AG1"))), + com.azure.core.util.Context.NONE); + } +} +``` + ### SqlVirtualMachines_CreateOrUpdate ```java +import com.azure.resourcemanager.sqlvirtualmachine.models.AadAuthenticationSettings; import com.azure.resourcemanager.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations; import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentDayOfWeek; import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings; @@ -428,7 +460,7 @@ import java.util.Arrays; /** Samples for SqlVirtualMachines CreateOrUpdate. */ public final class SqlVirtualMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json */ /** * Sample code: Creates or updates a SQL virtual machine for Storage Configuration Settings to EXTEND Data, Log or @@ -454,7 +486,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.json */ /** * Sample code: Creates or updates a SQL virtual machine and joins it to a SQL virtual machine group. @@ -472,15 +504,15 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2") .withWsfcDomainCredentials( new WsfcDomainCredentials() - .withClusterBootstrapAccountPassword("") - .withClusterOperatorAccountPassword("") - .withSqlServiceAccountPassword("")) + .withClusterBootstrapAccountPassword("fakeTokenPlaceholder") + .withClusterOperatorAccountPassword("fakeTokenPlaceholder") + .withSqlServiceAccountPassword("fakeTokenPlaceholder")) .withWsfcStaticIp("10.0.0.7") .create(); } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json */ /** * Sample code: Creates or updates a SQL virtual machine for Automated Back up Settings with Weekly and Days of the @@ -514,8 +546,8 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { .withRetentionPeriod(17) .withStorageAccountUrl("https://teststorage.blob.core.windows.net/") .withStorageContainerName("testcontainer") - .withStorageAccessKey("") - .withPassword("") + .withStorageAccessKey("fakeTokenPlaceholder") + .withPassword("fakeTokenPlaceholder") .withBackupSystemDbs(true) .withBackupScheduleType(BackupScheduleType.MANUAL) .withFullBackupFrequency(FullBackupFrequencyType.WEEKLY) @@ -531,7 +563,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { .withConnectivityType(ConnectivityType.PRIVATE) .withPort(1433) .withSqlAuthUpdateUsername("sqllogin") - .withSqlAuthUpdatePassword("")) + .withSqlAuthUpdatePassword("fakeTokenPlaceholder")) .withSqlWorkloadTypeUpdateSettings( new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.OLTP)) .withSqlStorageUpdateSettings( @@ -545,7 +577,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json */ /** * Sample code: Creates or updates a SQL virtual machine for Storage Configuration Settings to NEW Data, Log and @@ -584,7 +616,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineMAX.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMAX.json */ /** * Sample code: Creates or updates a SQL virtual machine with max parameters. @@ -617,8 +649,8 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { .withRetentionPeriod(17) .withStorageAccountUrl("https://teststorage.blob.core.windows.net/") .withStorageContainerName("testcontainer") - .withStorageAccessKey("") - .withPassword("") + .withStorageAccessKey("fakeTokenPlaceholder") + .withPassword("fakeTokenPlaceholder") .withBackupSystemDbs(true) .withBackupScheduleType(BackupScheduleType.MANUAL) .withFullBackupFrequency(FullBackupFrequencyType.DAILY) @@ -633,7 +665,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { .withConnectivityType(ConnectivityType.PRIVATE) .withPort(1433) .withSqlAuthUpdateUsername("sqllogin") - .withSqlAuthUpdatePassword("")) + .withSqlAuthUpdatePassword("fakeTokenPlaceholder")) .withSqlWorkloadTypeUpdateSettings( new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.OLTP)) .withSqlStorageUpdateSettings( @@ -651,7 +683,9 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { .withMinServerMemoryMB(0) .withMaxServerMemoryMB(128) .withIsLpimEnabled(true) - .withIsIfiEnabled(true))) + .withIsIfiEnabled(true)) + .withAzureAdAuthenticationSettings( + new AadAuthenticationSettings().withClientId("11111111-2222-3333-4444-555555555555"))) .withAssessmentSettings( new AssessmentSettings() .withEnable(true) @@ -667,7 +701,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineMIN.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMIN.json */ /** * Sample code: Creates or updates a SQL virtual machine with min parameters. @@ -691,12 +725,10 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { ### SqlVirtualMachines_Delete ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines Delete. */ public final class SqlVirtualMachinesDeleteSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/DeleteSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachine.json */ /** * Sample code: Deletes a SQL virtual machine. @@ -705,7 +737,7 @@ public final class SqlVirtualMachinesDeleteSamples { */ public static void deletesASQLVirtualMachine( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().delete("testrg", "testvm1", Context.NONE); + manager.sqlVirtualMachines().delete("testrg", "testvm1", com.azure.core.util.Context.NONE); } } ``` @@ -713,12 +745,10 @@ public final class SqlVirtualMachinesDeleteSamples { ### SqlVirtualMachines_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines GetByResourceGroup. */ public final class SqlVirtualMachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/GetSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachine.json */ /** * Sample code: Gets a SQL virtual machine. @@ -727,7 +757,9 @@ public final class SqlVirtualMachinesGetByResourceGroupSamples { */ public static void getsASQLVirtualMachine( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().getByResourceGroupWithResponse("testrg", "testvm", null, Context.NONE); + manager + .sqlVirtualMachines() + .getByResourceGroupWithResponse("testrg", "testvm", null, com.azure.core.util.Context.NONE); } } ``` @@ -735,12 +767,10 @@ public final class SqlVirtualMachinesGetByResourceGroupSamples { ### SqlVirtualMachines_List ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines List. */ public final class SqlVirtualMachinesListSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListSubscriptionSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachine.json */ /** * Sample code: Gets all SQL virtual machines in a subscription. @@ -749,7 +779,7 @@ public final class SqlVirtualMachinesListSamples { */ public static void getsAllSQLVirtualMachinesInASubscription( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().list(Context.NONE); + manager.sqlVirtualMachines().list(com.azure.core.util.Context.NONE); } } ``` @@ -757,12 +787,10 @@ public final class SqlVirtualMachinesListSamples { ### SqlVirtualMachines_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines ListByResourceGroup. */ public final class SqlVirtualMachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json */ /** * Sample code: Gets all SQL virtual machines in a resource group. @@ -771,7 +799,7 @@ public final class SqlVirtualMachinesListByResourceGroupSamples { */ public static void getsAllSQLVirtualMachinesInAResourceGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().listByResourceGroup("testrg", Context.NONE); + manager.sqlVirtualMachines().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -779,12 +807,10 @@ public final class SqlVirtualMachinesListByResourceGroupSamples { ### SqlVirtualMachines_ListBySqlVmGroup ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines ListBySqlVmGroup. */ public final class SqlVirtualMachinesListBySqlVmGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListBySqlVirtualMachineGroupSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListBySqlVirtualMachineGroupSqlVirtualMachine.json */ /** * Sample code: Gets the list of sql virtual machines in a SQL virtual machine group. @@ -793,7 +819,7 @@ public final class SqlVirtualMachinesListBySqlVmGroupSamples { */ public static void getsTheListOfSqlVirtualMachinesInASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().listBySqlVmGroup("testrg", "testvm", Context.NONE); + manager.sqlVirtualMachines().listBySqlVmGroup("testrg", "testvm", com.azure.core.util.Context.NONE); } } ``` @@ -801,21 +827,19 @@ public final class SqlVirtualMachinesListBySqlVmGroupSamples { ### SqlVirtualMachines_Redeploy ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines Redeploy. */ public final class SqlVirtualMachinesRedeploySamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/RedeploySqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/RedeploySqlVirtualMachine.json */ /** - * Sample code: Uninstalls and reinstalls the SQL Iaas Extension. + * Sample code: Uninstalls and reinstalls the SQL IaaS Extension. * * @param manager Entry point to SqlVirtualMachineManager. */ - public static void uninstallsAndReinstallsTheSQLIaasExtension( + public static void uninstallsAndReinstallsTheSQLIaaSExtension( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().redeploy("testrg", "testvm", Context.NONE); + manager.sqlVirtualMachines().redeploy("testrg", "testvm", com.azure.core.util.Context.NONE); } } ``` @@ -823,21 +847,19 @@ public final class SqlVirtualMachinesRedeploySamples { ### SqlVirtualMachines_StartAssessment ```java -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines StartAssessment. */ public final class SqlVirtualMachinesStartAssessmentSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json */ /** - * Sample code: Starts Assessment on SQL virtual machine. + * Sample code: Starts SQL best practices Assessment on SQL virtual machine. * * @param manager Entry point to SqlVirtualMachineManager. */ - public static void startsAssessmentOnSQLVirtualMachine( + public static void startsSQLBestPracticesAssessmentOnSQLVirtualMachine( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().startAssessment("testrg", "testvm", Context.NONE); + manager.sqlVirtualMachines().startAssessment("testrg", "testvm", com.azure.core.util.Context.NONE); } } ``` @@ -845,7 +867,6 @@ public final class SqlVirtualMachinesStartAssessmentSamples { ### SqlVirtualMachines_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; import java.util.HashMap; import java.util.Map; @@ -853,7 +874,7 @@ import java.util.Map; /** Samples for SqlVirtualMachines Update. */ public final class SqlVirtualMachinesUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/UpdateSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachine.json */ /** * Sample code: Updates a SQL virtual machine tags. @@ -865,7 +886,7 @@ public final class SqlVirtualMachinesUpdateSamples { SqlVirtualMachine resource = manager .sqlVirtualMachines() - .getByResourceGroupWithResponse("testrg", "testvm", null, Context.NONE) + .getByResourceGroupWithResponse("testrg", "testvm", null, com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("mytag", "myval")).apply(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml index 2bf9d17e3fb7a..553beb90a33a5 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for SqlVirtualMachine Management - This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-07. + This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-08. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/SqlVirtualMachineManager.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/SqlVirtualMachineManager.java index 0ab9e1cf3756d..b9661d405704c 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/SqlVirtualMachineManager.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/SqlVirtualMachineManager.java @@ -28,10 +28,12 @@ import com.azure.resourcemanager.sqlvirtualmachine.implementation.OperationsImpl; import com.azure.resourcemanager.sqlvirtualmachine.implementation.SqlVirtualMachineGroupsImpl; import com.azure.resourcemanager.sqlvirtualmachine.implementation.SqlVirtualMachineManagementClientBuilder; +import com.azure.resourcemanager.sqlvirtualmachine.implementation.SqlVirtualMachineTroubleshootsImpl; import com.azure.resourcemanager.sqlvirtualmachine.implementation.SqlVirtualMachinesImpl; import com.azure.resourcemanager.sqlvirtualmachine.models.AvailabilityGroupListeners; import com.azure.resourcemanager.sqlvirtualmachine.models.Operations; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroups; +import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineTroubleshoots; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachines; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -55,6 +57,8 @@ public final class SqlVirtualMachineManager { private SqlVirtualMachines sqlVirtualMachines; + private SqlVirtualMachineTroubleshoots sqlVirtualMachineTroubleshoots; + private final SqlVirtualMachineManagementClient clientObject; private SqlVirtualMachineManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -220,7 +224,7 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr .append("-") .append("com.azure.resourcemanager.sqlvirtualmachine") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -327,6 +331,19 @@ public SqlVirtualMachines sqlVirtualMachines() { return sqlVirtualMachines; } + /** + * Gets the resource collection API of SqlVirtualMachineTroubleshoots. + * + * @return Resource collection API of SqlVirtualMachineTroubleshoots. + */ + public SqlVirtualMachineTroubleshoots sqlVirtualMachineTroubleshoots() { + if (this.sqlVirtualMachineTroubleshoots == null) { + this.sqlVirtualMachineTroubleshoots = + new SqlVirtualMachineTroubleshootsImpl(clientObject.getSqlVirtualMachineTroubleshoots(), this); + } + return sqlVirtualMachineTroubleshoots; + } + /** * @return Wrapped service client SqlVirtualMachineManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/AvailabilityGroupListenersClient.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/AvailabilityGroupListenersClient.java index cb42d8dd67e79..660ea62c9184f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/AvailabilityGroupListenersClient.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/AvailabilityGroupListenersClient.java @@ -22,14 +22,20 @@ public interface AvailabilityGroupListenersClient { * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. * @param availabilityGroupListenerName Name of the availability group listener. + * @param expand The child resources to include in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an availability group listener. + * @return an availability group listener along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilityGroupListenerInner get( - String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName); + Response getWithResponse( + String resourceGroupName, + String sqlVirtualMachineGroupName, + String availabilityGroupListenerName, + String expand, + Context context); /** * Gets an availability group listener. @@ -38,20 +44,14 @@ AvailabilityGroupListenerInner get( * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. * @param availabilityGroupListenerName Name of the availability group listener. - * @param expand The child resources to include in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an availability group listener along with {@link Response}. + * @return an availability group listener. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String sqlVirtualMachineGroupName, - String availabilityGroupListenerName, - String expand, - Context context); + AvailabilityGroupListenerInner get( + String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName); /** * Creates or updates an availability group listener. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineGroupsClient.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineGroupsClient.java index 6eabd134d166e..60f7d6b52e793 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineGroupsClient.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineGroupsClient.java @@ -22,13 +22,15 @@ public interface SqlVirtualMachineGroupsClient { * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine group. + * @return a SQL virtual machine group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlVirtualMachineGroupInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlVirtualMachineGroupName, Context context); /** * Gets a SQL virtual machine group. @@ -36,15 +38,13 @@ public interface SqlVirtualMachineGroupsClient { * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine group along with {@link Response}. + * @return a SQL virtual machine group. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlVirtualMachineGroupName, Context context); + SqlVirtualMachineGroupInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName); /** * Creates or updates a SQL virtual machine group. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineManagementClient.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineManagementClient.java index 49139deb97022..1c423442e7c55 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineManagementClient.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineManagementClient.java @@ -71,4 +71,11 @@ public interface SqlVirtualMachineManagementClient { * @return the SqlVirtualMachinesClient object. */ SqlVirtualMachinesClient getSqlVirtualMachines(); + + /** + * Gets the SqlVirtualMachineTroubleshootsClient object to access its operations. + * + * @return the SqlVirtualMachineTroubleshootsClient object. + */ + SqlVirtualMachineTroubleshootsClient getSqlVirtualMachineTroubleshoots(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineTroubleshootsClient.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineTroubleshootsClient.java new file mode 100644 index 0000000000000..dfef8b409cf9f --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachineTroubleshootsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sqlvirtualmachine.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.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; + +/** An instance of this class provides access to all the operations defined in SqlVirtualMachineTroubleshootsClient. */ +public interface SqlVirtualMachineTroubleshootsClient { + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlVmTroubleshootingInner> beginTroubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters); + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlVmTroubleshootingInner> beginTroubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context); + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlVmTroubleshootingInner troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters); + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlVmTroubleshootingInner troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context); +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachinesClient.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachinesClient.java index 8f98c4bbf55e4..9cc6c4e8f1e79 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachinesClient.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachinesClient.java @@ -71,94 +71,104 @@ PagedIterable listBySqlVmGroup( PagedIterable list(Context context); /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param expand The child resources to include in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a SQL virtual machine along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStartAssessment(String resourceGroupName, String sqlVirtualMachineName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlVirtualMachineName, String expand, Context context); /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStartAssessment( - String resourceGroupName, String sqlVirtualMachineName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + SqlVirtualMachineInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName); /** - * Starts Assessment on SQL virtual machine. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startAssessment(String resourceGroupName, String sqlVirtualMachineName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters); /** - * Starts Assessment on SQL virtual machine. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context); /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRedeploy(String resourceGroupName, String sqlVirtualMachineName); + @ServiceMethod(returns = ReturnType.SINGLE) + SqlVirtualMachineInner createOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters); /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, String sqlVirtualMachineName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + SqlVirtualMachineInner createOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context); /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -166,12 +176,13 @@ SyncPoller, Void> beginRedeploy( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String sqlVirtualMachineName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlVirtualMachineName); /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -180,12 +191,14 @@ SyncPoller, Void> beginRedeploy( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -193,30 +206,26 @@ SyncPoller, Void> beginRedeploy( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlVirtualMachineInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName); + void delete(String resourceGroupName, String sqlVirtualMachineName); /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param expand The child resources to include in the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlVirtualMachineName, String expand, Context context); + void delete(String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -228,11 +237,11 @@ Response getByResourceGroupWithResponse( * @return the {@link SyncPoller} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters); + SyncPoller, SqlVirtualMachineInner> beginUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters); /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -245,11 +254,11 @@ SyncPoller, SqlVirtualMachineInner> beginCrea * @return the {@link SyncPoller} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context); + SyncPoller, SqlVirtualMachineInner> beginUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context); /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -261,11 +270,11 @@ SyncPoller, SqlVirtualMachineInner> beginCrea * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlVirtualMachineInner createOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters); + SqlVirtualMachineInner update( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters); /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -278,41 +287,38 @@ SqlVirtualMachineInner createOrUpdate( * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlVirtualMachineInner createOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context); + SqlVirtualMachineInner update( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context); /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String sqlVirtualMachineName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String sqlVirtualMachineName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deletes a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -320,12 +326,13 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String sqlVirtualMachineName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStartAssessment(String resourceGroupName, String sqlVirtualMachineName); /** - * Deletes a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -334,100 +341,93 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String sqlVirtualMachineName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStartAssessment( + String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlVirtualMachineInner> beginUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + void startAssessment(String resourceGroupName, String sqlVirtualMachineName); /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 SQL virtual machine. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlVirtualMachineInner> beginUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Updates a SQL virtual machine. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVirtualMachineInner update( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRedeploy(String resourceGroupName, String sqlVirtualMachineName); /** - * Updates a SQL virtual machine. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVirtualMachineInner update( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String sqlVirtualMachineName); /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerInner.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerInner.java index 17075ad61dbef..0e815fb2a604b 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerInner.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerInner.java @@ -28,6 +28,10 @@ public final class AvailabilityGroupListenerInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of AvailabilityGroupListenerInner class. */ + public AvailabilityGroupListenerInner() { + } + /** * Get the innerProperties property: Resource properties. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerProperties.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerProperties.java index 75cbd76bde04a..e5c04f8f4d4cc 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerProperties.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/AvailabilityGroupListenerProperties.java @@ -56,6 +56,10 @@ public final class AvailabilityGroupListenerProperties { @JsonProperty(value = "availabilityGroupConfiguration") private AgConfiguration availabilityGroupConfiguration; + /** Creates an instance of AvailabilityGroupListenerProperties class. */ + public AvailabilityGroupListenerProperties() { + } + /** * Get the provisioningState property: Provisioning state to track the async operation status. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/OperationInner.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/OperationInner.java index 492497372282f..591b11e12d4e8 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/OperationInner.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/OperationInner.java @@ -39,6 +39,10 @@ public final class OperationInner { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: The name of the operation being performed on this particular object. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupInner.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupInner.java index 6de89bd0c3015..c7cfc94d26ae8 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupInner.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupInner.java @@ -30,6 +30,10 @@ public final class SqlVirtualMachineGroupInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of SqlVirtualMachineGroupInner class. */ + public SqlVirtualMachineGroupInner() { + } + /** * Get the innerProperties property: Resource properties. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupProperties.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupProperties.java index e892dcac441b4..c815b38803466 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupProperties.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineGroupProperties.java @@ -58,6 +58,10 @@ public final class SqlVirtualMachineGroupProperties { @JsonProperty(value = "wsfcDomainProfile") private WsfcDomainProfile wsfcDomainProfile; + /** Creates an instance of SqlVirtualMachineGroupProperties class. */ + public SqlVirtualMachineGroupProperties() { + } + /** * Get the provisioningState property: Provisioning state to track the async operation status. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineInner.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineInner.java index 635fdf318ec06..a27bb5c9f974d 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineInner.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineInner.java @@ -18,6 +18,7 @@ import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingStatus; import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -43,6 +44,10 @@ public final class SqlVirtualMachineInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of SqlVirtualMachineInner class. */ + public SqlVirtualMachineInner() { + } + /** * Get the identity property: Azure Active Directory identity of the server. * @@ -440,7 +445,16 @@ public SqlVirtualMachineInner withStorageConfigurationSettings( } /** - * Get the assessmentSettings property: Assessment Settings. + * Get the troubleshootingStatus property: Troubleshooting status. + * + * @return the troubleshootingStatus value. + */ + public TroubleshootingStatus troubleshootingStatus() { + return this.innerProperties() == null ? null : this.innerProperties().troubleshootingStatus(); + } + + /** + * Get the assessmentSettings property: SQL best practices Assessment Settings. * * @return the assessmentSettings value. */ @@ -449,7 +463,7 @@ public AssessmentSettings assessmentSettings() { } /** - * Set the assessmentSettings property: Assessment Settings. + * Set the assessmentSettings property: SQL best practices Assessment Settings. * * @param assessmentSettings the assessmentSettings value to set. * @return the SqlVirtualMachineInner object itself. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineProperties.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineProperties.java index 7dac19f416db5..61c055b9b6e6b 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineProperties.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVirtualMachineProperties.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingStatus; import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; import com.fasterxml.jackson.annotation.JsonProperty; @@ -112,7 +113,13 @@ public final class SqlVirtualMachineProperties { private StorageConfigurationSettings storageConfigurationSettings; /* - * Assessment Settings. + * Troubleshooting status + */ + @JsonProperty(value = "troubleshootingStatus", access = JsonProperty.Access.WRITE_ONLY) + private TroubleshootingStatus troubleshootingStatus; + + /* + * SQL best practices Assessment Settings. */ @JsonProperty(value = "assessmentSettings") private AssessmentSettings assessmentSettings; @@ -123,6 +130,10 @@ public final class SqlVirtualMachineProperties { @JsonProperty(value = "enableAutomaticUpgrade") private Boolean enableAutomaticUpgrade; + /** Creates an instance of SqlVirtualMachineProperties class. */ + public SqlVirtualMachineProperties() { + } + /** * Get the virtualMachineResourceId property: ARM Resource id of underlying virtual machine created from SQL * marketplace image. @@ -426,7 +437,16 @@ public SqlVirtualMachineProperties withStorageConfigurationSettings( } /** - * Get the assessmentSettings property: Assessment Settings. + * Get the troubleshootingStatus property: Troubleshooting status. + * + * @return the troubleshootingStatus value. + */ + public TroubleshootingStatus troubleshootingStatus() { + return this.troubleshootingStatus; + } + + /** + * Get the assessmentSettings property: SQL best practices Assessment Settings. * * @return the assessmentSettings value. */ @@ -435,7 +455,7 @@ public AssessmentSettings assessmentSettings() { } /** - * Set the assessmentSettings property: Assessment Settings. + * Set the assessmentSettings property: SQL best practices Assessment Settings. * * @param assessmentSettings the assessmentSettings value to set. * @return the SqlVirtualMachineProperties object itself. @@ -489,6 +509,9 @@ public void validate() { if (storageConfigurationSettings() != null) { storageConfigurationSettings().validate(); } + if (troubleshootingStatus() != null) { + troubleshootingStatus().validate(); + } if (assessmentSettings() != null) { assessmentSettings().validate(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVmTroubleshootingInner.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVmTroubleshootingInner.java new file mode 100644 index 0000000000000..2467c29492f5a --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/models/SqlVmTroubleshootingInner.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sqlvirtualmachine.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingAdditionalProperties; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingScenario; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Details required for SQL VM troubleshooting. */ +@Fluent +public final class SqlVmTroubleshootingInner { + /* + * Start time in UTC timezone. + */ + @JsonProperty(value = "startTimeUtc") + private OffsetDateTime startTimeUtc; + + /* + * End time in UTC timezone. + */ + @JsonProperty(value = "endTimeUtc") + private OffsetDateTime endTimeUtc; + + /* + * SQL VM troubleshooting scenario. + */ + @JsonProperty(value = "troubleshootingScenario") + private TroubleshootingScenario troubleshootingScenario; + + /* + * Troubleshooting properties + */ + @JsonProperty(value = "properties") + private TroubleshootingAdditionalProperties properties; + + /* + * Virtual machine resource id for response. + */ + @JsonProperty(value = "virtualMachineResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String virtualMachineResourceId; + + /** Creates an instance of SqlVmTroubleshootingInner class. */ + public SqlVmTroubleshootingInner() { + } + + /** + * Get the startTimeUtc property: Start time in UTC timezone. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Set the startTimeUtc property: Start time in UTC timezone. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the SqlVmTroubleshootingInner object itself. + */ + public SqlVmTroubleshootingInner withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Get the endTimeUtc property: End time in UTC timezone. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Set the endTimeUtc property: End time in UTC timezone. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the SqlVmTroubleshootingInner object itself. + */ + public SqlVmTroubleshootingInner withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Get the troubleshootingScenario property: SQL VM troubleshooting scenario. + * + * @return the troubleshootingScenario value. + */ + public TroubleshootingScenario troubleshootingScenario() { + return this.troubleshootingScenario; + } + + /** + * Set the troubleshootingScenario property: SQL VM troubleshooting scenario. + * + * @param troubleshootingScenario the troubleshootingScenario value to set. + * @return the SqlVmTroubleshootingInner object itself. + */ + public SqlVmTroubleshootingInner withTroubleshootingScenario(TroubleshootingScenario troubleshootingScenario) { + this.troubleshootingScenario = troubleshootingScenario; + return this; + } + + /** + * Get the properties property: Troubleshooting properties. + * + * @return the properties value. + */ + public TroubleshootingAdditionalProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Troubleshooting properties. + * + * @param properties the properties value to set. + * @return the SqlVmTroubleshootingInner object itself. + */ + public SqlVmTroubleshootingInner withProperties(TroubleshootingAdditionalProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the virtualMachineResourceId property: Virtual machine resource id for response. + * + * @return the virtualMachineResourceId value. + */ + public String virtualMachineResourceId() { + return this.virtualMachineResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersClientImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersClientImpl.java index a5a454e37a7fc..5067bb2fd2945 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersClientImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersClientImpl.java @@ -65,7 +65,7 @@ public final class AvailabilityGroupListenersClientImpl implements AvailabilityG */ @Host("{$host}") @ServiceInterface(name = "SqlVirtualMachineMan") - private interface AvailabilityGroupListenersService { + public interface AvailabilityGroupListenersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" @@ -102,7 +102,7 @@ Mono>> createOrUpdate( @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + "/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners" @@ -116,6 +116,7 @@ Mono>> delete( @PathParam("availabilityGroupListenerName") String availabilityGroupListenerName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @@ -280,7 +281,6 @@ private Mono> getWithResponseAsync( * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. * @param availabilityGroupListenerName Name of the availability group listener. - * @param expand The child resources to include in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -288,10 +288,8 @@ private Mono> getWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String resourceGroupName, - String sqlVirtualMachineGroupName, - String availabilityGroupListenerName, - String expand) { + String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { + final String expand = null; return getWithResponseAsync( resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -304,18 +302,23 @@ private Mono getAsync( * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. * @param availabilityGroupListenerName Name of the availability group listener. + * @param expand The child resources to include in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an availability group listener on successful completion of {@link Mono}. + * @return an availability group listener along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { - final String expand = null; + public Response getWithResponse( + String resourceGroupName, + String sqlVirtualMachineGroupName, + String availabilityGroupListenerName, + String expand, + Context context) { return getWithResponseAsync( - resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, expand, context) + .block(); } /** @@ -334,33 +337,9 @@ private Mono getAsync( public AvailabilityGroupListenerInner get( String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { final String expand = null; - return getAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, expand).block(); - } - - /** - * Gets an availability group listener. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. - * @param availabilityGroupListenerName Name of the availability group listener. - * @param expand The child resources to include in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an availability group listener along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String sqlVirtualMachineGroupName, - String availabilityGroupListenerName, - String expand, - Context context) { - return getWithResponseAsync( - resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, expand, context) - .block(); + return getWithResponse( + resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, expand, Context.NONE) + .getValue(); } /** @@ -592,7 +571,8 @@ public SyncPoller, AvailabilityGroupL String sqlVirtualMachineGroupName, String availabilityGroupListenerName, AvailabilityGroupListenerInner parameters) { - return beginCreateOrUpdateAsync( + return this + .beginCreateOrUpdateAsync( resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, parameters) .getSyncPoller(); } @@ -618,7 +598,8 @@ public SyncPoller, AvailabilityGroupL String availabilityGroupListenerName, AvailabilityGroupListenerInner parameters, Context context) { - return beginCreateOrUpdateAsync( + return this + .beginCreateOrUpdateAsync( resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, parameters, context) .getSyncPoller(); } @@ -768,6 +749,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -779,6 +761,7 @@ private Mono>> deleteWithResponseAsync( availabilityGroupListenerName, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -830,6 +813,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -839,6 +823,7 @@ private Mono>> deleteWithResponseAsync( availabilityGroupListenerName, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context); } @@ -908,7 +893,8 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName) + return this + .beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName) .getSyncPoller(); } @@ -931,7 +917,8 @@ public SyncPoller, Void> beginDelete( String sqlVirtualMachineGroupName, String availabilityGroupListenerName, Context context) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, context) + return this + .beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, context) .getSyncPoller(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersImpl.java index 348217a3a979d..97167c8255ff0 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/AvailabilityGroupListenersImpl.java @@ -28,17 +28,6 @@ public AvailabilityGroupListenersImpl( this.serviceManager = serviceManager; } - public AvailabilityGroupListener get( - String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { - AvailabilityGroupListenerInner inner = - this.serviceClient().get(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName); - if (inner != null) { - return new AvailabilityGroupListenerImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String sqlVirtualMachineGroupName, @@ -61,6 +50,17 @@ public Response getWithResponse( } } + public AvailabilityGroupListener get( + String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { + AvailabilityGroupListenerInner inner = + this.serviceClient().get(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName); + if (inner != null) { + return new AvailabilityGroupListenerImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete( String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName) { this.serviceClient().delete(resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName); diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/OperationsClientImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/OperationsClientImpl.java index 92e07495731a8..01ed433ff78e9 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/OperationsClientImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/OperationsClientImpl.java @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "SqlVirtualMachineMan") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.SqlVirtualMachine/operations") @ExpectedResponses({200}) diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsClientImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsClientImpl.java index fb27fb0a33a5b..d917b0a2c8097 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsClientImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsClientImpl.java @@ -66,7 +66,7 @@ public final class SqlVirtualMachineGroupsClientImpl implements SqlVirtualMachin */ @Host("{$host}") @ServiceInterface(name = "SqlVirtualMachineMan") - private interface SqlVirtualMachineGroupsService { + public interface SqlVirtualMachineGroupsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" @@ -98,7 +98,7 @@ Mono>> createOrUpdate( @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + "/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}") @@ -110,6 +110,7 @@ Mono>> delete( @PathParam("sqlVirtualMachineGroupName") String sqlVirtualMachineGroupName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @@ -300,14 +301,16 @@ private Mono getByResourceGroupAsync( * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine group. + * @return a SQL virtual machine group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVirtualMachineGroupInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName) { - return getByResourceGroupAsync(resourceGroupName, sqlVirtualMachineGroupName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlVirtualMachineGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineGroupName, context).block(); } /** @@ -316,16 +319,14 @@ public SqlVirtualMachineGroupInner getByResourceGroup(String resourceGroupName, * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine group along with {@link Response}. + * @return a SQL virtual machine group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlVirtualMachineGroupName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineGroupName, context).block(); + public SqlVirtualMachineGroupInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, sqlVirtualMachineGroupName, Context.NONE).getValue(); } /** @@ -521,7 +522,7 @@ private PollerFlux, SqlVirtualMachineGro @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SqlVirtualMachineGroupInner> beginCreateOrUpdate( String resourceGroupName, String sqlVirtualMachineGroupName, SqlVirtualMachineGroupInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters).getSyncPoller(); } /** @@ -543,7 +544,8 @@ public SyncPoller, SqlVirtualMachineGrou String sqlVirtualMachineGroupName, SqlVirtualMachineGroupInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters, context) + return this + .beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters, context) .getSyncPoller(); } @@ -667,6 +669,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -677,6 +680,7 @@ private Mono>> deleteWithResponseAsync( sqlVirtualMachineGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -718,6 +722,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -726,6 +731,7 @@ private Mono>> deleteWithResponseAsync( sqlVirtualMachineGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context); } @@ -786,7 +792,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlVirtualMachineGroupName) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName).getSyncPoller(); } /** @@ -804,7 +810,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String sqlVirtualMachineGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, sqlVirtualMachineGroupName, context).getSyncPoller(); } /** @@ -1068,7 +1074,7 @@ private PollerFlux, SqlVirtualMachineGro @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SqlVirtualMachineGroupInner> beginUpdate( String resourceGroupName, String sqlVirtualMachineGroupName, SqlVirtualMachineGroupUpdate parameters) { - return beginUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters).getSyncPoller(); } /** @@ -1090,7 +1096,9 @@ public SyncPoller, SqlVirtualMachineGrou String sqlVirtualMachineGroupName, SqlVirtualMachineGroupUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters, context).getSyncPoller(); + return this + .beginUpdateAsync(resourceGroupName, sqlVirtualMachineGroupName, parameters, context) + .getSyncPoller(); } /** diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsImpl.java index 8710adb16f0d4..2c4b2f5899fce 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineGroupsImpl.java @@ -28,16 +28,6 @@ public SqlVirtualMachineGroupsImpl( this.serviceManager = serviceManager; } - public SqlVirtualMachineGroup getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName) { - SqlVirtualMachineGroupInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, sqlVirtualMachineGroupName); - if (inner != null) { - return new SqlVirtualMachineGroupImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String sqlVirtualMachineGroupName, Context context) { Response inner = @@ -53,6 +43,16 @@ public Response getByResourceGroupWithResponse( } } + public SqlVirtualMachineGroup getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName) { + SqlVirtualMachineGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sqlVirtualMachineGroupName); + if (inner != null) { + return new SqlVirtualMachineGroupImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName) { this.serviceClient().delete(resourceGroupName, sqlVirtualMachineGroupName); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineImpl.java index f7afdf02b644a..7b5f434de2cc6 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineImpl.java @@ -21,6 +21,7 @@ import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineUpdate; import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingStatus; import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; import java.util.Collections; import java.util.Map; @@ -124,6 +125,10 @@ public StorageConfigurationSettings storageConfigurationSettings() { return this.innerModel().storageConfigurationSettings(); } + public TroubleshootingStatus troubleshootingStatus() { + return this.innerModel().troubleshootingStatus(); + } + public AssessmentSettings assessmentSettings() { return this.innerModel().assessmentSettings(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineManagementClientImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineManagementClientImpl.java index 2899a5797168b..4a2730034fdaf 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineManagementClientImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineManagementClientImpl.java @@ -26,6 +26,7 @@ import com.azure.resourcemanager.sqlvirtualmachine.fluent.OperationsClient; import com.azure.resourcemanager.sqlvirtualmachine.fluent.SqlVirtualMachineGroupsClient; import com.azure.resourcemanager.sqlvirtualmachine.fluent.SqlVirtualMachineManagementClient; +import com.azure.resourcemanager.sqlvirtualmachine.fluent.SqlVirtualMachineTroubleshootsClient; import com.azure.resourcemanager.sqlvirtualmachine.fluent.SqlVirtualMachinesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -159,6 +160,18 @@ public SqlVirtualMachinesClient getSqlVirtualMachines() { return this.sqlVirtualMachines; } + /** The SqlVirtualMachineTroubleshootsClient object to access its operations. */ + private final SqlVirtualMachineTroubleshootsClient sqlVirtualMachineTroubleshoots; + + /** + * Gets the SqlVirtualMachineTroubleshootsClient object to access its operations. + * + * @return the SqlVirtualMachineTroubleshootsClient object. + */ + public SqlVirtualMachineTroubleshootsClient getSqlVirtualMachineTroubleshoots() { + return this.sqlVirtualMachineTroubleshoots; + } + /** * Initializes an instance of SqlVirtualMachineManagementClient client. * @@ -181,11 +194,12 @@ public SqlVirtualMachinesClient getSqlVirtualMachines() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-07-01-preview"; + this.apiVersion = "2022-08-01-preview"; this.availabilityGroupListeners = new AvailabilityGroupListenersClientImpl(this); this.operations = new OperationsClientImpl(this); this.sqlVirtualMachineGroups = new SqlVirtualMachineGroupsClientImpl(this); this.sqlVirtualMachines = new SqlVirtualMachinesClientImpl(this); + this.sqlVirtualMachineTroubleshoots = new SqlVirtualMachineTroubleshootsClientImpl(this); } /** diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsClientImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsClientImpl.java new file mode 100644 index 0000000000000..6416c4fd75372 --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsClientImpl.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sqlvirtualmachine.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.sqlvirtualmachine.fluent.SqlVirtualMachineTroubleshootsClient; +import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; +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 SqlVirtualMachineTroubleshootsClient. */ +public final class SqlVirtualMachineTroubleshootsClientImpl implements SqlVirtualMachineTroubleshootsClient { + /** The proxy service used to perform REST calls. */ + private final SqlVirtualMachineTroubleshootsService service; + + /** The service client containing this operation class. */ + private final SqlVirtualMachineManagementClientImpl client; + + /** + * Initializes an instance of SqlVirtualMachineTroubleshootsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlVirtualMachineTroubleshootsClientImpl(SqlVirtualMachineManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlVirtualMachineTroubleshootsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SqlVirtualMachineManagementClientSqlVirtualMachineTroubleshoots to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SqlVirtualMachineMan") + public interface SqlVirtualMachineTroubleshootsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/troubleshoot") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> troubleshoot( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlVmTroubleshootingInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> troubleshootWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner 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 (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .troubleshoot( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> troubleshootWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner 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 (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .troubleshoot( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlVmTroubleshootingInner> beginTroubleshootAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters) { + Mono>> mono = + troubleshootWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlVmTroubleshootingInner.class, + SqlVmTroubleshootingInner.class, + this.client.getContext()); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlVmTroubleshootingInner> beginTroubleshootAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + troubleshootWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlVmTroubleshootingInner.class, + SqlVmTroubleshootingInner.class, + context); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlVmTroubleshootingInner> beginTroubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters) { + return this.beginTroubleshootAsync(resourceGroupName, sqlVirtualMachineName, parameters).getSyncPoller(); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlVmTroubleshootingInner> beginTroubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context) { + return this + .beginTroubleshootAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono troubleshootAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters) { + return beginTroubleshootAsync(resourceGroupName, sqlVirtualMachineName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono troubleshootAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context) { + return beginTroubleshootAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlVmTroubleshootingInner troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters) { + return troubleshootAsync(resourceGroupName, sqlVirtualMachineName, parameters).block(); + } + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlVmTroubleshootingInner troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context) { + return troubleshootAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).block(); + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsImpl.java new file mode 100644 index 0000000000000..928be8ddba098 --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachineTroubleshootsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sqlvirtualmachine.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.sqlvirtualmachine.fluent.SqlVirtualMachineTroubleshootsClient; +import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; +import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineTroubleshoots; +import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmTroubleshooting; + +public final class SqlVirtualMachineTroubleshootsImpl implements SqlVirtualMachineTroubleshoots { + private static final ClientLogger LOGGER = new ClientLogger(SqlVirtualMachineTroubleshootsImpl.class); + + private final SqlVirtualMachineTroubleshootsClient innerClient; + + private final com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager serviceManager; + + public SqlVirtualMachineTroubleshootsImpl( + SqlVirtualMachineTroubleshootsClient innerClient, + com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SqlVmTroubleshooting troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters) { + SqlVmTroubleshootingInner inner = + this.serviceClient().troubleshoot(resourceGroupName, sqlVirtualMachineName, parameters); + if (inner != null) { + return new SqlVmTroubleshootingImpl(inner, this.manager()); + } else { + return null; + } + } + + public SqlVmTroubleshooting troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context) { + SqlVmTroubleshootingInner inner = + this.serviceClient().troubleshoot(resourceGroupName, sqlVirtualMachineName, parameters, context); + if (inner != null) { + return new SqlVmTroubleshootingImpl(inner, this.manager()); + } else { + return null; + } + } + + private SqlVirtualMachineTroubleshootsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesClientImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesClientImpl.java index 93d14191fc38a..22b2f0e4f725a 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesClientImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesClientImpl.java @@ -66,7 +66,7 @@ public final class SqlVirtualMachinesClientImpl implements SqlVirtualMachinesCli */ @Host("{$host}") @ServiceInterface(name = "SqlVirtualMachineMan") - private interface SqlVirtualMachinesService { + public interface SqlVirtualMachinesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" @@ -93,34 +93,6 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" - + "/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startAssessment( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" - + "/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" @@ -153,7 +125,7 @@ Mono>> createOrUpdate( @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + "/sqlVirtualMachines/{sqlVirtualMachineName}") @@ -165,6 +137,7 @@ Mono>> delete( @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @@ -197,6 +170,36 @@ Mono> listByResourceGroup( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startAssessment( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> redeploy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -571,19 +574,20 @@ public PagedIterable list(Context context) { } /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param expand The child resources to include in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startAssessmentWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, String expand) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -604,35 +608,39 @@ private Mono>> startAssessmentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil .withContext( context -> service - .startAssessment( + .getByResourceGroup( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, + expand, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param expand The child resources to include in the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startAssessmentWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -653,99 +661,22 @@ private Mono>> startAssessmentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .startAssessment( + .getByResourceGroup( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, + expand, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context); } /** - * Starts Assessment on SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAssessmentAsync( - String resourceGroupName, String sqlVirtualMachineName) { - Mono>> mono = - startAssessmentWithResponseAsync(resourceGroupName, sqlVirtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts Assessment on SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAssessmentAsync( - String resourceGroupName, String sqlVirtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startAssessmentWithResponseAsync(resourceGroupName, sqlVirtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts Assessment on SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStartAssessment( - String resourceGroupName, String sqlVirtualMachineName) { - return beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName).getSyncPoller(); - } - - /** - * Starts Assessment on SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStartAssessment( - String resourceGroupName, String sqlVirtualMachineName, Context context) { - return beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName, context).getSyncPoller(); - } - - /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -753,79 +684,68 @@ public SyncPoller, Void> beginStartAssessment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a SQL virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAssessmentAsync(String resourceGroupName, String sqlVirtualMachineName) { - return beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono getByResourceGroupAsync( + String resourceGroupName, String sqlVirtualMachineName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param expand The child resources to include in the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAssessmentAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) { - return beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts Assessment on SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startAssessment(String resourceGroupName, String sqlVirtualMachineName) { - startAssessmentAsync(resourceGroupName, sqlVirtualMachineName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlVirtualMachineName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineName, expand, context).block(); } /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context) { - startAssessmentAsync(resourceGroupName, sqlVirtualMachineName, context).block(); + public SqlVirtualMachineInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName) { + final String expand = null; + return getByResourceGroupWithResponse(resourceGroupName, sqlVirtualMachineName, expand, Context.NONE) + .getValue(); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -846,35 +766,44 @@ private Mono>> redeployWithResponseAsync( 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 accept = "application/json"; return FluxUtil .withContext( context -> service - .redeploy( + .createOrUpdate( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), + parameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -895,178 +824,212 @@ private Mono>> redeployWithResponseAsync( 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 accept = "application/json"; context = this.client.mergeContext(context); return service - .redeploy( + .createOrUpdate( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), + parameters, + accept, context); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String sqlVirtualMachineName) { - Mono>> mono = redeployWithResponseAsync(resourceGroupName, sqlVirtualMachineName); + private PollerFlux, SqlVirtualMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Uninstalls and reinstalls the SQL Iaas Extension. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlVirtualMachineInner.class, + SqlVirtualMachineInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a SQL virtual machine. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String sqlVirtualMachineName, Context context) { + private PollerFlux, SqlVirtualMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - redeployWithResponseAsync(resourceGroupName, sqlVirtualMachineName, context); + createOrUpdateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlVirtualMachineInner.class, + SqlVirtualMachineInner.class, + context); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRedeploy(String resourceGroupName, String sqlVirtualMachineName) { - return beginRedeployAsync(resourceGroupName, sqlVirtualMachineName).getSyncPoller(); + public SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters).getSyncPoller(); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, String sqlVirtualMachineName, Context context) { - return beginRedeployAsync(resourceGroupName, sqlVirtualMachineName, context).getSyncPoller(); + public SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) + .getSyncPoller(); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a SQL virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync(String resourceGroupName, String sqlVirtualMachineName) { - return beginRedeployAsync(resourceGroupName, sqlVirtualMachineName) + private Mono createOrUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a SQL virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) { - return beginRedeployAsync(resourceGroupName, sqlVirtualMachineName, context) + private Mono createOrUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String sqlVirtualMachineName) { - redeployAsync(resourceGroupName, sqlVirtualMachineName).block(); + public SqlVirtualMachineInner createOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters).block(); } /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Creates or updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context) { - redeployAsync(resourceGroupName, sqlVirtualMachineName, context).block(); + public SqlVirtualMachineInner createOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).block(); } /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param expand The child resources to include in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, String expand) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1092,11 +1055,10 @@ private Mono> getByResourceGroupWithResponseAsy .withContext( context -> service - .getByResourceGroup( + .delete( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, - expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -1105,21 +1067,20 @@ private Mono> getByResourceGroupWithResponseAsy } /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param expand The child resources to include in the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, String expand, Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1143,11 +1104,10 @@ private Mono> getByResourceGroupWithResponseAsy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( + .delete( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, - expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -1155,45 +1115,122 @@ private Mono> getByResourceGroupWithResponseAsy } /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param expand The child resources to include in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlVirtualMachineName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sqlVirtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a SQL virtual machine. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlVirtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sqlVirtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a SQL virtual machine. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlVirtualMachineName) { + return this.beginDeleteAsync(resourceGroupName, sqlVirtualMachineName).getSyncPoller(); + } + + /** + * Deletes a SQL virtual machine. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlVirtualMachineName, Context context) { + return this.beginDeleteAsync(resourceGroupName, sqlVirtualMachineName, context).getSyncPoller(); + } + + /** + * Deletes a SQL virtual machine. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String sqlVirtualMachineName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String sqlVirtualMachineName) { + return beginDeleteAsync(resourceGroupName, sqlVirtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String sqlVirtualMachineName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlVirtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1201,35 +1238,30 @@ private Mono getByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVirtualMachineInner getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, sqlVirtualMachineName, expand).block(); + public void delete(String resourceGroupName, String sqlVirtualMachineName) { + deleteAsync(resourceGroupName, sqlVirtualMachineName).block(); } /** - * Gets a SQL virtual machine. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param expand The child resources to include in the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlVirtualMachineName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sqlVirtualMachineName, expand, context).block(); + public void delete(String resourceGroupName, String sqlVirtualMachineName, Context context) { + deleteAsync(resourceGroupName, sqlVirtualMachineName, context).block(); } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1241,8 +1273,8 @@ public Response getByResourceGroupWithResponse( * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1273,7 +1305,7 @@ private Mono>> createOrUpdateWithResponseAsync( .withContext( context -> service - .createOrUpdate( + .update( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, @@ -1286,7 +1318,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1299,8 +1331,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1329,7 +1361,7 @@ private Mono>> createOrUpdateWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .update( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, @@ -1341,7 +1373,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1353,10 +1385,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlVirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { + private PollerFlux, SqlVirtualMachineInner> beginUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters); + updateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters); return this .client .getLroResult( @@ -1368,7 +1400,7 @@ private PollerFlux, SqlVirtualMachineInner> b } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1381,11 +1413,11 @@ private PollerFlux, SqlVirtualMachineInner> b * @return the {@link PollerFlux} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlVirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { + private PollerFlux, SqlVirtualMachineInner> beginUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters, context); + updateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters, context); return this .client .getLroResult( @@ -1397,7 +1429,7 @@ private PollerFlux, SqlVirtualMachineInner> b } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1409,13 +1441,13 @@ private PollerFlux, SqlVirtualMachineInner> b * @return the {@link SyncPoller} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters).getSyncPoller(); + public SyncPoller, SqlVirtualMachineInner> beginUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { + return this.beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters).getSyncPoller(); } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1428,13 +1460,13 @@ public SyncPoller, SqlVirtualMachineInner> be * @return the {@link SyncPoller} for polling of a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlVirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).getSyncPoller(); + public SyncPoller, SqlVirtualMachineInner> beginUpdate( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).getSyncPoller(); } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1446,15 +1478,15 @@ public SyncPoller, SqlVirtualMachineInner> be * @return a SQL virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters) + private Mono updateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { + return beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1467,15 +1499,15 @@ private Mono createOrUpdateAsync( * @return a SQL virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) + private Mono updateAsync( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1487,13 +1519,13 @@ private Mono createOrUpdateAsync( * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVirtualMachineInner createOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters) { - return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters).block(); + public SqlVirtualMachineInner update( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { + return updateAsync(resourceGroupName, sqlVirtualMachineName, parameters).block(); } /** - * Creates or updates a SQL virtual machine. + * Updates a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -1506,25 +1538,24 @@ public SqlVirtualMachineInner createOrUpdate( * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVirtualMachineInner createOrUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).block(); + public SqlVirtualMachineInner update( + String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { + return updateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).block(); } /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return all SQL virtual machines in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1535,45 +1566,51 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (sqlVirtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), + accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return all SQL virtual machines in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1584,188 +1621,113 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (sqlVirtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), - context); - } - - /** - * Deletes a SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String sqlVirtualMachineName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, sqlVirtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String sqlVirtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sqlVirtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlVirtualMachineName) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineName).getSyncPoller(); - } - - /** - * Deletes a SQL virtual machine. - * - * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from - * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String sqlVirtualMachineName, Context context) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineName, context).getSyncPoller(); + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String sqlVirtualMachineName) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) { - return beginDeleteAsync(resourceGroupName, sqlVirtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String sqlVirtualMachineName) { - deleteAsync(resourceGroupName, sqlVirtualMachineName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Deletes a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String sqlVirtualMachineName, Context context) { - deleteAsync(resourceGroupName, sqlVirtualMachineName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { + private Mono>> startAssessmentWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1786,44 +1748,37 @@ private Mono>> updateWithResponseAsync( 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 accept = "application/json"; return FluxUtil .withContext( context -> service - .update( + .startAssessment( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), - parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { + private Mono>> startAssessmentWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1844,209 +1799,181 @@ private Mono>> updateWithResponseAsync( 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 accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .startAssessment( this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), - parameters, accept, context); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 SQL virtual machine. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlVirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { + private PollerFlux, Void> beginStartAssessmentAsync( + String resourceGroupName, String sqlVirtualMachineName) { Mono>> mono = - updateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters); + startAssessmentWithResponseAsync(resourceGroupName, sqlVirtualMachineName); return this .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SqlVirtualMachineInner.class, - SqlVirtualMachineInner.class, - this.client.getContext()); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 SQL virtual machine. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlVirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { + private PollerFlux, Void> beginStartAssessmentAsync( + String resourceGroupName, String sqlVirtualMachineName, Context context) { context = this.client.mergeContext(context); Mono>> mono = - updateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, parameters, context); + startAssessmentWithResponseAsync(resourceGroupName, sqlVirtualMachineName, context); return this .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SqlVirtualMachineInner.class, - SqlVirtualMachineInner.class, - context); + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 SQL virtual machine. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlVirtualMachineInner> beginUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { - return beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters).getSyncPoller(); + public SyncPoller, Void> beginStartAssessment( + String resourceGroupName, String sqlVirtualMachineName) { + return this.beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName).getSyncPoller(); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 SQL virtual machine. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlVirtualMachineInner> beginUpdate( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginStartAssessment( + String resourceGroupName, String sqlVirtualMachineName, Context context) { + return this.beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName, context).getSyncPoller(); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { - return beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters) + private Mono startAssessmentAsync(String resourceGroupName, String sqlVirtualMachineName) { + return beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context) + private Mono startAssessmentAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) { + return beginStartAssessmentAsync(resourceGroupName, sqlVirtualMachineName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVirtualMachineInner update( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters) { - return updateAsync(resourceGroupName, sqlVirtualMachineName, parameters).block(); + public void startAssessment(String resourceGroupName, String sqlVirtualMachineName) { + startAssessmentAsync(resourceGroupName, sqlVirtualMachineName).block(); } /** - * Updates a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param parameters The SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVirtualMachineInner update( - String resourceGroupName, String sqlVirtualMachineName, SqlVirtualMachineUpdate parameters, Context context) { - return updateAsync(resourceGroupName, sqlVirtualMachineName, parameters, context).block(); + public void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context) { + startAssessmentAsync(resourceGroupName, sqlVirtualMachineName, context).block(); } /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono>> redeployWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2057,6 +1984,10 @@ private Mono> listByResourceGroupSinglePag return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -2068,40 +1999,32 @@ private Mono> listByResourceGroupSinglePag .withContext( context -> service - .listByResourceGroup( + .redeploy( this.client.getEndpoint(), resourceGroupName, + sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> redeployWithResponseAsync( + String resourceGroupName, String sqlVirtualMachineName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2112,6 +2035,10 @@ private Mono> listByResourceGroupSinglePag return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -2121,88 +2048,160 @@ private Mono> listByResourceGroupSinglePag final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( + .redeploy( this.client.getEndpoint(), resourceGroupName, + sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String sqlVirtualMachineName) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, sqlVirtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String sqlVirtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, sqlVirtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String sqlVirtualMachineName) { + return this.beginRedeployAsync(resourceGroupName, sqlVirtualMachineName).getSyncPoller(); } /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String sqlVirtualMachineName, Context context) { + return this.beginRedeployAsync(resourceGroupName, sqlVirtualMachineName, context).getSyncPoller(); + } + + /** + * Uninstalls and reinstalls the SQL IaaS Extension. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync(String resourceGroupName, String sqlVirtualMachineName) { + return beginRedeployAsync(resourceGroupName, sqlVirtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Uninstalls and reinstalls the SQL IaaS Extension. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) { + return beginRedeployAsync(resourceGroupName, sqlVirtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Uninstalls and reinstalls the SQL IaaS Extension. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String sqlVirtualMachineName) { + redeployAsync(resourceGroupName, sqlVirtualMachineName).block(); + } + + /** + * Uninstalls and reinstalls the SQL IaaS Extension. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context) { + redeployAsync(resourceGroupName, sqlVirtualMachineName, context).block(); } /** diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesImpl.java index 5e0ccc2853512..88883e297c91d 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesImpl.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVirtualMachinesImpl.java @@ -52,32 +52,6 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new SqlVirtualMachineImpl(inner1, this.manager())); } - public void startAssessment(String resourceGroupName, String sqlVirtualMachineName) { - this.serviceClient().startAssessment(resourceGroupName, sqlVirtualMachineName); - } - - public void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context) { - this.serviceClient().startAssessment(resourceGroupName, sqlVirtualMachineName, context); - } - - public void redeploy(String resourceGroupName, String sqlVirtualMachineName) { - this.serviceClient().redeploy(resourceGroupName, sqlVirtualMachineName); - } - - public void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context) { - this.serviceClient().redeploy(resourceGroupName, sqlVirtualMachineName, context); - } - - public SqlVirtualMachine getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName) { - SqlVirtualMachineInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, sqlVirtualMachineName); - if (inner != null) { - return new SqlVirtualMachineImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String sqlVirtualMachineName, String expand, Context context) { Response inner = @@ -95,6 +69,16 @@ public Response getByResourceGroupWithResponse( } } + public SqlVirtualMachine getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName) { + SqlVirtualMachineInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sqlVirtualMachineName); + if (inner != null) { + return new SqlVirtualMachineImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String sqlVirtualMachineName) { this.serviceClient().delete(resourceGroupName, sqlVirtualMachineName); } @@ -114,6 +98,22 @@ public PagedIterable listByResourceGroup(String resourceGroup return Utils.mapPage(inner, inner1 -> new SqlVirtualMachineImpl(inner1, this.manager())); } + public void startAssessment(String resourceGroupName, String sqlVirtualMachineName) { + this.serviceClient().startAssessment(resourceGroupName, sqlVirtualMachineName); + } + + public void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context) { + this.serviceClient().startAssessment(resourceGroupName, sqlVirtualMachineName, context); + } + + public void redeploy(String resourceGroupName, String sqlVirtualMachineName) { + this.serviceClient().redeploy(resourceGroupName, sqlVirtualMachineName); + } + + public void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context) { + this.serviceClient().redeploy(resourceGroupName, sqlVirtualMachineName, context); + } + public SqlVirtualMachine getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVmTroubleshootingImpl.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVmTroubleshootingImpl.java new file mode 100644 index 0000000000000..d6761207856f4 --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/implementation/SqlVmTroubleshootingImpl.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.sqlvirtualmachine.implementation; + +import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; +import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmTroubleshooting; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingAdditionalProperties; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingScenario; +import java.time.OffsetDateTime; + +public final class SqlVmTroubleshootingImpl implements SqlVmTroubleshooting { + private SqlVmTroubleshootingInner innerObject; + + private final com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager serviceManager; + + SqlVmTroubleshootingImpl( + SqlVmTroubleshootingInner innerObject, + com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime startTimeUtc() { + return this.innerModel().startTimeUtc(); + } + + public OffsetDateTime endTimeUtc() { + return this.innerModel().endTimeUtc(); + } + + public TroubleshootingScenario troubleshootingScenario() { + return this.innerModel().troubleshootingScenario(); + } + + public TroubleshootingAdditionalProperties properties() { + return this.innerModel().properties(); + } + + public String virtualMachineResourceId() { + return this.innerModel().virtualMachineResourceId(); + } + + public SqlVmTroubleshootingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AadAuthenticationSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AadAuthenticationSettings.java new file mode 100644 index 0000000000000..1fb01d30fc3f1 --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AadAuthenticationSettings.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.sqlvirtualmachine.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable AAD authentication for SQL VM. */ +@Fluent +public final class AadAuthenticationSettings { + /* + * The client Id of the Managed Identity to query Microsoft Graph API. An empty string must be used for the system + * assigned Managed Identity + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** Creates an instance of AadAuthenticationSettings class. */ + public AadAuthenticationSettings() { + } + + /** + * Get the clientId property: The client Id of the Managed Identity to query Microsoft Graph API. An empty string + * must be used for the system assigned Managed Identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client Id of the Managed Identity to query Microsoft Graph API. An empty string + * must be used for the system assigned Managed Identity. + * + * @param clientId the clientId value to set. + * @return the AadAuthenticationSettings object itself. + */ + public AadAuthenticationSettings withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AdditionalFeaturesServerConfigurations.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AdditionalFeaturesServerConfigurations.java index ec3937d99f890..ecdf5635720a5 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AdditionalFeaturesServerConfigurations.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AdditionalFeaturesServerConfigurations.java @@ -16,6 +16,10 @@ public final class AdditionalFeaturesServerConfigurations { @JsonProperty(value = "isRServicesEnabled") private Boolean isRServicesEnabled; + /** Creates an instance of AdditionalFeaturesServerConfigurations class. */ + public AdditionalFeaturesServerConfigurations() { + } + /** * Get the isRServicesEnabled property: Enable or disable R services (SQL 2016 onwards). * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgConfiguration.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgConfiguration.java index cd3ec0099bbd3..415b45a96bc53 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgConfiguration.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgConfiguration.java @@ -17,6 +17,10 @@ public final class AgConfiguration { @JsonProperty(value = "replicas") private List replicas; + /** Creates an instance of AgConfiguration class. */ + public AgConfiguration() { + } + /** * Get the replicas property: Replica configurations. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgReplica.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgReplica.java index d9f193eedb376..5cf8c63a83a51 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgReplica.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AgReplica.java @@ -40,6 +40,10 @@ public final class AgReplica { @JsonProperty(value = "readableSecondary") private ReadableSecondary readableSecondary; + /** Creates an instance of AgReplica class. */ + public AgReplica() { + } + /** * Get the sqlVirtualMachineInstanceId property: Sql VirtualMachine Instance Id. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AssessmentSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AssessmentSettings.java index b35222327edf1..ab8e5a95908fa 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AssessmentSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AssessmentSettings.java @@ -7,29 +7,33 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Configure assessment for databases in your SQL virtual machine. */ +/** Configure SQL best practices Assessment for databases in your SQL virtual machine. */ @Fluent public final class AssessmentSettings { /* - * Enable or disable assessment feature on SQL virtual machine. + * Enable or disable SQL best practices Assessment feature on SQL virtual machine. */ @JsonProperty(value = "enable") private Boolean enable; /* - * Run assessment immediately on SQL virtual machine. + * Run SQL best practices Assessment immediately on SQL virtual machine. */ @JsonProperty(value = "runImmediately") private Boolean runImmediately; /* - * Schedule for Assessment. + * Schedule for SQL best practices Assessment. */ @JsonProperty(value = "schedule") private Schedule schedule; + /** Creates an instance of AssessmentSettings class. */ + public AssessmentSettings() { + } + /** - * Get the enable property: Enable or disable assessment feature on SQL virtual machine. + * Get the enable property: Enable or disable SQL best practices Assessment feature on SQL virtual machine. * * @return the enable value. */ @@ -38,7 +42,7 @@ public Boolean enable() { } /** - * Set the enable property: Enable or disable assessment feature on SQL virtual machine. + * Set the enable property: Enable or disable SQL best practices Assessment feature on SQL virtual machine. * * @param enable the enable value to set. * @return the AssessmentSettings object itself. @@ -49,7 +53,7 @@ public AssessmentSettings withEnable(Boolean enable) { } /** - * Get the runImmediately property: Run assessment immediately on SQL virtual machine. + * Get the runImmediately property: Run SQL best practices Assessment immediately on SQL virtual machine. * * @return the runImmediately value. */ @@ -58,7 +62,7 @@ public Boolean runImmediately() { } /** - * Set the runImmediately property: Run assessment immediately on SQL virtual machine. + * Set the runImmediately property: Run SQL best practices Assessment immediately on SQL virtual machine. * * @param runImmediately the runImmediately value to set. * @return the AssessmentSettings object itself. @@ -69,7 +73,7 @@ public AssessmentSettings withRunImmediately(Boolean runImmediately) { } /** - * Get the schedule property: Schedule for Assessment. + * Get the schedule property: Schedule for SQL best practices Assessment. * * @return the schedule value. */ @@ -78,7 +82,7 @@ public Schedule schedule() { } /** - * Set the schedule property: Schedule for Assessment. + * Set the schedule property: Schedule for SQL best practices Assessment. * * @param schedule the schedule value to set. * @return the AssessmentSettings object itself. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AutoBackupDaysOfWeek.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AutoBackupDaysOfWeek.java index f851760972ea2..ce61e9a3b3771 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AutoBackupDaysOfWeek.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/AutoBackupDaysOfWeek.java @@ -31,6 +31,15 @@ public final class AutoBackupDaysOfWeek extends ExpandableStringEnum getWithResponse( + String resourceGroupName, + String sqlVirtualMachineGroupName, + String availabilityGroupListenerName, + String expand, + Context context); /** * Gets an availability group listener. @@ -32,19 +38,13 @@ AvailabilityGroupListener get( * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. * @param availabilityGroupListenerName Name of the availability group listener. - * @param expand The child resources to include in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an availability group listener along with {@link Response}. + * @return an availability group listener. */ - Response getWithResponse( - String resourceGroupName, - String sqlVirtualMachineGroupName, - String availabilityGroupListenerName, - String expand, - Context context); + AvailabilityGroupListener get( + String resourceGroupName, String sqlVirtualMachineGroupName, String availabilityGroupListenerName); /** * Deletes an availability group listener. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/BackupScheduleType.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/BackupScheduleType.java index 27a39a6b239e3..97122ed3c3228 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/BackupScheduleType.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/BackupScheduleType.java @@ -16,6 +16,15 @@ public final class BackupScheduleType extends ExpandableStringEnum { /** Static value ASYNCHRONOUS_COMMIT for Commit. */ public static final Commit ASYNCHRONOUS_COMMIT = fromString("ASYNCHRONOUS_COMMIT"); + /** + * Creates a new instance of Commit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Commit() { + } + /** * Creates or finds a Commit from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ConnectivityType.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ConnectivityType.java index bcfd62667b1b7..2dec31cb67b7f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ConnectivityType.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ConnectivityType.java @@ -19,6 +19,15 @@ public final class ConnectivityType extends ExpandableStringEnum { /** Static value MANUAL for Failover. */ public static final Failover MANUAL = fromString("MANUAL"); + /** + * Creates a new instance of Failover value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Failover() { + } + /** * Creates or finds a Failover from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/FullBackupFrequencyType.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/FullBackupFrequencyType.java index c917eb8b3a0c8..d262b1956f807 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/FullBackupFrequencyType.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/FullBackupFrequencyType.java @@ -16,6 +16,15 @@ public final class FullBackupFrequencyType extends ExpandableStringEnum { /** Static value SystemAssigned for IdentityType. */ public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + /** + * Creates a new instance of IdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityType() { + } + /** * Creates or finds a IdentityType from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/KeyVaultCredentialSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/KeyVaultCredentialSettings.java index 43d6330b2949f..666d11e9bde8b 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/KeyVaultCredentialSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/KeyVaultCredentialSettings.java @@ -40,6 +40,10 @@ public final class KeyVaultCredentialSettings { @JsonProperty(value = "servicePrincipalSecret") private String servicePrincipalSecret; + /** Creates an instance of KeyVaultCredentialSettings class. */ + public KeyVaultCredentialSettings() { + } + /** * Get the enable property: Enable or disable key vault credential setting. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/LeastPrivilegeMode.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/LeastPrivilegeMode.java index 8c4fb9bdf8227..7dcdcd74c2751 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/LeastPrivilegeMode.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/LeastPrivilegeMode.java @@ -13,6 +13,18 @@ public final class LeastPrivilegeMode extends ExpandableStringEnum sqlVirtualMachineInstances; + /** Creates an instance of LoadBalancerConfiguration class. */ + public LoadBalancerConfiguration() { + } + /** * Get the privateIpAddress property: Private IP address. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/MultiSubnetIpConfiguration.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/MultiSubnetIpConfiguration.java index 658d8fdf04c09..fe5d6a4d6ff5b 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/MultiSubnetIpConfiguration.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/MultiSubnetIpConfiguration.java @@ -23,6 +23,10 @@ public final class MultiSubnetIpConfiguration { @JsonProperty(value = "sqlVirtualMachineInstance", required = true) private String sqlVirtualMachineInstance; + /** Creates an instance of MultiSubnetIpConfiguration class. */ + public MultiSubnetIpConfiguration() { + } + /** * Get the privateIpAddress property: Private IP address. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationDisplay.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationDisplay.java index c110ca5216707..4ec3759d38fe4 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationDisplay.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationDisplay.java @@ -34,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationListResult.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationListResult.java index 9f1be4ed49cbf..c505983d75262 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationListResult.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationListResult.java @@ -24,6 +24,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: Array of results. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationOrigin.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationOrigin.java index b1bf192997733..5f6c5114de83d 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationOrigin.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/OperationOrigin.java @@ -16,6 +16,15 @@ public final class OperationOrigin extends ExpandableStringEnum /** Static value system for OperationOrigin. */ public static final OperationOrigin SYSTEM = fromString("system"); + /** + * Creates a new instance of OperationOrigin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationOrigin() { + } + /** * Creates or finds a OperationOrigin from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/PrivateIpAddress.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/PrivateIpAddress.java index fda692625b205..87e4823042d29 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/PrivateIpAddress.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/PrivateIpAddress.java @@ -22,6 +22,10 @@ public final class PrivateIpAddress { @JsonProperty(value = "subnetResourceId") private String subnetResourceId; + /** Creates an instance of PrivateIpAddress class. */ + public PrivateIpAddress() { + } + /** * Get the ipAddress property: Private IP address bound to the availability group listener. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ReadableSecondary.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ReadableSecondary.java index 7b9e1206da51b..7e9feb6974a2e 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ReadableSecondary.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ReadableSecondary.java @@ -19,6 +19,15 @@ public final class ReadableSecondary extends ExpandableStringEnum { /** Static value SECONDARY for Role. */ public static final Role SECONDARY = fromString("SECONDARY"); + /** + * Creates a new instance of Role value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Role() { + } + /** * Creates or finds a Role from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ScaleType.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ScaleType.java index 13fa09f2ae0fd..528d2b1435ed4 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ScaleType.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ScaleType.java @@ -13,6 +13,15 @@ public final class ScaleType extends ExpandableStringEnum { /** Static value HA for ScaleType. */ public static final ScaleType HA = fromString("HA"); + /** + * Creates a new instance of ScaleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScaleType() { + } + /** * Creates or finds a ScaleType from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/Schedule.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/Schedule.java index 61cf71924c565..9af385ba232d6 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/Schedule.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/Schedule.java @@ -41,6 +41,10 @@ public final class Schedule { @JsonProperty(value = "startTime") private String startTime; + /** Creates an instance of Schedule class. */ + public Schedule() { + } + /** * Get the enable property: Enable or disable assessment schedule on SQL virtual machine. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ServerConfigurationsManagementSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ServerConfigurationsManagementSettings.java index a360bae91647a..172e55975e65f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ServerConfigurationsManagementSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/ServerConfigurationsManagementSettings.java @@ -40,6 +40,16 @@ public final class ServerConfigurationsManagementSettings { @JsonProperty(value = "sqlInstanceSettings") private SqlInstanceSettings sqlInstanceSettings; + /* + * Azure AD authentication Settings. + */ + @JsonProperty(value = "azureAdAuthenticationSettings") + private AadAuthenticationSettings azureAdAuthenticationSettings; + + /** Creates an instance of ServerConfigurationsManagementSettings class. */ + public ServerConfigurationsManagementSettings() { + } + /** * Get the sqlConnectivityUpdateSettings property: SQL connectivity type settings. * @@ -144,6 +154,27 @@ public ServerConfigurationsManagementSettings withSqlInstanceSettings(SqlInstanc return this; } + /** + * Get the azureAdAuthenticationSettings property: Azure AD authentication Settings. + * + * @return the azureAdAuthenticationSettings value. + */ + public AadAuthenticationSettings azureAdAuthenticationSettings() { + return this.azureAdAuthenticationSettings; + } + + /** + * Set the azureAdAuthenticationSettings property: Azure AD authentication Settings. + * + * @param azureAdAuthenticationSettings the azureAdAuthenticationSettings value to set. + * @return the ServerConfigurationsManagementSettings object itself. + */ + public ServerConfigurationsManagementSettings withAzureAdAuthenticationSettings( + AadAuthenticationSettings azureAdAuthenticationSettings) { + this.azureAdAuthenticationSettings = azureAdAuthenticationSettings; + return this; + } + /** * Validates the instance. * @@ -165,5 +196,8 @@ public void validate() { if (sqlInstanceSettings() != null) { sqlInstanceSettings().validate(); } + if (azureAdAuthenticationSettings() != null) { + azureAdAuthenticationSettings().validate(); + } } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlConnectivityUpdateSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlConnectivityUpdateSettings.java index bf59c84bfb186..ac662fc2d4bb4 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlConnectivityUpdateSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlConnectivityUpdateSettings.java @@ -34,6 +34,10 @@ public final class SqlConnectivityUpdateSettings { @JsonProperty(value = "sqlAuthUpdatePassword") private String sqlAuthUpdatePassword; + /** Creates an instance of SqlConnectivityUpdateSettings class. */ + public SqlConnectivityUpdateSettings() { + } + /** * Get the connectivityType property: SQL Server connectivity option. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlImageSku.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlImageSku.java index b1212c3344e7f..3e2ce577a17a3 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlImageSku.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlImageSku.java @@ -25,6 +25,15 @@ public final class SqlImageSku extends ExpandableStringEnum { /** Static value Web for SqlImageSku. */ public static final SqlImageSku WEB = fromString("Web"); + /** + * Creates a new instance of SqlImageSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SqlImageSku() { + } + /** * Creates or finds a SqlImageSku from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlInstanceSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlInstanceSettings.java index dcff040910e62..896d1a2d7ddf5 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlInstanceSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlInstanceSettings.java @@ -52,6 +52,10 @@ public final class SqlInstanceSettings { @JsonProperty(value = "isIfiEnabled") private Boolean isIfiEnabled; + /** Creates an instance of SqlInstanceSettings class. */ + public SqlInstanceSettings() { + } + /** * Get the collation property: SQL Server Collation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlManagementMode.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlManagementMode.java index a1a21ae8ef7af..073bf09a4345f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlManagementMode.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlManagementMode.java @@ -19,6 +19,15 @@ public final class SqlManagementMode extends ExpandableStringEnum tags; + /** Creates an instance of SqlVirtualMachineGroupUpdate class. */ + public SqlVirtualMachineGroupUpdate() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineGroups.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineGroups.java index c576916499985..6f4a55aaca763 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineGroups.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineGroups.java @@ -16,12 +16,14 @@ public interface SqlVirtualMachineGroups { * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine group. + * @return a SQL virtual machine group along with {@link Response}. */ - SqlVirtualMachineGroup getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlVirtualMachineGroupName, Context context); /** * Gets a SQL virtual machine group. @@ -29,14 +31,12 @@ public interface SqlVirtualMachineGroups { * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine group along with {@link Response}. + * @return a SQL virtual machine group. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlVirtualMachineGroupName, Context context); + SqlVirtualMachineGroup getByResourceGroup(String resourceGroupName, String sqlVirtualMachineGroupName); /** * Deletes a SQL virtual machine group. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineListResult.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineListResult.java index 80862b85fa5c9..b66ba15593cc6 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineListResult.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineListResult.java @@ -24,6 +24,10 @@ public final class SqlVirtualMachineListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of SqlVirtualMachineListResult class. */ + public SqlVirtualMachineListResult() { + } + /** * Get the value property: Array of results. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineTroubleshoots.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineTroubleshoots.java new file mode 100644 index 0000000000000..4d532f39d0561 --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineTroubleshoots.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.sqlvirtualmachine.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; + +/** Resource collection API of SqlVirtualMachineTroubleshoots. */ +public interface SqlVirtualMachineTroubleshoots { + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting. + */ + SqlVmTroubleshooting troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters); + + /** + * Starts SQL virtual machine troubleshooting. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param parameters The SQL virtual machine troubleshooting entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details required for SQL VM troubleshooting. + */ + SqlVmTroubleshooting troubleshoot( + String resourceGroupName, String sqlVirtualMachineName, SqlVmTroubleshootingInner parameters, Context context); +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineUpdate.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineUpdate.java index 067fbd5bd3f15..44db40315469e 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineUpdate.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachineUpdate.java @@ -19,6 +19,10 @@ public final class SqlVirtualMachineUpdate { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of SqlVirtualMachineUpdate class. */ + public SqlVirtualMachineUpdate() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachines.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachines.java index cd2278c5341d2..4e83268fc6fe3 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachines.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVirtualMachines.java @@ -61,32 +61,36 @@ PagedIterable listBySqlVmGroup( PagedIterable list(Context context); /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. + * @param expand The child resources to include in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL virtual machine along with {@link Response}. */ - void startAssessment(String resourceGroupName, String sqlVirtualMachineName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlVirtualMachineName, String expand, Context context); /** - * Starts Assessment on SQL virtual machine. + * Gets a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL virtual machine. */ - void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context); + SqlVirtualMachine getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName); /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -95,10 +99,10 @@ PagedIterable listBySqlVmGroup( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void redeploy(String resourceGroupName, String sqlVirtualMachineName); + void deleteByResourceGroup(String resourceGroupName, String sqlVirtualMachineName); /** - * Uninstalls and reinstalls the SQL Iaas Extension. + * Deletes a SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -108,39 +112,35 @@ PagedIterable listBySqlVmGroup( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context); + void delete(String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Gets a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - SqlVirtualMachine getByResourceGroup(String resourceGroupName, String sqlVirtualMachineName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets a SQL virtual machine. + * Gets all SQL virtual machines in a resource group. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. - * @param sqlVirtualMachineName Name of the SQL virtual machine. - * @param expand The child resources to include in the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SQL virtual machine along with {@link Response}. + * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlVirtualMachineName, String expand, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deletes a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -149,10 +149,10 @@ Response getByResourceGroupWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String sqlVirtualMachineName); + void startAssessment(String resourceGroupName, String sqlVirtualMachineName); /** - * Deletes a SQL virtual machine. + * Starts SQL best practices Assessment on SQL virtual machine. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. @@ -162,32 +162,32 @@ Response getByResourceGroupWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String sqlVirtualMachineName, Context context); + void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context); /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void redeploy(String resourceGroupName, String sqlVirtualMachineName); /** - * Gets all SQL virtual machines in a resource group. + * Uninstalls and reinstalls the SQL IaaS Extension. * * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName Name of the SQL virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all SQL virtual machines in a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context); /** * Gets a SQL virtual machine. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVmGroupImageSku.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVmGroupImageSku.java index 192b8b0fe02bd..700f6bdf5c0c2 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVmGroupImageSku.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlVmGroupImageSku.java @@ -16,6 +16,15 @@ public final class SqlVmGroupImageSku extends ExpandableStringEnum /** Static value DW for SqlWorkloadType. */ public static final SqlWorkloadType DW = fromString("DW"); + /** + * Creates a new instance of SqlWorkloadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SqlWorkloadType() { + } + /** * Creates or finds a SqlWorkloadType from its string representation. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlWorkloadTypeUpdateSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlWorkloadTypeUpdateSettings.java index 73b01523bdfab..671464b4ae90f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlWorkloadTypeUpdateSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/SqlWorkloadTypeUpdateSettings.java @@ -16,6 +16,10 @@ public final class SqlWorkloadTypeUpdateSettings { @JsonProperty(value = "sqlWorkloadType") private SqlWorkloadType sqlWorkloadType; + /** Creates an instance of SqlWorkloadTypeUpdateSettings class. */ + public SqlWorkloadTypeUpdateSettings() { + } + /** * Get the sqlWorkloadType property: SQL Server workload type. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageConfigurationSettings.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageConfigurationSettings.java index d8d4ee023ee65..d2ad8923415f8 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageConfigurationSettings.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageConfigurationSettings.java @@ -46,6 +46,10 @@ public final class StorageConfigurationSettings { @JsonProperty(value = "storageWorkloadType") private StorageWorkloadType storageWorkloadType; + /** Creates an instance of StorageConfigurationSettings class. */ + public StorageConfigurationSettings() { + } + /** * Get the sqlDataSettings property: SQL Server Data Storage Settings. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageWorkloadType.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageWorkloadType.java index b629c95e34125..2079288b3bf9f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageWorkloadType.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/StorageWorkloadType.java @@ -19,6 +19,15 @@ public final class StorageWorkloadType extends ExpandableStringEnum { + /** Static value UnhealthyReplica for TroubleshootingScenario. */ + public static final TroubleshootingScenario UNHEALTHY_REPLICA = fromString("UnhealthyReplica"); + + /** + * Creates a new instance of TroubleshootingScenario value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TroubleshootingScenario() { + } + + /** + * Creates or finds a TroubleshootingScenario from its string representation. + * + * @param name a name to look for. + * @return the corresponding TroubleshootingScenario. + */ + @JsonCreator + public static TroubleshootingScenario fromString(String name) { + return fromString(name, TroubleshootingScenario.class); + } + + /** + * Gets known TroubleshootingScenario values. + * + * @return known TroubleshootingScenario values. + */ + public static Collection values() { + return values(TroubleshootingScenario.class); + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/TroubleshootingStatus.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/TroubleshootingStatus.java new file mode 100644 index 0000000000000..6a9bc0d83b373 --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/TroubleshootingStatus.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sqlvirtualmachine.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Status of last troubleshooting operation on this SQL VM. */ +@Immutable +public final class TroubleshootingStatus { + /* + * Root cause of the issue + */ + @JsonProperty(value = "rootCause", access = JsonProperty.Access.WRITE_ONLY) + private String rootCause; + + /* + * Last troubleshooting trigger time in UTC timezone + */ + @JsonProperty(value = "lastTriggerTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastTriggerTimeUtc; + + /* + * Start time in UTC timezone. + */ + @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTimeUtc; + + /* + * End time in UTC timezone. + */ + @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTimeUtc; + + /* + * SQL VM troubleshooting scenario. + */ + @JsonProperty(value = "troubleshootingScenario", access = JsonProperty.Access.WRITE_ONLY) + private TroubleshootingScenario troubleshootingScenario; + + /* + * Troubleshooting properties + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private TroubleshootingAdditionalProperties properties; + + /** Creates an instance of TroubleshootingStatus class. */ + public TroubleshootingStatus() { + } + + /** + * Get the rootCause property: Root cause of the issue. + * + * @return the rootCause value. + */ + public String rootCause() { + return this.rootCause; + } + + /** + * Get the lastTriggerTimeUtc property: Last troubleshooting trigger time in UTC timezone. + * + * @return the lastTriggerTimeUtc value. + */ + public OffsetDateTime lastTriggerTimeUtc() { + return this.lastTriggerTimeUtc; + } + + /** + * Get the startTimeUtc property: Start time in UTC timezone. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the endTimeUtc property: End time in UTC timezone. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the troubleshootingScenario property: SQL VM troubleshooting scenario. + * + * @return the troubleshootingScenario value. + */ + public TroubleshootingScenario troubleshootingScenario() { + return this.troubleshootingScenario; + } + + /** + * Get the properties property: Troubleshooting properties. + * + * @return the properties value. + */ + public TroubleshootingAdditionalProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/UnhealthyReplicaInfo.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/UnhealthyReplicaInfo.java new file mode 100644 index 0000000000000..8c36d4b36efed --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/UnhealthyReplicaInfo.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.sqlvirtualmachine.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SQL VM Troubleshoot UnhealthyReplica scenario information. */ +@Fluent +public final class UnhealthyReplicaInfo { + /* + * The name of the availability group + */ + @JsonProperty(value = "availabilityGroupName") + private String availabilityGroupName; + + /** Creates an instance of UnhealthyReplicaInfo class. */ + public UnhealthyReplicaInfo() { + } + + /** + * Get the availabilityGroupName property: The name of the availability group. + * + * @return the availabilityGroupName value. + */ + public String availabilityGroupName() { + return this.availabilityGroupName; + } + + /** + * Set the availabilityGroupName property: The name of the availability group. + * + * @param availabilityGroupName the availabilityGroupName value to set. + * @return the UnhealthyReplicaInfo object itself. + */ + public UnhealthyReplicaInfo withAvailabilityGroupName(String availabilityGroupName) { + this.availabilityGroupName = availabilityGroupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainCredentials.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainCredentials.java index 8ca5a74b7f06a..b1423745d9f61 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainCredentials.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainCredentials.java @@ -28,6 +28,10 @@ public final class WsfcDomainCredentials { @JsonProperty(value = "sqlServiceAccountPassword") private String sqlServiceAccountPassword; + /** Creates an instance of WsfcDomainCredentials class. */ + public WsfcDomainCredentials() { + } + /** * Get the clusterBootstrapAccountPassword property: Cluster bootstrap account password. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainProfile.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainProfile.java index f04abed27fab9..aaca04fec65fb 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainProfile.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/models/WsfcDomainProfile.java @@ -65,6 +65,10 @@ public final class WsfcDomainProfile { @JsonProperty(value = "clusterSubnetType") private ClusterSubnetType clusterSubnetType; + /** Creates an instance of WsfcDomainProfile class. */ + public WsfcDomainProfile() { + } + /** * Get the domainFqdn property: Fully qualified name of the domain. * diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateSamples.java index 030c4c92b62ea..1612dc08a2e96 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ /** Samples for AvailabilityGroupListeners CreateOrUpdate. */ public final class AvailabilityGroupListenersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.json */ /** * Sample code: Creates or updates an availability group listener using load balancer. This is used for VMs present @@ -50,7 +50,7 @@ public final class AvailabilityGroupListenersCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateAvailabilityGroupListenerWithMultiSubnet.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListenerWithMultiSubnet.json */ /** * Sample code: Creates or updates an availability group listener. This is used for VMs present in multi subnet. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteSamples.java index 515d91402e945..0386b96f763c7 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for AvailabilityGroupListeners Delete. */ public final class AvailabilityGroupListenersDeleteSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/DeleteAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteAvailabilityGroupListener.json */ /** * Sample code: Deletes an availability group listener. @@ -18,6 +16,8 @@ public final class AvailabilityGroupListenersDeleteSamples { */ public static void deletesAnAvailabilityGroupListener( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.availabilityGroupListeners().delete("testrg", "testvmgroup", "agl-test", Context.NONE); + manager + .availabilityGroupListeners() + .delete("testrg", "testvmgroup", "agl-test", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersGetSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersGetSamples.java index de97ada7108b3..08a6546d32be8 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersGetSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for AvailabilityGroupListeners Get. */ public final class AvailabilityGroupListenersGetSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/GetAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetAvailabilityGroupListener.json */ /** * Sample code: Gets an availability group listener. @@ -18,6 +16,8 @@ public final class AvailabilityGroupListenersGetSamples { */ public static void getsAnAvailabilityGroupListener( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.availabilityGroupListeners().getWithResponse("testrg", "testvmgroup", "agl-test", null, Context.NONE); + manager + .availabilityGroupListeners() + .getWithResponse("testrg", "testvmgroup", "agl-test", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupSamples.java index 273bed6c995fe..7d5ab1b8b1188 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for AvailabilityGroupListeners ListByGroup. */ public final class AvailabilityGroupListenersListByGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListByGroupAvailabilityGroupListener.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByGroupAvailabilityGroupListener.json */ /** * Sample code: Lists all availability group listeners in a SQL virtual machine group. @@ -18,6 +16,6 @@ public final class AvailabilityGroupListenersListByGroupSamples { */ public static void listsAllAvailabilityGroupListenersInASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.availabilityGroupListeners().listByGroup("testrg", "testvmgroup", Context.NONE); + manager.availabilityGroupListeners().listByGroup("testrg", "testvmgroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListSamples.java index 56fe4e87e31d9..eac3683e8a1d3 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListOperation.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListOperation.json */ /** * Sample code: Lists all of the available SQL Virtual Machine Rest API operations. @@ -18,6 +16,6 @@ public final class OperationsListSamples { */ public static void listsAllOfTheAvailableSQLVirtualMachineRestAPIOperations( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateSamples.java index 2b729d42bd626..a7fb327dbc8f8 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for SqlVirtualMachineGroups CreateOrUpdate. */ public final class SqlVirtualMachineGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.json */ /** * Sample code: Creates or updates a SQL virtual machine group. @@ -38,7 +38,7 @@ public static void createsOrUpdatesASQLVirtualMachineGroup( .withClusterOperatorAccount("testrp@testdomain.com") .withSqlServiceAccount("sqlservice@testdomain.com") .withStorageAccountUrl("https://storgact.blob.core.windows.net/") - .withStorageAccountPrimaryKey("") + .withStorageAccountPrimaryKey("fakeTokenPlaceholder") .withClusterSubnetType(ClusterSubnetType.MULTI_SUBNET)) .create(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteSamples.java index dcc00f2b55adf..fde2911cf752a 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups Delete. */ public final class SqlVirtualMachineGroupsDeleteSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/DeleteSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachineGroup.json */ /** * Sample code: Deletes a SQL virtual machine group. @@ -18,6 +16,6 @@ public final class SqlVirtualMachineGroupsDeleteSamples { */ public static void deletesASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().delete("testrg", "testvmgroup", Context.NONE); + manager.sqlVirtualMachineGroups().delete("testrg", "testvmgroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsGetByResourceGroupSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsGetByResourceGroupSamples.java index 8af743a5f5937..4c9d1253c09d0 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsGetByResourceGroupSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups GetByResourceGroup. */ public final class SqlVirtualMachineGroupsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/GetSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachineGroup.json */ /** * Sample code: Gets a SQL virtual machine group. @@ -18,6 +16,8 @@ public final class SqlVirtualMachineGroupsGetByResourceGroupSamples { */ public static void getsASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().getByResourceGroupWithResponse("testrg", "testvmgroup", Context.NONE); + manager + .sqlVirtualMachineGroups() + .getByResourceGroupWithResponse("testrg", "testvmgroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupSamples.java index d914214c0cd10..0072d9e1b970e 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups ListByResourceGroup. */ public final class SqlVirtualMachineGroupsListByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json */ /** * Sample code: Gets all SQL virtual machine groups in a resource group. @@ -18,6 +16,6 @@ public final class SqlVirtualMachineGroupsListByResourceGroupSamples { */ public static void getsAllSQLVirtualMachineGroupsInAResourceGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().listByResourceGroup("testrg", Context.NONE); + manager.sqlVirtualMachineGroups().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListSamples.java index 647f6b6f01a26..44cef4fdc6547 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachineGroups List. */ public final class SqlVirtualMachineGroupsListSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json */ /** * Sample code: Gets all SQL virtual machine groups in a subscription. @@ -18,6 +16,6 @@ public final class SqlVirtualMachineGroupsListSamples { */ public static void getsAllSQLVirtualMachineGroupsInASubscription( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachineGroups().list(Context.NONE); + manager.sqlVirtualMachineGroups().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsUpdateSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsUpdateSamples.java index c7972e8963ab0..2696397c9289f 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsUpdateSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroup; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for SqlVirtualMachineGroups Update. */ public final class SqlVirtualMachineGroupsUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/UpdateSqlVirtualMachineGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachineGroup.json */ /** * Sample code: Updates a SQL virtual machine group tags. @@ -24,7 +23,7 @@ public static void updatesASQLVirtualMachineGroupTags( SqlVirtualMachineGroup resource = manager .sqlVirtualMachineGroups() - .getByResourceGroupWithResponse("testrg", "testvmgroup", Context.NONE) + .getByResourceGroupWithResponse("testrg", "testvmgroup", com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("mytag", "myval")).apply(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineTroubleshootTroubleshootSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineTroubleshootTroubleshootSamples.java new file mode 100644 index 0000000000000..2437b3bb617ae --- /dev/null +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineTroubleshootTroubleshootSamples.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.sqlvirtualmachine.generated; + +import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVmTroubleshootingInner; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingAdditionalProperties; +import com.azure.resourcemanager.sqlvirtualmachine.models.TroubleshootingScenario; +import com.azure.resourcemanager.sqlvirtualmachine.models.UnhealthyReplicaInfo; +import java.time.OffsetDateTime; + +/** Samples for SqlVirtualMachineTroubleshoot Troubleshoot. */ +public final class SqlVirtualMachineTroubleshootTroubleshootSamples { + /* + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/TroubleshootSqlVirtualMachine.json + */ + /** + * Sample code: Start SQL virtual machine troubleshooting operation. + * + * @param manager Entry point to SqlVirtualMachineManager. + */ + public static void startSQLVirtualMachineTroubleshootingOperation( + com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { + manager + .sqlVirtualMachineTroubleshoots() + .troubleshoot( + "testrg", + "testvm", + new SqlVmTroubleshootingInner() + .withStartTimeUtc(OffsetDateTime.parse("2022-07-09T17:10:00Z")) + .withEndTimeUtc(OffsetDateTime.parse("2022-07-09T22:10:00Z")) + .withTroubleshootingScenario(TroubleshootingScenario.UNHEALTHY_REPLICA) + .withProperties( + new TroubleshootingAdditionalProperties() + .withUnhealthyReplicaInfo(new UnhealthyReplicaInfo().withAvailabilityGroupName("AG1"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateSamples.java index 0059aa54c2f8f..9f05d413180b8 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; +import com.azure.resourcemanager.sqlvirtualmachine.models.AadAuthenticationSettings; import com.azure.resourcemanager.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations; import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentDayOfWeek; import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings; @@ -37,7 +38,7 @@ /** Samples for SqlVirtualMachines CreateOrUpdate. */ public final class SqlVirtualMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json */ /** * Sample code: Creates or updates a SQL virtual machine for Storage Configuration Settings to EXTEND Data, Log or @@ -63,7 +64,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.json */ /** * Sample code: Creates or updates a SQL virtual machine and joins it to a SQL virtual machine group. @@ -81,15 +82,15 @@ public static void createsOrUpdatesASQLVirtualMachineAndJoinsItToASQLVirtualMach "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2") .withWsfcDomainCredentials( new WsfcDomainCredentials() - .withClusterBootstrapAccountPassword("") - .withClusterOperatorAccountPassword("") - .withSqlServiceAccountPassword("")) + .withClusterBootstrapAccountPassword("fakeTokenPlaceholder") + .withClusterOperatorAccountPassword("fakeTokenPlaceholder") + .withSqlServiceAccountPassword("fakeTokenPlaceholder")) .withWsfcStaticIp("10.0.0.7") .create(); } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json */ /** * Sample code: Creates or updates a SQL virtual machine for Automated Back up Settings with Weekly and Days of the @@ -123,8 +124,8 @@ public static void createsOrUpdatesASQLVirtualMachineAndJoinsItToASQLVirtualMach .withRetentionPeriod(17) .withStorageAccountUrl("https://teststorage.blob.core.windows.net/") .withStorageContainerName("testcontainer") - .withStorageAccessKey("") - .withPassword("") + .withStorageAccessKey("fakeTokenPlaceholder") + .withPassword("fakeTokenPlaceholder") .withBackupSystemDbs(true) .withBackupScheduleType(BackupScheduleType.MANUAL) .withFullBackupFrequency(FullBackupFrequencyType.WEEKLY) @@ -140,7 +141,7 @@ public static void createsOrUpdatesASQLVirtualMachineAndJoinsItToASQLVirtualMach .withConnectivityType(ConnectivityType.PRIVATE) .withPort(1433) .withSqlAuthUpdateUsername("sqllogin") - .withSqlAuthUpdatePassword("")) + .withSqlAuthUpdatePassword("fakeTokenPlaceholder")) .withSqlWorkloadTypeUpdateSettings( new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.OLTP)) .withSqlStorageUpdateSettings( @@ -154,7 +155,7 @@ public static void createsOrUpdatesASQLVirtualMachineAndJoinsItToASQLVirtualMach } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json */ /** * Sample code: Creates or updates a SQL virtual machine for Storage Configuration Settings to NEW Data, Log and @@ -193,7 +194,7 @@ public static void createsOrUpdatesASQLVirtualMachineAndJoinsItToASQLVirtualMach } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineMAX.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMAX.json */ /** * Sample code: Creates or updates a SQL virtual machine with max parameters. @@ -226,8 +227,8 @@ public static void createsOrUpdatesASQLVirtualMachineWithMaxParameters( .withRetentionPeriod(17) .withStorageAccountUrl("https://teststorage.blob.core.windows.net/") .withStorageContainerName("testcontainer") - .withStorageAccessKey("") - .withPassword("") + .withStorageAccessKey("fakeTokenPlaceholder") + .withPassword("fakeTokenPlaceholder") .withBackupSystemDbs(true) .withBackupScheduleType(BackupScheduleType.MANUAL) .withFullBackupFrequency(FullBackupFrequencyType.DAILY) @@ -242,7 +243,7 @@ public static void createsOrUpdatesASQLVirtualMachineWithMaxParameters( .withConnectivityType(ConnectivityType.PRIVATE) .withPort(1433) .withSqlAuthUpdateUsername("sqllogin") - .withSqlAuthUpdatePassword("")) + .withSqlAuthUpdatePassword("fakeTokenPlaceholder")) .withSqlWorkloadTypeUpdateSettings( new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.OLTP)) .withSqlStorageUpdateSettings( @@ -260,7 +261,9 @@ public static void createsOrUpdatesASQLVirtualMachineWithMaxParameters( .withMinServerMemoryMB(0) .withMaxServerMemoryMB(128) .withIsLpimEnabled(true) - .withIsIfiEnabled(true))) + .withIsIfiEnabled(true)) + .withAzureAdAuthenticationSettings( + new AadAuthenticationSettings().withClientId("11111111-2222-3333-4444-555555555555"))) .withAssessmentSettings( new AssessmentSettings() .withEnable(true) @@ -276,7 +279,7 @@ public static void createsOrUpdatesASQLVirtualMachineWithMaxParameters( } /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/CreateOrUpdateSqlVirtualMachineMIN.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMIN.json */ /** * Sample code: Creates or updates a SQL virtual machine with min parameters. diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteSamples.java index ddbea2fd9e0ec..795496d4f2746 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines Delete. */ public final class SqlVirtualMachinesDeleteSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/DeleteSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachine.json */ /** * Sample code: Deletes a SQL virtual machine. @@ -18,6 +16,6 @@ public final class SqlVirtualMachinesDeleteSamples { */ public static void deletesASQLVirtualMachine( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().delete("testrg", "testvm1", Context.NONE); + manager.sqlVirtualMachines().delete("testrg", "testvm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesGetByResourceGroupSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesGetByResourceGroupSamples.java index b22e4a3dbb39f..f82b94f89d2ae 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesGetByResourceGroupSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines GetByResourceGroup. */ public final class SqlVirtualMachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/GetSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachine.json */ /** * Sample code: Gets a SQL virtual machine. @@ -18,6 +16,8 @@ public final class SqlVirtualMachinesGetByResourceGroupSamples { */ public static void getsASQLVirtualMachine( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().getByResourceGroupWithResponse("testrg", "testvm", null, Context.NONE); + manager + .sqlVirtualMachines() + .getByResourceGroupWithResponse("testrg", "testvm", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupSamples.java index 4e9c453f2c087..56b8ca9059801 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines ListByResourceGroup. */ public final class SqlVirtualMachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json */ /** * Sample code: Gets all SQL virtual machines in a resource group. @@ -18,6 +16,6 @@ public final class SqlVirtualMachinesListByResourceGroupSamples { */ public static void getsAllSQLVirtualMachinesInAResourceGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().listByResourceGroup("testrg", Context.NONE); + manager.sqlVirtualMachines().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupSamples.java index a97dcae8782ed..5983914f513ec 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines ListBySqlVmGroup. */ public final class SqlVirtualMachinesListBySqlVmGroupSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListBySqlVirtualMachineGroupSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListBySqlVirtualMachineGroupSqlVirtualMachine.json */ /** * Sample code: Gets the list of sql virtual machines in a SQL virtual machine group. @@ -18,6 +16,6 @@ public final class SqlVirtualMachinesListBySqlVmGroupSamples { */ public static void getsTheListOfSqlVirtualMachinesInASQLVirtualMachineGroup( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().listBySqlVmGroup("testrg", "testvm", Context.NONE); + manager.sqlVirtualMachines().listBySqlVmGroup("testrg", "testvm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListSamples.java index cc7fdbbf2a32e..9ce5847841973 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines List. */ public final class SqlVirtualMachinesListSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/ListSubscriptionSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachine.json */ /** * Sample code: Gets all SQL virtual machines in a subscription. @@ -18,6 +16,6 @@ public final class SqlVirtualMachinesListSamples { */ public static void getsAllSQLVirtualMachinesInASubscription( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().list(Context.NONE); + manager.sqlVirtualMachines().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeploySamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeploySamples.java index a97658213f5a1..c637dda5aa610 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeploySamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeploySamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines Redeploy. */ public final class SqlVirtualMachinesRedeploySamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/RedeploySqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/RedeploySqlVirtualMachine.json */ /** - * Sample code: Uninstalls and reinstalls the SQL Iaas Extension. + * Sample code: Uninstalls and reinstalls the SQL IaaS Extension. * * @param manager Entry point to SqlVirtualMachineManager. */ - public static void uninstallsAndReinstallsTheSQLIaasExtension( + public static void uninstallsAndReinstallsTheSQLIaaSExtension( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().redeploy("testrg", "testvm", Context.NONE); + manager.sqlVirtualMachines().redeploy("testrg", "testvm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentSamples.java index 8ff92e0b331fe..799a4e31544bb 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; - /** Samples for SqlVirtualMachines StartAssessment. */ public final class SqlVirtualMachinesStartAssessmentSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json */ /** - * Sample code: Starts Assessment on SQL virtual machine. + * Sample code: Starts SQL best practices Assessment on SQL virtual machine. * * @param manager Entry point to SqlVirtualMachineManager. */ - public static void startsAssessmentOnSQLVirtualMachine( + public static void startsSQLBestPracticesAssessmentOnSQLVirtualMachine( com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager manager) { - manager.sqlVirtualMachines().startAssessment("testrg", "testvm", Context.NONE); + manager.sqlVirtualMachines().startAssessment("testrg", "testvm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesUpdateSamples.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesUpdateSamples.java index f3662caeb0d7a..c464e7453d11a 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesUpdateSamples.java +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/samples/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.sqlvirtualmachine.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for SqlVirtualMachines Update. */ public final class SqlVirtualMachinesUpdateSamples { /* - * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-07-01-preview/examples/UpdateSqlVirtualMachine.json + * x-ms-original-file: specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachine.json */ /** * Sample code: Updates a SQL virtual machine tags. @@ -24,7 +23,7 @@ public static void updatesASQLVirtualMachineTags( SqlVirtualMachine resource = manager .sqlVirtualMachines() - .getByResourceGroupWithResponse("testrg", "testvm", null, Context.NONE) + .getByResourceGroupWithResponse("testrg", "testvm", null, com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("mytag", "myval")).apply(); } diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AdditionalFeaturesServerConfigurationsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AdditionalFeaturesServerConfigurationsTests.java deleted file mode 100644 index 061a86173a3e7..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AdditionalFeaturesServerConfigurationsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AdditionalFeaturesServerConfigurationsTests { - @Test - public void testDeserialize() { - AdditionalFeaturesServerConfigurations model = - BinaryData - .fromString("{\"isRServicesEnabled\":false}") - .toObject(AdditionalFeaturesServerConfigurations.class); - Assertions.assertEquals(false, model.isRServicesEnabled()); - } - - @Test - public void testSerialize() { - AdditionalFeaturesServerConfigurations model = - new AdditionalFeaturesServerConfigurations().withIsRServicesEnabled(false); - model = BinaryData.fromObject(model).toObject(AdditionalFeaturesServerConfigurations.class); - Assertions.assertEquals(false, model.isRServicesEnabled()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgConfigurationTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgConfigurationTests.java deleted file mode 100644 index 744406f87f742..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgConfigurationTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgReplica; -import com.azure.resourcemanager.sqlvirtualmachine.models.Commit; -import com.azure.resourcemanager.sqlvirtualmachine.models.Failover; -import com.azure.resourcemanager.sqlvirtualmachine.models.ReadableSecondary; -import com.azure.resourcemanager.sqlvirtualmachine.models.Role; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AgConfigurationTests { - @Test - public void testDeserialize() { - AgConfiguration model = - BinaryData - .fromString( - "{\"replicas\":[{\"sqlVirtualMachineInstanceId\":\"bcryffdfd\",\"role\":\"SECONDARY\",\"commit\":\"SYNCHRONOUS_COMMIT\",\"failover\":\"MANUAL\",\"readableSecondary\":\"ALL\"}]}") - .toObject(AgConfiguration.class); - Assertions.assertEquals("bcryffdfd", model.replicas().get(0).sqlVirtualMachineInstanceId()); - Assertions.assertEquals(Role.SECONDARY, model.replicas().get(0).role()); - Assertions.assertEquals(Commit.SYNCHRONOUS_COMMIT, model.replicas().get(0).commit()); - Assertions.assertEquals(Failover.MANUAL, model.replicas().get(0).failover()); - Assertions.assertEquals(ReadableSecondary.ALL, model.replicas().get(0).readableSecondary()); - } - - @Test - public void testSerialize() { - AgConfiguration model = - new AgConfiguration() - .withReplicas( - Arrays - .asList( - new AgReplica() - .withSqlVirtualMachineInstanceId("bcryffdfd") - .withRole(Role.SECONDARY) - .withCommit(Commit.SYNCHRONOUS_COMMIT) - .withFailover(Failover.MANUAL) - .withReadableSecondary(ReadableSecondary.ALL))); - model = BinaryData.fromObject(model).toObject(AgConfiguration.class); - Assertions.assertEquals("bcryffdfd", model.replicas().get(0).sqlVirtualMachineInstanceId()); - Assertions.assertEquals(Role.SECONDARY, model.replicas().get(0).role()); - Assertions.assertEquals(Commit.SYNCHRONOUS_COMMIT, model.replicas().get(0).commit()); - Assertions.assertEquals(Failover.MANUAL, model.replicas().get(0).failover()); - Assertions.assertEquals(ReadableSecondary.ALL, model.replicas().get(0).readableSecondary()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgReplicaTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgReplicaTests.java deleted file mode 100644 index a22fddfd78c11..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AgReplicaTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgReplica; -import com.azure.resourcemanager.sqlvirtualmachine.models.Commit; -import com.azure.resourcemanager.sqlvirtualmachine.models.Failover; -import com.azure.resourcemanager.sqlvirtualmachine.models.ReadableSecondary; -import com.azure.resourcemanager.sqlvirtualmachine.models.Role; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AgReplicaTests { - @Test - public void testDeserialize() { - AgReplica model = - BinaryData - .fromString( - "{\"sqlVirtualMachineInstanceId\":\"akhmsbzjhcrz\",\"role\":\"SECONDARY\",\"commit\":\"ASYNCHRONOUS_COMMIT\",\"failover\":\"AUTOMATIC\",\"readableSecondary\":\"ALL\"}") - .toObject(AgReplica.class); - Assertions.assertEquals("akhmsbzjhcrz", model.sqlVirtualMachineInstanceId()); - Assertions.assertEquals(Role.SECONDARY, model.role()); - Assertions.assertEquals(Commit.ASYNCHRONOUS_COMMIT, model.commit()); - Assertions.assertEquals(Failover.AUTOMATIC, model.failover()); - Assertions.assertEquals(ReadableSecondary.ALL, model.readableSecondary()); - } - - @Test - public void testSerialize() { - AgReplica model = - new AgReplica() - .withSqlVirtualMachineInstanceId("akhmsbzjhcrz") - .withRole(Role.SECONDARY) - .withCommit(Commit.ASYNCHRONOUS_COMMIT) - .withFailover(Failover.AUTOMATIC) - .withReadableSecondary(ReadableSecondary.ALL); - model = BinaryData.fromObject(model).toObject(AgReplica.class); - Assertions.assertEquals("akhmsbzjhcrz", model.sqlVirtualMachineInstanceId()); - Assertions.assertEquals(Role.SECONDARY, model.role()); - Assertions.assertEquals(Commit.ASYNCHRONOUS_COMMIT, model.commit()); - Assertions.assertEquals(Failover.AUTOMATIC, model.failover()); - Assertions.assertEquals(ReadableSecondary.ALL, model.readableSecondary()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AssessmentSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AssessmentSettingsTests.java deleted file mode 100644 index a99b0234060f8..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AssessmentSettingsTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentDayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.Schedule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AssessmentSettingsTests { - @Test - public void testDeserialize() { - AssessmentSettings model = - BinaryData - .fromString( - "{\"enable\":false,\"runImmediately\":true,\"schedule\":{\"enable\":true,\"weeklyInterval\":850338934,\"monthlyOccurrence\":508085674,\"dayOfWeek\":\"Wednesday\",\"startTime\":\"bfs\"}}") - .toObject(AssessmentSettings.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals(true, model.runImmediately()); - Assertions.assertEquals(true, model.schedule().enable()); - Assertions.assertEquals(850338934, model.schedule().weeklyInterval()); - Assertions.assertEquals(508085674, model.schedule().monthlyOccurrence()); - Assertions.assertEquals(AssessmentDayOfWeek.WEDNESDAY, model.schedule().dayOfWeek()); - Assertions.assertEquals("bfs", model.schedule().startTime()); - } - - @Test - public void testSerialize() { - AssessmentSettings model = - new AssessmentSettings() - .withEnable(false) - .withRunImmediately(true) - .withSchedule( - new Schedule() - .withEnable(true) - .withWeeklyInterval(850338934) - .withMonthlyOccurrence(508085674) - .withDayOfWeek(AssessmentDayOfWeek.WEDNESDAY) - .withStartTime("bfs")); - model = BinaryData.fromObject(model).toObject(AssessmentSettings.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals(true, model.runImmediately()); - Assertions.assertEquals(true, model.schedule().enable()); - Assertions.assertEquals(850338934, model.schedule().weeklyInterval()); - Assertions.assertEquals(508085674, model.schedule().monthlyOccurrence()); - Assertions.assertEquals(AssessmentDayOfWeek.WEDNESDAY, model.schedule().dayOfWeek()); - Assertions.assertEquals("bfs", model.schedule().startTime()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoBackupSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoBackupSettingsTests.java deleted file mode 100644 index e1c368795e297..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoBackupSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupDaysOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AutoBackupSettingsTests { - @Test - public void testDeserialize() { - AutoBackupSettings model = - BinaryData - .fromString( - "{\"enable\":false,\"enableEncryption\":true,\"retentionPeriod\":1821646506,\"storageAccountUrl\":\"xw\",\"storageContainerName\":\"pwhonowkg\",\"storageAccessKey\":\"fakeStorageAccessKeyPlaceholder\",\"password\":\"fakePasswordPlaceholder\",\"backupSystemDbs\":true,\"backupScheduleType\":\"Automated\",\"fullBackupFrequency\":\"Daily\",\"daysOfWeek\":[\"Saturday\",\"Monday\",\"Sunday\",\"Tuesday\"],\"fullBackupStartTime\":798441434,\"fullBackupWindowHours\":1495315655,\"logBackupFrequency\":1368622267}") - .toObject(AutoBackupSettings.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals(true, model.enableEncryption()); - Assertions.assertEquals(1821646506, model.retentionPeriod()); - Assertions.assertEquals("xw", model.storageAccountUrl()); - Assertions.assertEquals("pwhonowkg", model.storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", model.storageAccessKey()); - Assertions.assertEquals("fakePasswordPlaceholder", model.password()); - Assertions.assertEquals(true, model.backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.AUTOMATED, model.backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.DAILY, model.fullBackupFrequency()); - Assertions.assertEquals(AutoBackupDaysOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(798441434, model.fullBackupStartTime()); - Assertions.assertEquals(1495315655, model.fullBackupWindowHours()); - Assertions.assertEquals(1368622267, model.logBackupFrequency()); - } - - @Test - public void testSerialize() { - AutoBackupSettings model = - new AutoBackupSettings() - .withEnable(false) - .withEnableEncryption(true) - .withRetentionPeriod(1821646506) - .withStorageAccountUrl("xw") - .withStorageContainerName("pwhonowkg") - .withStorageAccessKey("fakeStorageAccessKeyPlaceholder") - .withPassword("fakePasswordPlaceholder") - .withBackupSystemDbs(true) - .withBackupScheduleType(BackupScheduleType.AUTOMATED) - .withFullBackupFrequency(FullBackupFrequencyType.DAILY) - .withDaysOfWeek( - Arrays - .asList( - AutoBackupDaysOfWeek.SATURDAY, - AutoBackupDaysOfWeek.MONDAY, - AutoBackupDaysOfWeek.SUNDAY, - AutoBackupDaysOfWeek.TUESDAY)) - .withFullBackupStartTime(798441434) - .withFullBackupWindowHours(1495315655) - .withLogBackupFrequency(1368622267); - model = BinaryData.fromObject(model).toObject(AutoBackupSettings.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals(true, model.enableEncryption()); - Assertions.assertEquals(1821646506, model.retentionPeriod()); - Assertions.assertEquals("xw", model.storageAccountUrl()); - Assertions.assertEquals("pwhonowkg", model.storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", model.storageAccessKey()); - Assertions.assertEquals("fakePasswordPlaceholder", model.password()); - Assertions.assertEquals(true, model.backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.AUTOMATED, model.backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.DAILY, model.fullBackupFrequency()); - Assertions.assertEquals(AutoBackupDaysOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(798441434, model.fullBackupStartTime()); - Assertions.assertEquals(1495315655, model.fullBackupWindowHours()); - Assertions.assertEquals(1368622267, model.logBackupFrequency()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoPatchingSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoPatchingSettingsTests.java deleted file mode 100644 index eaa3f7ed42fa1..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AutoPatchingSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AutoPatchingSettingsTests { - @Test - public void testDeserialize() { - AutoPatchingSettings model = - BinaryData - .fromString( - "{\"enable\":true,\"dayOfWeek\":\"Everyday\",\"maintenanceWindowStartingHour\":1859867828,\"maintenanceWindowDuration\":1616519742}") - .toObject(AutoPatchingSettings.class); - Assertions.assertEquals(true, model.enable()); - Assertions.assertEquals(DayOfWeek.EVERYDAY, model.dayOfWeek()); - Assertions.assertEquals(1859867828, model.maintenanceWindowStartingHour()); - Assertions.assertEquals(1616519742, model.maintenanceWindowDuration()); - } - - @Test - public void testSerialize() { - AutoPatchingSettings model = - new AutoPatchingSettings() - .withEnable(true) - .withDayOfWeek(DayOfWeek.EVERYDAY) - .withMaintenanceWindowStartingHour(1859867828) - .withMaintenanceWindowDuration(1616519742); - model = BinaryData.fromObject(model).toObject(AutoPatchingSettings.class); - Assertions.assertEquals(true, model.enable()); - Assertions.assertEquals(DayOfWeek.EVERYDAY, model.dayOfWeek()); - Assertions.assertEquals(1859867828, model.maintenanceWindowStartingHour()); - Assertions.assertEquals(1616519742, model.maintenanceWindowDuration()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerInnerTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerInnerTests.java deleted file mode 100644 index 429b6f2532789..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.AvailabilityGroupListenerInner; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.LoadBalancerConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.MultiSubnetIpConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AvailabilityGroupListenerInnerTests { - @Test - public void testDeserialize() { - AvailabilityGroupListenerInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"hq\",\"availabilityGroupName\":\"gjxpybczmehmt\",\"loadBalancerConfigurations\":[{\"publicIpAddressResourceId\":\"phrupidgsybbejhp\",\"loadBalancerResourceId\":\"ycm\",\"probePort\":501010271,\"sqlVirtualMachineInstances\":[]},{\"publicIpAddressResourceId\":\"dxbmtqioq\",\"loadBalancerResourceId\":\"ehtbm\",\"probePort\":261903418,\"sqlVirtualMachineInstances\":[]},{\"publicIpAddressResourceId\":\"oizh\",\"loadBalancerResourceId\":\"rxybqsoq\",\"probePort\":1262663343,\"sqlVirtualMachineInstances\":[]}],\"multiSubnetIpConfigurations\":[{\"sqlVirtualMachineInstance\":\"bpazlobcufpdzn\"},{\"sqlVirtualMachineInstance\":\"btcqq\"},{\"sqlVirtualMachineInstance\":\"nq\"},{\"sqlVirtualMachineInstance\":\"lhqgnufooojy\"}],\"createDefaultAvailabilityGroupIfNotExist\":true,\"port\":609105572,\"availabilityGroupConfiguration\":{\"replicas\":[]}},\"id\":\"gdf\",\"name\":\"glzlhjxrifkwmrv\",\"type\":\"tsizntocipaoua\"}") - .toObject(AvailabilityGroupListenerInner.class); - Assertions.assertEquals("gjxpybczmehmt", model.availabilityGroupName()); - Assertions - .assertEquals("phrupidgsybbejhp", model.loadBalancerConfigurations().get(0).publicIpAddressResourceId()); - Assertions.assertEquals("ycm", model.loadBalancerConfigurations().get(0).loadBalancerResourceId()); - Assertions.assertEquals(501010271, model.loadBalancerConfigurations().get(0).probePort()); - Assertions - .assertEquals("bpazlobcufpdzn", model.multiSubnetIpConfigurations().get(0).sqlVirtualMachineInstance()); - Assertions.assertEquals(true, model.createDefaultAvailabilityGroupIfNotExist()); - Assertions.assertEquals(609105572, model.port()); - } - - @Test - public void testSerialize() { - AvailabilityGroupListenerInner model = - new AvailabilityGroupListenerInner() - .withAvailabilityGroupName("gjxpybczmehmt") - .withLoadBalancerConfigurations( - Arrays - .asList( - new LoadBalancerConfiguration() - .withPublicIpAddressResourceId("phrupidgsybbejhp") - .withLoadBalancerResourceId("ycm") - .withProbePort(501010271) - .withSqlVirtualMachineInstances(Arrays.asList()), - new LoadBalancerConfiguration() - .withPublicIpAddressResourceId("dxbmtqioq") - .withLoadBalancerResourceId("ehtbm") - .withProbePort(261903418) - .withSqlVirtualMachineInstances(Arrays.asList()), - new LoadBalancerConfiguration() - .withPublicIpAddressResourceId("oizh") - .withLoadBalancerResourceId("rxybqsoq") - .withProbePort(1262663343) - .withSqlVirtualMachineInstances(Arrays.asList()))) - .withMultiSubnetIpConfigurations( - Arrays - .asList( - new MultiSubnetIpConfiguration().withSqlVirtualMachineInstance("bpazlobcufpdzn"), - new MultiSubnetIpConfiguration().withSqlVirtualMachineInstance("btcqq"), - new MultiSubnetIpConfiguration().withSqlVirtualMachineInstance("nq"), - new MultiSubnetIpConfiguration().withSqlVirtualMachineInstance("lhqgnufooojy"))) - .withCreateDefaultAvailabilityGroupIfNotExist(true) - .withPort(609105572) - .withAvailabilityGroupConfiguration(new AgConfiguration().withReplicas(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(AvailabilityGroupListenerInner.class); - Assertions.assertEquals("gjxpybczmehmt", model.availabilityGroupName()); - Assertions - .assertEquals("phrupidgsybbejhp", model.loadBalancerConfigurations().get(0).publicIpAddressResourceId()); - Assertions.assertEquals("ycm", model.loadBalancerConfigurations().get(0).loadBalancerResourceId()); - Assertions.assertEquals(501010271, model.loadBalancerConfigurations().get(0).probePort()); - Assertions - .assertEquals("bpazlobcufpdzn", model.multiSubnetIpConfigurations().get(0).sqlVirtualMachineInstance()); - Assertions.assertEquals(true, model.createDefaultAvailabilityGroupIfNotExist()); - Assertions.assertEquals(609105572, model.port()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerListResultTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerListResultTests.java deleted file mode 100644 index cec10cba20f92..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AvailabilityGroupListenerListResult; -import org.junit.jupiter.api.Test; - -public final class AvailabilityGroupListenerListResultTests { - @Test - public void testDeserialize() { - AvailabilityGroupListenerListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"trg\",\"availabilityGroupName\":\"bpf\",\"loadBalancerConfigurations\":[],\"multiSubnetIpConfigurations\":[],\"createDefaultAvailabilityGroupIfNotExist\":false,\"port\":1078970203},\"id\":\"cjrwzoxxjtfellu\",\"name\":\"fziton\",\"type\":\"eqfpj\"}],\"nextLink\":\"lxofpdvhpfxxypin\"}") - .toObject(AvailabilityGroupListenerListResult.class); - } - - @Test - public void testSerialize() { - AvailabilityGroupListenerListResult model = new AvailabilityGroupListenerListResult(); - model = BinaryData.fromObject(model).toObject(AvailabilityGroupListenerListResult.class); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerPropertiesTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerPropertiesTests.java deleted file mode 100644 index 4e748dc75ebab..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenerPropertiesTests.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.AvailabilityGroupListenerProperties; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgReplica; -import com.azure.resourcemanager.sqlvirtualmachine.models.Commit; -import com.azure.resourcemanager.sqlvirtualmachine.models.Failover; -import com.azure.resourcemanager.sqlvirtualmachine.models.LoadBalancerConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.MultiSubnetIpConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.PrivateIpAddress; -import com.azure.resourcemanager.sqlvirtualmachine.models.ReadableSecondary; -import com.azure.resourcemanager.sqlvirtualmachine.models.Role; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AvailabilityGroupListenerPropertiesTests { - @Test - public void testDeserialize() { - AvailabilityGroupListenerProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"s\",\"availabilityGroupName\":\"cmpoyfdkfogkny\",\"loadBalancerConfigurations\":[{\"privateIpAddress\":{\"ipAddress\":\"ddeqsrdeupewnwre\",\"subnetResourceId\":\"jzyflu\"},\"publicIpAddressResourceId\":\"rh\",\"loadBalancerResourceId\":\"fcqhsmyurkd\",\"probePort\":337855308,\"sqlVirtualMachineInstances\":[\"ekuksjtx\"]},{\"privateIpAddress\":{\"ipAddress\":\"dmpa\",\"subnetResourceId\":\"ryuanzwuxzdxtay\"},\"publicIpAddressResourceId\":\"hmwhfpmrqo\",\"loadBalancerResourceId\":\"tu\",\"probePort\":1941399376,\"sqlVirtualMachineInstances\":[\"rtihfxtijbpz\",\"gnwzsymglzufc\"]}],\"multiSubnetIpConfigurations\":[{\"privateIpAddress\":{\"ipAddress\":\"hdbihan\",\"subnetResourceId\":\"hfcbjysa\"},\"sqlVirtualMachineInstance\":\"ithxqhabifpi\"},{\"privateIpAddress\":{\"ipAddress\":\"wczbys\",\"subnetResourceId\":\"pqxu\"},\"sqlVirtualMachineInstance\":\"ivyqniwbybrkxvd\"}],\"createDefaultAvailabilityGroupIfNotExist\":true,\"port\":850212440,\"availabilityGroupConfiguration\":{\"replicas\":[{\"sqlVirtualMachineInstanceId\":\"ukxgaud\",\"role\":\"SECONDARY\",\"commit\":\"SYNCHRONOUS_COMMIT\",\"failover\":\"AUTOMATIC\",\"readableSecondary\":\"NO\"},{\"sqlVirtualMachineInstanceId\":\"ejhkry\",\"role\":\"SECONDARY\",\"commit\":\"SYNCHRONOUS_COMMIT\",\"failover\":\"AUTOMATIC\",\"readableSecondary\":\"NO\"}]}}") - .toObject(AvailabilityGroupListenerProperties.class); - Assertions.assertEquals("cmpoyfdkfogkny", model.availabilityGroupName()); - Assertions - .assertEquals("ddeqsrdeupewnwre", model.loadBalancerConfigurations().get(0).privateIpAddress().ipAddress()); - Assertions - .assertEquals("jzyflu", model.loadBalancerConfigurations().get(0).privateIpAddress().subnetResourceId()); - Assertions.assertEquals("rh", model.loadBalancerConfigurations().get(0).publicIpAddressResourceId()); - Assertions.assertEquals("fcqhsmyurkd", model.loadBalancerConfigurations().get(0).loadBalancerResourceId()); - Assertions.assertEquals(337855308, model.loadBalancerConfigurations().get(0).probePort()); - Assertions - .assertEquals("ekuksjtx", model.loadBalancerConfigurations().get(0).sqlVirtualMachineInstances().get(0)); - Assertions.assertEquals("hdbihan", model.multiSubnetIpConfigurations().get(0).privateIpAddress().ipAddress()); - Assertions - .assertEquals("hfcbjysa", model.multiSubnetIpConfigurations().get(0).privateIpAddress().subnetResourceId()); - Assertions.assertEquals("ithxqhabifpi", model.multiSubnetIpConfigurations().get(0).sqlVirtualMachineInstance()); - Assertions.assertEquals(true, model.createDefaultAvailabilityGroupIfNotExist()); - Assertions.assertEquals(850212440, model.port()); - Assertions - .assertEquals( - "ukxgaud", model.availabilityGroupConfiguration().replicas().get(0).sqlVirtualMachineInstanceId()); - Assertions.assertEquals(Role.SECONDARY, model.availabilityGroupConfiguration().replicas().get(0).role()); - Assertions - .assertEquals(Commit.SYNCHRONOUS_COMMIT, model.availabilityGroupConfiguration().replicas().get(0).commit()); - Assertions - .assertEquals(Failover.AUTOMATIC, model.availabilityGroupConfiguration().replicas().get(0).failover()); - Assertions - .assertEquals( - ReadableSecondary.NO, model.availabilityGroupConfiguration().replicas().get(0).readableSecondary()); - } - - @Test - public void testSerialize() { - AvailabilityGroupListenerProperties model = - new AvailabilityGroupListenerProperties() - .withAvailabilityGroupName("cmpoyfdkfogkny") - .withLoadBalancerConfigurations( - Arrays - .asList( - new LoadBalancerConfiguration() - .withPrivateIpAddress( - new PrivateIpAddress() - .withIpAddress("ddeqsrdeupewnwre") - .withSubnetResourceId("jzyflu")) - .withPublicIpAddressResourceId("rh") - .withLoadBalancerResourceId("fcqhsmyurkd") - .withProbePort(337855308) - .withSqlVirtualMachineInstances(Arrays.asList("ekuksjtx")), - new LoadBalancerConfiguration() - .withPrivateIpAddress( - new PrivateIpAddress() - .withIpAddress("dmpa") - .withSubnetResourceId("ryuanzwuxzdxtay")) - .withPublicIpAddressResourceId("hmwhfpmrqo") - .withLoadBalancerResourceId("tu") - .withProbePort(1941399376) - .withSqlVirtualMachineInstances(Arrays.asList("rtihfxtijbpz", "gnwzsymglzufc")))) - .withMultiSubnetIpConfigurations( - Arrays - .asList( - new MultiSubnetIpConfiguration() - .withPrivateIpAddress( - new PrivateIpAddress().withIpAddress("hdbihan").withSubnetResourceId("hfcbjysa")) - .withSqlVirtualMachineInstance("ithxqhabifpi"), - new MultiSubnetIpConfiguration() - .withPrivateIpAddress( - new PrivateIpAddress().withIpAddress("wczbys").withSubnetResourceId("pqxu")) - .withSqlVirtualMachineInstance("ivyqniwbybrkxvd"))) - .withCreateDefaultAvailabilityGroupIfNotExist(true) - .withPort(850212440) - .withAvailabilityGroupConfiguration( - new AgConfiguration() - .withReplicas( - Arrays - .asList( - new AgReplica() - .withSqlVirtualMachineInstanceId("ukxgaud") - .withRole(Role.SECONDARY) - .withCommit(Commit.SYNCHRONOUS_COMMIT) - .withFailover(Failover.AUTOMATIC) - .withReadableSecondary(ReadableSecondary.NO), - new AgReplica() - .withSqlVirtualMachineInstanceId("ejhkry") - .withRole(Role.SECONDARY) - .withCommit(Commit.SYNCHRONOUS_COMMIT) - .withFailover(Failover.AUTOMATIC) - .withReadableSecondary(ReadableSecondary.NO)))); - model = BinaryData.fromObject(model).toObject(AvailabilityGroupListenerProperties.class); - Assertions.assertEquals("cmpoyfdkfogkny", model.availabilityGroupName()); - Assertions - .assertEquals("ddeqsrdeupewnwre", model.loadBalancerConfigurations().get(0).privateIpAddress().ipAddress()); - Assertions - .assertEquals("jzyflu", model.loadBalancerConfigurations().get(0).privateIpAddress().subnetResourceId()); - Assertions.assertEquals("rh", model.loadBalancerConfigurations().get(0).publicIpAddressResourceId()); - Assertions.assertEquals("fcqhsmyurkd", model.loadBalancerConfigurations().get(0).loadBalancerResourceId()); - Assertions.assertEquals(337855308, model.loadBalancerConfigurations().get(0).probePort()); - Assertions - .assertEquals("ekuksjtx", model.loadBalancerConfigurations().get(0).sqlVirtualMachineInstances().get(0)); - Assertions.assertEquals("hdbihan", model.multiSubnetIpConfigurations().get(0).privateIpAddress().ipAddress()); - Assertions - .assertEquals("hfcbjysa", model.multiSubnetIpConfigurations().get(0).privateIpAddress().subnetResourceId()); - Assertions.assertEquals("ithxqhabifpi", model.multiSubnetIpConfigurations().get(0).sqlVirtualMachineInstance()); - Assertions.assertEquals(true, model.createDefaultAvailabilityGroupIfNotExist()); - Assertions.assertEquals(850212440, model.port()); - Assertions - .assertEquals( - "ukxgaud", model.availabilityGroupConfiguration().replicas().get(0).sqlVirtualMachineInstanceId()); - Assertions.assertEquals(Role.SECONDARY, model.availabilityGroupConfiguration().replicas().get(0).role()); - Assertions - .assertEquals(Commit.SYNCHRONOUS_COMMIT, model.availabilityGroupConfiguration().replicas().get(0).commit()); - Assertions - .assertEquals(Failover.AUTOMATIC, model.availabilityGroupConfiguration().replicas().get(0).failover()); - Assertions - .assertEquals( - ReadableSecondary.NO, model.availabilityGroupConfiguration().replicas().get(0).readableSecondary()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateTests.java deleted file mode 100644 index 25810c19e8ee5..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersCreateOrUpdateTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.AgConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.AvailabilityGroupListener; -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 AvailabilityGroupListenersCreateOrUpdateTests { - @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\":{\"provisioningState\":\"Succeeded\",\"availabilityGroupName\":\"deoj\",\"loadBalancerConfigurations\":[],\"multiSubnetIpConfigurations\":[],\"createDefaultAvailabilityGroupIfNotExist\":true,\"port\":611656940,\"availabilityGroupConfiguration\":{\"replicas\":[]}},\"id\":\"ie\",\"name\":\"tfhvpesapskrdqmh\",\"type\":\"jdhtldwkyzxu\"}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailabilityGroupListener response = - manager - .availabilityGroupListeners() - .define("lcuhxwtctyqiklb") - .withExistingSqlVirtualMachineGroup("xytxhpzxbz", "fzab") - .withAvailabilityGroupName("vmkfssxqu") - .withLoadBalancerConfigurations(Arrays.asList()) - .withMultiSubnetIpConfigurations(Arrays.asList()) - .withCreateDefaultAvailabilityGroupIfNotExist(false) - .withPort(1737094412) - .withAvailabilityGroupConfiguration(new AgConfiguration().withReplicas(Arrays.asList())) - .create(); - - Assertions.assertEquals("deoj", response.availabilityGroupName()); - Assertions.assertEquals(true, response.createDefaultAvailabilityGroupIfNotExist()); - Assertions.assertEquals(611656940, response.port()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteTests.java deleted file mode 100644 index c505b9fcafdf3..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersDeleteTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -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 AvailabilityGroupListenersDeleteTests { - @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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.availabilityGroupListeners().delete("fkts", "hsucoc", "nyyazttbtwwrqpue", Context.NONE); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupTests.java deleted file mode 100644 index 4611f6f99c568..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/AvailabilityGroupListenersListByGroupTests.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.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.AvailabilityGroupListener; -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 AvailabilityGroupListenersListByGroupTests { - @Test - public void testListByGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"oxaepd\",\"availabilityGroupName\":\"jancu\",\"loadBalancerConfigurations\":[],\"multiSubnetIpConfigurations\":[],\"createDefaultAvailabilityGroupIfNotExist\":true,\"port\":2022437290,\"availabilityGroupConfiguration\":{\"replicas\":[]}},\"id\":\"wd\",\"name\":\"swzts\",\"type\":\"bpg\"}]}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.availabilityGroupListeners().listByGroup("ckzywbiexzfeyue", "xibxujwbhqwalm", Context.NONE); - - Assertions.assertEquals("jancu", response.iterator().next().availabilityGroupName()); - Assertions.assertEquals(true, response.iterator().next().createDefaultAvailabilityGroupIfNotExist()); - Assertions.assertEquals(2022437290, response.iterator().next().port()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/KeyVaultCredentialSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/KeyVaultCredentialSettingsTests.java deleted file mode 100644 index 50290f2d0abde..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/KeyVaultCredentialSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.KeyVaultCredentialSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class KeyVaultCredentialSettingsTests { - @Test - public void testDeserialize() { - KeyVaultCredentialSettings model = - BinaryData - .fromString( - "{\"enable\":false,\"credentialName\":\"hoqqnwvlr\",\"azureKeyVaultUrl\":\"vwhheunmmqhgyx\",\"servicePrincipalName\":\"onocukok\",\"servicePrincipalSecret\":\"axuconuq\"}") - .toObject(KeyVaultCredentialSettings.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("hoqqnwvlr", model.credentialName()); - Assertions.assertEquals("vwhheunmmqhgyx", model.azureKeyVaultUrl()); - Assertions.assertEquals("onocukok", model.servicePrincipalName()); - Assertions.assertEquals("axuconuq", model.servicePrincipalSecret()); - } - - @Test - public void testSerialize() { - KeyVaultCredentialSettings model = - new KeyVaultCredentialSettings() - .withEnable(false) - .withCredentialName("hoqqnwvlr") - .withAzureKeyVaultUrl("vwhheunmmqhgyx") - .withServicePrincipalName("onocukok") - .withServicePrincipalSecret("axuconuq"); - model = BinaryData.fromObject(model).toObject(KeyVaultCredentialSettings.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("hoqqnwvlr", model.credentialName()); - Assertions.assertEquals("vwhheunmmqhgyx", model.azureKeyVaultUrl()); - Assertions.assertEquals("onocukok", model.servicePrincipalName()); - Assertions.assertEquals("axuconuq", model.servicePrincipalSecret()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/LoadBalancerConfigurationTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/LoadBalancerConfigurationTests.java deleted file mode 100644 index a03c98f3daeb9..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/LoadBalancerConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.LoadBalancerConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.PrivateIpAddress; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LoadBalancerConfigurationTests { - @Test - public void testDeserialize() { - LoadBalancerConfiguration model = - BinaryData - .fromString( - "{\"privateIpAddress\":{\"ipAddress\":\"jye\",\"subnetResourceId\":\"kvnipjoxz\"},\"publicIpAddressResourceId\":\"chgejspodm\",\"loadBalancerResourceId\":\"lzydehojwyahux\",\"probePort\":1511051439,\"sqlVirtualMachineInstances\":[\"njaqwixjspro\",\"vcputegj\"]}") - .toObject(LoadBalancerConfiguration.class); - Assertions.assertEquals("jye", model.privateIpAddress().ipAddress()); - Assertions.assertEquals("kvnipjoxz", model.privateIpAddress().subnetResourceId()); - Assertions.assertEquals("chgejspodm", model.publicIpAddressResourceId()); - Assertions.assertEquals("lzydehojwyahux", model.loadBalancerResourceId()); - Assertions.assertEquals(1511051439, model.probePort()); - Assertions.assertEquals("njaqwixjspro", model.sqlVirtualMachineInstances().get(0)); - } - - @Test - public void testSerialize() { - LoadBalancerConfiguration model = - new LoadBalancerConfiguration() - .withPrivateIpAddress(new PrivateIpAddress().withIpAddress("jye").withSubnetResourceId("kvnipjoxz")) - .withPublicIpAddressResourceId("chgejspodm") - .withLoadBalancerResourceId("lzydehojwyahux") - .withProbePort(1511051439) - .withSqlVirtualMachineInstances(Arrays.asList("njaqwixjspro", "vcputegj")); - model = BinaryData.fromObject(model).toObject(LoadBalancerConfiguration.class); - Assertions.assertEquals("jye", model.privateIpAddress().ipAddress()); - Assertions.assertEquals("kvnipjoxz", model.privateIpAddress().subnetResourceId()); - Assertions.assertEquals("chgejspodm", model.publicIpAddressResourceId()); - Assertions.assertEquals("lzydehojwyahux", model.loadBalancerResourceId()); - Assertions.assertEquals(1511051439, model.probePort()); - Assertions.assertEquals("njaqwixjspro", model.sqlVirtualMachineInstances().get(0)); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/MultiSubnetIpConfigurationTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/MultiSubnetIpConfigurationTests.java deleted file mode 100644 index 8c1e2499d89b1..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/MultiSubnetIpConfigurationTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.MultiSubnetIpConfiguration; -import com.azure.resourcemanager.sqlvirtualmachine.models.PrivateIpAddress; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MultiSubnetIpConfigurationTests { - @Test - public void testDeserialize() { - MultiSubnetIpConfiguration model = - BinaryData - .fromString( - "{\"privateIpAddress\":{\"ipAddress\":\"djpslw\",\"subnetResourceId\":\"dpvwryoqpsoaccta\"},\"sqlVirtualMachineInstance\":\"akl\"}") - .toObject(MultiSubnetIpConfiguration.class); - Assertions.assertEquals("djpslw", model.privateIpAddress().ipAddress()); - Assertions.assertEquals("dpvwryoqpsoaccta", model.privateIpAddress().subnetResourceId()); - Assertions.assertEquals("akl", model.sqlVirtualMachineInstance()); - } - - @Test - public void testSerialize() { - MultiSubnetIpConfiguration model = - new MultiSubnetIpConfiguration() - .withPrivateIpAddress( - new PrivateIpAddress().withIpAddress("djpslw").withSubnetResourceId("dpvwryoqpsoaccta")) - .withSqlVirtualMachineInstance("akl"); - model = BinaryData.fromObject(model).toObject(MultiSubnetIpConfiguration.class); - Assertions.assertEquals("djpslw", model.privateIpAddress().ipAddress()); - Assertions.assertEquals("dpvwryoqpsoaccta", model.privateIpAddress().subnetResourceId()); - Assertions.assertEquals("akl", model.sqlVirtualMachineInstance()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationDisplayTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationDisplayTests.java deleted file mode 100644 index b83b7415f0bda..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationDisplayTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationDisplayTests { - @Test - public void testDeserialize() { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"l\",\"resource\":\"dlikwyqkgfgibma\",\"operation\":\"akeqs\",\"description\":\"yb\"}") - .toObject(OperationDisplay.class); - } - - @Test - public void testSerialize() { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationInnerTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationInnerTests.java deleted file mode 100644 index 40708faf91dc0..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.OperationInner; -import org.junit.jupiter.api.Test; - -public final class OperationInnerTests { - @Test - public void testDeserialize() { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"hurokftyxoln\",\"display\":{\"provider\":\"wcukjfkgiawxk\",\"resource\":\"ypl\",\"operation\":\"kbasyypn\",\"description\":\"hsgcbacphejkot\"},\"origin\":\"user\",\"properties\":{}}") - .toObject(OperationInner.class); - } - - @Test - public void testSerialize() { - OperationInner model = new OperationInner(); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationListResultTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationListResultTests.java deleted file mode 100644 index 5b833814d931c..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.OperationListResult; -import org.junit.jupiter.api.Test; - -public final class OperationListResultTests { - @Test - public void testDeserialize() { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"yhuybbkpod\",\"display\":{\"provider\":\"oginuvamiheognar\",\"resource\":\"xth\",\"operation\":\"tusivyevcciqihn\",\"description\":\"ngbwjz\"},\"origin\":\"system\",\"properties\":{}},{\"name\":\"gispemvtzfkufubl\",\"display\":{\"provider\":\"xqeofjaeqjhqjba\",\"resource\":\"msmjqulngsntn\",\"operation\":\"bkzgcwrwclx\",\"description\":\"rljdouskcqv\"},\"origin\":\"user\",\"properties\":{}},{\"name\":\"dkwt\",\"display\":{\"provider\":\"bnjbiksqrglssain\",\"resource\":\"jwnzlljfmp\",\"operation\":\"ebvmgxsabkyqd\",\"description\":\"jitcjczdzevn\"},\"origin\":\"user\",\"properties\":{}},{\"name\":\"d\",\"display\":{\"provider\":\"dsbdkvwrwjf\",\"resource\":\"snhu\",\"operation\":\"eltmrldhugjzzdat\",\"description\":\"hocdgeab\"},\"origin\":\"user\",\"properties\":{}}],\"nextLink\":\"icndvkaozwyifty\"}") - .toObject(OperationListResult.class); - } - - @Test - public void testSerialize() { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListTests.java deleted file mode 100644 index decb41e5a6084..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/OperationsListTests.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.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.Operation; -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 OperationsListTests { - @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\":\"kn\",\"display\":{\"provider\":\"cwsvlxotog\",\"resource\":\"rupqsxvnmicy\",\"operation\":\"ceoveilovno\",\"description\":\"fj\"},\"origin\":\"system\",\"properties\":{}}]}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(Context.NONE); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/PrivateIpAddressTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/PrivateIpAddressTests.java deleted file mode 100644 index 84f8dc8d13b31..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/PrivateIpAddressTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.PrivateIpAddress; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateIpAddressTests { - @Test - public void testDeserialize() { - PrivateIpAddress model = - BinaryData - .fromString("{\"ipAddress\":\"mfdatscmdvpj\",\"subnetResourceId\":\"lsuuvmkjozkrwfnd\"}") - .toObject(PrivateIpAddress.class); - Assertions.assertEquals("mfdatscmdvpj", model.ipAddress()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.subnetResourceId()); - } - - @Test - public void testSerialize() { - PrivateIpAddress model = - new PrivateIpAddress().withIpAddress("mfdatscmdvpj").withSubnetResourceId("lsuuvmkjozkrwfnd"); - model = BinaryData.fromObject(model).toObject(PrivateIpAddress.class); - Assertions.assertEquals("mfdatscmdvpj", model.ipAddress()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.subnetResourceId()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ResourceIdentityTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ResourceIdentityTests.java deleted file mode 100644 index d52bb7668e974..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ResourceIdentityTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.IdentityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.ResourceIdentity; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceIdentityTests { - @Test - public void testDeserialize() { - ResourceIdentity model = - BinaryData.fromString("{\"type\":\"SystemAssigned\"}").toObject(ResourceIdentity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @Test - public void testSerialize() { - ResourceIdentity model = new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(ResourceIdentity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ScheduleTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ScheduleTests.java deleted file mode 100644 index 29833440e3ecd..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ScheduleTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentDayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.Schedule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScheduleTests { - @Test - public void testDeserialize() { - Schedule model = - BinaryData - .fromString( - "{\"enable\":false,\"weeklyInterval\":945771375,\"monthlyOccurrence\":2032893006,\"dayOfWeek\":\"Monday\",\"startTime\":\"na\"}") - .toObject(Schedule.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals(945771375, model.weeklyInterval()); - Assertions.assertEquals(2032893006, model.monthlyOccurrence()); - Assertions.assertEquals(AssessmentDayOfWeek.MONDAY, model.dayOfWeek()); - Assertions.assertEquals("na", model.startTime()); - } - - @Test - public void testSerialize() { - Schedule model = - new Schedule() - .withEnable(false) - .withWeeklyInterval(945771375) - .withMonthlyOccurrence(2032893006) - .withDayOfWeek(AssessmentDayOfWeek.MONDAY) - .withStartTime("na"); - model = BinaryData.fromObject(model).toObject(Schedule.class); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals(945771375, model.weeklyInterval()); - Assertions.assertEquals(2032893006, model.monthlyOccurrence()); - Assertions.assertEquals(AssessmentDayOfWeek.MONDAY, model.dayOfWeek()); - Assertions.assertEquals("na", model.startTime()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ServerConfigurationsManagementSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ServerConfigurationsManagementSettingsTests.java deleted file mode 100644 index daca73a148965..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/ServerConfigurationsManagementSettingsTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations; -import com.azure.resourcemanager.sqlvirtualmachine.models.ConnectivityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.ServerConfigurationsManagementSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlConnectivityUpdateSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlInstanceSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlStorageUpdateSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlWorkloadType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlWorkloadTypeUpdateSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ServerConfigurationsManagementSettingsTests { - @Test - public void testDeserialize() { - ServerConfigurationsManagementSettings model = - BinaryData - .fromString( - "{\"sqlConnectivityUpdateSettings\":{\"connectivityType\":\"PRIVATE\",\"port\":731084227,\"sqlAuthUpdateUserName\":\"fakeSqlAuthUpdateUsernamePlaceholder\",\"sqlAuthUpdatePassword\":\"fakeSqlAuthUpdatePasswordPlaceholder\"},\"sqlWorkloadTypeUpdateSettings\":{\"sqlWorkloadType\":\"DW\"},\"sqlStorageUpdateSettings\":{\"diskCount\":842863771,\"startingDeviceId\":2007426179,\"diskConfigurationType\":\"ADD\"},\"additionalFeaturesServerConfigurations\":{\"isRServicesEnabled\":false},\"sqlInstanceSettings\":{\"collation\":\"iqylihkaetck\",\"maxDop\":385263599,\"isOptimizeForAdHocWorkloadsEnabled\":false,\"minServerMemoryMB\":533172139,\"maxServerMemoryMB\":1960016252,\"isLpimEnabled\":true,\"isIfiEnabled\":true}}") - .toObject(ServerConfigurationsManagementSettings.class); - Assertions.assertEquals(ConnectivityType.PRIVATE, model.sqlConnectivityUpdateSettings().connectivityType()); - Assertions.assertEquals(731084227, model.sqlConnectivityUpdateSettings().port()); - Assertions.assertEquals("fakeSqlAuthUpdateUsernamePlaceholder", model.sqlConnectivityUpdateSettings().sqlAuthUpdateUsername()); - Assertions.assertEquals("fakeSqlAuthUpdatePasswordPlaceholder", model.sqlConnectivityUpdateSettings().sqlAuthUpdatePassword()); - Assertions.assertEquals(SqlWorkloadType.DW, model.sqlWorkloadTypeUpdateSettings().sqlWorkloadType()); - Assertions.assertEquals(842863771, model.sqlStorageUpdateSettings().diskCount()); - Assertions.assertEquals(2007426179, model.sqlStorageUpdateSettings().startingDeviceId()); - Assertions.assertEquals(DiskConfigurationType.ADD, model.sqlStorageUpdateSettings().diskConfigurationType()); - Assertions.assertEquals(false, model.additionalFeaturesServerConfigurations().isRServicesEnabled()); - Assertions.assertEquals("iqylihkaetck", model.sqlInstanceSettings().collation()); - Assertions.assertEquals(385263599, model.sqlInstanceSettings().maxDop()); - Assertions.assertEquals(false, model.sqlInstanceSettings().isOptimizeForAdHocWorkloadsEnabled()); - Assertions.assertEquals(533172139, model.sqlInstanceSettings().minServerMemoryMB()); - Assertions.assertEquals(1960016252, model.sqlInstanceSettings().maxServerMemoryMB()); - Assertions.assertEquals(true, model.sqlInstanceSettings().isLpimEnabled()); - Assertions.assertEquals(true, model.sqlInstanceSettings().isIfiEnabled()); - } - - @Test - public void testSerialize() { - ServerConfigurationsManagementSettings model = - new ServerConfigurationsManagementSettings() - .withSqlConnectivityUpdateSettings( - new SqlConnectivityUpdateSettings() - .withConnectivityType(ConnectivityType.PRIVATE) - .withPort(731084227) - .withSqlAuthUpdateUsername("fakeSqlAuthUpdateUsernamePlaceholder") - .withSqlAuthUpdatePassword("fakeSqlAuthUpdatePasswordPlaceholder")) - .withSqlWorkloadTypeUpdateSettings( - new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.DW)) - .withSqlStorageUpdateSettings( - new SqlStorageUpdateSettings() - .withDiskCount(842863771) - .withStartingDeviceId(2007426179) - .withDiskConfigurationType(DiskConfigurationType.ADD)) - .withAdditionalFeaturesServerConfigurations( - new AdditionalFeaturesServerConfigurations().withIsRServicesEnabled(false)) - .withSqlInstanceSettings( - new SqlInstanceSettings() - .withCollation("iqylihkaetck") - .withMaxDop(385263599) - .withIsOptimizeForAdHocWorkloadsEnabled(false) - .withMinServerMemoryMB(533172139) - .withMaxServerMemoryMB(1960016252) - .withIsLpimEnabled(true) - .withIsIfiEnabled(true)); - model = BinaryData.fromObject(model).toObject(ServerConfigurationsManagementSettings.class); - Assertions.assertEquals(ConnectivityType.PRIVATE, model.sqlConnectivityUpdateSettings().connectivityType()); - Assertions.assertEquals(731084227, model.sqlConnectivityUpdateSettings().port()); - Assertions.assertEquals("fakeSqlAuthUpdateUsernamePlaceholder", model.sqlConnectivityUpdateSettings().sqlAuthUpdateUsername()); - Assertions.assertEquals("fakeSqlAuthUpdatePasswordPlaceholder", model.sqlConnectivityUpdateSettings().sqlAuthUpdatePassword()); - Assertions.assertEquals(SqlWorkloadType.DW, model.sqlWorkloadTypeUpdateSettings().sqlWorkloadType()); - Assertions.assertEquals(842863771, model.sqlStorageUpdateSettings().diskCount()); - Assertions.assertEquals(2007426179, model.sqlStorageUpdateSettings().startingDeviceId()); - Assertions.assertEquals(DiskConfigurationType.ADD, model.sqlStorageUpdateSettings().diskConfigurationType()); - Assertions.assertEquals(false, model.additionalFeaturesServerConfigurations().isRServicesEnabled()); - Assertions.assertEquals("iqylihkaetck", model.sqlInstanceSettings().collation()); - Assertions.assertEquals(385263599, model.sqlInstanceSettings().maxDop()); - Assertions.assertEquals(false, model.sqlInstanceSettings().isOptimizeForAdHocWorkloadsEnabled()); - Assertions.assertEquals(533172139, model.sqlInstanceSettings().minServerMemoryMB()); - Assertions.assertEquals(1960016252, model.sqlInstanceSettings().maxServerMemoryMB()); - Assertions.assertEquals(true, model.sqlInstanceSettings().isLpimEnabled()); - Assertions.assertEquals(true, model.sqlInstanceSettings().isIfiEnabled()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlConnectivityUpdateSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlConnectivityUpdateSettingsTests.java deleted file mode 100644 index e432c64921e25..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlConnectivityUpdateSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.ConnectivityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlConnectivityUpdateSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlConnectivityUpdateSettingsTests { - @Test - public void testDeserialize() { - SqlConnectivityUpdateSettings model = - BinaryData - .fromString( - "{\"connectivityType\":\"PRIVATE\",\"port\":639676552,\"sqlAuthUpdateUserName\":\"fakeSqlAuthUpdateUsernamePlaceholder\",\"sqlAuthUpdatePassword\":\"fakeSqlAuthUpdatePasswordPlaceholder\"}") - .toObject(SqlConnectivityUpdateSettings.class); - Assertions.assertEquals(ConnectivityType.PRIVATE, model.connectivityType()); - Assertions.assertEquals(639676552, model.port()); - Assertions.assertEquals("fakeSqlAuthUpdateUsernamePlaceholder", model.sqlAuthUpdateUsername()); - Assertions.assertEquals("fakeSqlAuthUpdatePasswordPlaceholder", model.sqlAuthUpdatePassword()); - } - - @Test - public void testSerialize() { - SqlConnectivityUpdateSettings model = - new SqlConnectivityUpdateSettings() - .withConnectivityType(ConnectivityType.PRIVATE) - .withPort(639676552) - .withSqlAuthUpdateUsername("fakeSqlAuthUpdateUsernamePlaceholder") - .withSqlAuthUpdatePassword("fakeSqlAuthUpdatePasswordPlaceholder"); - model = BinaryData.fromObject(model).toObject(SqlConnectivityUpdateSettings.class); - Assertions.assertEquals(ConnectivityType.PRIVATE, model.connectivityType()); - Assertions.assertEquals(639676552, model.port()); - Assertions.assertEquals("fakeSqlAuthUpdateUsernamePlaceholder", model.sqlAuthUpdateUsername()); - Assertions.assertEquals("fakeSqlAuthUpdatePasswordPlaceholder", model.sqlAuthUpdatePassword()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlInstanceSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlInstanceSettingsTests.java deleted file mode 100644 index d00dc6371ef67..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlInstanceSettingsTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlInstanceSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlInstanceSettingsTests { - @Test - public void testDeserialize() { - SqlInstanceSettings model = - BinaryData - .fromString( - "{\"collation\":\"nljky\",\"maxDop\":197436298,\"isOptimizeForAdHocWorkloadsEnabled\":true,\"minServerMemoryMB\":9347197,\"maxServerMemoryMB\":1970519416,\"isLpimEnabled\":false,\"isIfiEnabled\":false}") - .toObject(SqlInstanceSettings.class); - Assertions.assertEquals("nljky", model.collation()); - Assertions.assertEquals(197436298, model.maxDop()); - Assertions.assertEquals(true, model.isOptimizeForAdHocWorkloadsEnabled()); - Assertions.assertEquals(9347197, model.minServerMemoryMB()); - Assertions.assertEquals(1970519416, model.maxServerMemoryMB()); - Assertions.assertEquals(false, model.isLpimEnabled()); - Assertions.assertEquals(false, model.isIfiEnabled()); - } - - @Test - public void testSerialize() { - SqlInstanceSettings model = - new SqlInstanceSettings() - .withCollation("nljky") - .withMaxDop(197436298) - .withIsOptimizeForAdHocWorkloadsEnabled(true) - .withMinServerMemoryMB(9347197) - .withMaxServerMemoryMB(1970519416) - .withIsLpimEnabled(false) - .withIsIfiEnabled(false); - model = BinaryData.fromObject(model).toObject(SqlInstanceSettings.class); - Assertions.assertEquals("nljky", model.collation()); - Assertions.assertEquals(197436298, model.maxDop()); - Assertions.assertEquals(true, model.isOptimizeForAdHocWorkloadsEnabled()); - Assertions.assertEquals(9347197, model.minServerMemoryMB()); - Assertions.assertEquals(1970519416, model.maxServerMemoryMB()); - Assertions.assertEquals(false, model.isLpimEnabled()); - Assertions.assertEquals(false, model.isIfiEnabled()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageSettingsTests.java deleted file mode 100644 index 4a9a404de31f0..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlStorageSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlStorageSettingsTests { - @Test - public void testDeserialize() { - SqlStorageSettings model = - BinaryData - .fromString("{\"luns\":[1233954324],\"defaultFilePath\":\"lzlfbxzpuz\"}") - .toObject(SqlStorageSettings.class); - Assertions.assertEquals(1233954324, model.luns().get(0)); - Assertions.assertEquals("lzlfbxzpuz", model.defaultFilePath()); - } - - @Test - public void testSerialize() { - SqlStorageSettings model = - new SqlStorageSettings().withLuns(Arrays.asList(1233954324)).withDefaultFilePath("lzlfbxzpuz"); - model = BinaryData.fromObject(model).toObject(SqlStorageSettings.class); - Assertions.assertEquals(1233954324, model.luns().get(0)); - Assertions.assertEquals("lzlfbxzpuz", model.defaultFilePath()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageUpdateSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageUpdateSettingsTests.java deleted file mode 100644 index 3d1327cf02504..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlStorageUpdateSettingsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlStorageUpdateSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlStorageUpdateSettingsTests { - @Test - public void testDeserialize() { - SqlStorageUpdateSettings model = - BinaryData - .fromString( - "{\"diskCount\":684290279,\"startingDeviceId\":99482426,\"diskConfigurationType\":\"EXTEND\"}") - .toObject(SqlStorageUpdateSettings.class); - Assertions.assertEquals(684290279, model.diskCount()); - Assertions.assertEquals(99482426, model.startingDeviceId()); - Assertions.assertEquals(DiskConfigurationType.EXTEND, model.diskConfigurationType()); - } - - @Test - public void testSerialize() { - SqlStorageUpdateSettings model = - new SqlStorageUpdateSettings() - .withDiskCount(684290279) - .withStartingDeviceId(99482426) - .withDiskConfigurationType(DiskConfigurationType.EXTEND); - model = BinaryData.fromObject(model).toObject(SqlStorageUpdateSettings.class); - Assertions.assertEquals(684290279, model.diskCount()); - Assertions.assertEquals(99482426, model.startingDeviceId()); - Assertions.assertEquals(DiskConfigurationType.EXTEND, model.diskConfigurationType()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlTempDbSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlTempDbSettingsTests.java deleted file mode 100644 index 8a90c6c139482..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlTempDbSettingsTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlTempDbSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlTempDbSettingsTests { - @Test - public void testDeserialize() { - SqlTempDbSettings model = - BinaryData - .fromString( - "{\"dataFileSize\":1610498845,\"dataGrowth\":650318692,\"logFileSize\":315992042,\"logGrowth\":2071345899,\"dataFileCount\":1202809910,\"persistFolder\":true,\"persistFolderPath\":\"rp\",\"luns\":[1035885378,380689806],\"defaultFilePath\":\"nuqqkpikadrgvt\"}") - .toObject(SqlTempDbSettings.class); - Assertions.assertEquals(1610498845, model.dataFileSize()); - Assertions.assertEquals(650318692, model.dataGrowth()); - Assertions.assertEquals(315992042, model.logFileSize()); - Assertions.assertEquals(2071345899, model.logGrowth()); - Assertions.assertEquals(1202809910, model.dataFileCount()); - Assertions.assertEquals(true, model.persistFolder()); - Assertions.assertEquals("rp", model.persistFolderPath()); - Assertions.assertEquals(1035885378, model.luns().get(0)); - Assertions.assertEquals("nuqqkpikadrgvt", model.defaultFilePath()); - } - - @Test - public void testSerialize() { - SqlTempDbSettings model = - new SqlTempDbSettings() - .withDataFileSize(1610498845) - .withDataGrowth(650318692) - .withLogFileSize(315992042) - .withLogGrowth(2071345899) - .withDataFileCount(1202809910) - .withPersistFolder(true) - .withPersistFolderPath("rp") - .withLuns(Arrays.asList(1035885378, 380689806)) - .withDefaultFilePath("nuqqkpikadrgvt"); - model = BinaryData.fromObject(model).toObject(SqlTempDbSettings.class); - Assertions.assertEquals(1610498845, model.dataFileSize()); - Assertions.assertEquals(650318692, model.dataGrowth()); - Assertions.assertEquals(315992042, model.logFileSize()); - Assertions.assertEquals(2071345899, model.logGrowth()); - Assertions.assertEquals(1202809910, model.dataFileCount()); - Assertions.assertEquals(true, model.persistFolder()); - Assertions.assertEquals("rp", model.persistFolderPath()); - Assertions.assertEquals(1035885378, model.luns().get(0)); - Assertions.assertEquals("nuqqkpikadrgvt", model.defaultFilePath()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupListResultTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupListResultTests.java deleted file mode 100644 index 897ecf30ffdb2..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroupListResult; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachineGroupListResultTests { - @Test - public void testDeserialize() { - SqlVirtualMachineGroupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"ysh\",\"sqlImageOffer\":\"zafb\",\"sqlImageSku\":\"Developer\",\"scaleType\":\"HA\",\"clusterManagerType\":\"WSFC\",\"clusterConfiguration\":\"Domainful\"},\"location\":\"mkljavb\",\"tags\":{\"hbzhfepg\":\"tqajzyulpkudjkrl\",\"paierh\":\"gqexzlocxs\",\"tjaodxobnb\":\"bcsglumma\",\"ajionpimexgstxg\":\"xkqpxo\"},\"id\":\"po\",\"name\":\"gmaajrm\",\"type\":\"djwzrlov\"}],\"nextLink\":\"lwhijcoejctbzaq\"}") - .toObject(SqlVirtualMachineGroupListResult.class); - } - - @Test - public void testSerialize() { - SqlVirtualMachineGroupListResult model = new SqlVirtualMachineGroupListResult(); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineGroupListResult.class); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupPropertiesTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupPropertiesTests.java deleted file mode 100644 index 92a4fa5fd9b57..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupPropertiesTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVirtualMachineGroupProperties; -import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterSubnetType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmGroupImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachineGroupPropertiesTests { - @Test - public void testDeserialize() { - SqlVirtualMachineGroupProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"g\",\"sqlImageOffer\":\"tnwu\",\"sqlImageSku\":\"Developer\",\"scaleType\":\"HA\",\"clusterManagerType\":\"WSFC\",\"clusterConfiguration\":\"Domainful\",\"wsfcDomainProfile\":{\"domainFqdn\":\"ckyfih\",\"ouPath\":\"idf\",\"clusterBootstrapAccount\":\"wdzuhtymwisd\",\"clusterOperatorAccount\":\"thwxmnteiwaopvkm\",\"sqlServiceAccount\":\"c\",\"fileShareWitnessPath\":\"xdcu\",\"storageAccountUrl\":\"fsrpymzidnse\",\"storageAccountPrimaryKey\":\"fakeStorageAccountPrimaryKeyPlaceholder\",\"clusterSubnetType\":\"MultiSubnet\"}}") - .toObject(SqlVirtualMachineGroupProperties.class); - Assertions.assertEquals("tnwu", model.sqlImageOffer()); - Assertions.assertEquals(SqlVmGroupImageSku.DEVELOPER, model.sqlImageSku()); - Assertions.assertEquals("ckyfih", model.wsfcDomainProfile().domainFqdn()); - Assertions.assertEquals("idf", model.wsfcDomainProfile().ouPath()); - Assertions.assertEquals("wdzuhtymwisd", model.wsfcDomainProfile().clusterBootstrapAccount()); - Assertions.assertEquals("thwxmnteiwaopvkm", model.wsfcDomainProfile().clusterOperatorAccount()); - Assertions.assertEquals("c", model.wsfcDomainProfile().sqlServiceAccount()); - Assertions.assertEquals("xdcu", model.wsfcDomainProfile().fileShareWitnessPath()); - Assertions.assertEquals("fsrpymzidnse", model.wsfcDomainProfile().storageAccountUrl()); - Assertions.assertEquals("fakeStorageAccountPrimaryKeyPlaceholder", model.wsfcDomainProfile().storageAccountPrimaryKey()); - Assertions.assertEquals(ClusterSubnetType.MULTI_SUBNET, model.wsfcDomainProfile().clusterSubnetType()); - } - - @Test - public void testSerialize() { - SqlVirtualMachineGroupProperties model = - new SqlVirtualMachineGroupProperties() - .withSqlImageOffer("tnwu") - .withSqlImageSku(SqlVmGroupImageSku.DEVELOPER) - .withWsfcDomainProfile( - new WsfcDomainProfile() - .withDomainFqdn("ckyfih") - .withOuPath("idf") - .withClusterBootstrapAccount("wdzuhtymwisd") - .withClusterOperatorAccount("thwxmnteiwaopvkm") - .withSqlServiceAccount("c") - .withFileShareWitnessPath("xdcu") - .withStorageAccountUrl("fsrpymzidnse") - .withStorageAccountPrimaryKey("fakeStorageAccountPrimaryKeyPlaceholder") - .withClusterSubnetType(ClusterSubnetType.MULTI_SUBNET)); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineGroupProperties.class); - Assertions.assertEquals("tnwu", model.sqlImageOffer()); - Assertions.assertEquals(SqlVmGroupImageSku.DEVELOPER, model.sqlImageSku()); - Assertions.assertEquals("ckyfih", model.wsfcDomainProfile().domainFqdn()); - Assertions.assertEquals("idf", model.wsfcDomainProfile().ouPath()); - Assertions.assertEquals("wdzuhtymwisd", model.wsfcDomainProfile().clusterBootstrapAccount()); - Assertions.assertEquals("thwxmnteiwaopvkm", model.wsfcDomainProfile().clusterOperatorAccount()); - Assertions.assertEquals("c", model.wsfcDomainProfile().sqlServiceAccount()); - Assertions.assertEquals("xdcu", model.wsfcDomainProfile().fileShareWitnessPath()); - Assertions.assertEquals("fsrpymzidnse", model.wsfcDomainProfile().storageAccountUrl()); - Assertions.assertEquals("fakeStorageAccountPrimaryKeyPlaceholder", model.wsfcDomainProfile().storageAccountPrimaryKey()); - Assertions.assertEquals(ClusterSubnetType.MULTI_SUBNET, model.wsfcDomainProfile().clusterSubnetType()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupUpdateTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupUpdateTests.java deleted file mode 100644 index 00e9146600358..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupUpdateTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroupUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachineGroupUpdateTests { - @Test - public void testDeserialize() { - SqlVirtualMachineGroupUpdate model = - BinaryData - .fromString("{\"tags\":{\"jxvsnbyxqabn\":\"pjxsqwpgrjbznor\"}}") - .toObject(SqlVirtualMachineGroupUpdate.class); - Assertions.assertEquals("pjxsqwpgrjbznor", model.tags().get("jxvsnbyxqabn")); - } - - @Test - public void testSerialize() { - SqlVirtualMachineGroupUpdate model = - new SqlVirtualMachineGroupUpdate().withTags(mapOf("jxvsnbyxqabn", "pjxsqwpgrjbznor")); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineGroupUpdate.class); - Assertions.assertEquals("pjxsqwpgrjbznor", model.tags().get("jxvsnbyxqabn")); - } - - @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/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateTests.java deleted file mode 100644 index 3dd50593deceb..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsCreateOrUpdateTests.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterSubnetType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroup; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmGroupImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainProfile; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -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 SqlVirtualMachineGroupsCreateOrUpdateTests { - @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\":{\"provisioningState\":\"Succeeded\",\"sqlImageOffer\":\"aboekqv\",\"sqlImageSku\":\"Developer\",\"scaleType\":\"HA\",\"clusterManagerType\":\"WSFC\",\"clusterConfiguration\":\"Domainful\",\"wsfcDomainProfile\":{\"domainFqdn\":\"jsflhhcaalnjix\",\"ouPath\":\"xyawj\",\"clusterBootstrapAccount\":\"aq\",\"clusterOperatorAccount\":\"lyjpk\",\"sqlServiceAccount\":\"dzyexznelixh\",\"fileShareWitnessPath\":\"ztfolhbnxk\",\"storageAccountUrl\":\"laulppg\",\"storageAccountPrimaryKey\":\"fakeStorageAccountPrimaryKeyPlaceholder\",\"clusterSubnetType\":\"MultiSubnet\"}},\"location\":\"lgqg\",\"tags\":{\"zhxgktrmgucn\":\"medjvcslynqwwncw\",\"llwptfdy\":\"pkteo\",\"rhhuaopppcqeqx\":\"pfqbuaceopzf\"},\"id\":\"lzdahzxctobgbkdm\",\"name\":\"izpost\",\"type\":\"grcfb\"}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SqlVirtualMachineGroup response = - manager - .sqlVirtualMachineGroups() - .define("riplrbpbewtg") - .withRegion("mefqsgzvahapjyzh") - .withExistingResourceGroup("khfxobbcswsrt") - .withTags(mapOf("lmwlxkvugfhzo", "qzcjrvxdj", "nxipeil", "awjvzunluthnnp")) - .withSqlImageOffer("zvlvqhjkbegib") - .withSqlImageSku(SqlVmGroupImageSku.DEVELOPER) - .withWsfcDomainProfile( - new WsfcDomainProfile() - .withDomainFqdn("oayqc") - .withOuPath("rtzju") - .withClusterBootstrapAccount("wyzmhtxon") - .withClusterOperatorAccount("ts") - .withSqlServiceAccount("jcbpwxqpsrknft") - .withFileShareWitnessPath("vriuhprwmdyvx") - .withStorageAccountUrl("ayriwwroyqbexrm") - .withStorageAccountPrimaryKey("fakeStorageAccountPrimaryKeyPlaceholder") - .withClusterSubnetType(ClusterSubnetType.SINGLE_SUBNET)) - .create(); - - Assertions.assertEquals("lgqg", response.location()); - Assertions.assertEquals("medjvcslynqwwncw", response.tags().get("zhxgktrmgucn")); - Assertions.assertEquals("aboekqv", response.sqlImageOffer()); - Assertions.assertEquals(SqlVmGroupImageSku.DEVELOPER, response.sqlImageSku()); - Assertions.assertEquals("jsflhhcaalnjix", response.wsfcDomainProfile().domainFqdn()); - Assertions.assertEquals("xyawj", response.wsfcDomainProfile().ouPath()); - Assertions.assertEquals("aq", response.wsfcDomainProfile().clusterBootstrapAccount()); - Assertions.assertEquals("lyjpk", response.wsfcDomainProfile().clusterOperatorAccount()); - Assertions.assertEquals("dzyexznelixh", response.wsfcDomainProfile().sqlServiceAccount()); - Assertions.assertEquals("ztfolhbnxk", response.wsfcDomainProfile().fileShareWitnessPath()); - Assertions.assertEquals("laulppg", response.wsfcDomainProfile().storageAccountUrl()); - Assertions.assertEquals("fakeStorageAccountPrimaryKeyPlaceholder", response.wsfcDomainProfile().storageAccountPrimaryKey()); - Assertions.assertEquals(ClusterSubnetType.MULTI_SUBNET, response.wsfcDomainProfile().clusterSubnetType()); - } - - @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/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteTests.java deleted file mode 100644 index 6603bdb3dd2f8..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsDeleteTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -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 SqlVirtualMachineGroupsDeleteTests { - @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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sqlVirtualMachineGroups().delete("k", "nxdhbt", Context.NONE); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupTests.java deleted file mode 100644 index 2f0641c18d361..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListByResourceGroupTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterSubnetType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroup; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmGroupImageSku; -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 SqlVirtualMachineGroupsListByResourceGroupTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"rmclfplphoxu\",\"sqlImageOffer\":\"rpabg\",\"sqlImageSku\":\"Developer\",\"scaleType\":\"HA\",\"clusterManagerType\":\"WSFC\",\"clusterConfiguration\":\"Domainful\",\"wsfcDomainProfile\":{\"domainFqdn\":\"gxywpmue\",\"ouPath\":\"jzwf\",\"clusterBootstrapAccount\":\"q\",\"clusterOperatorAccount\":\"ids\",\"sqlServiceAccount\":\"onobglaocqx\",\"fileShareWitnessPath\":\"cmgyud\",\"storageAccountUrl\":\"tlmoyrx\",\"storageAccountPrimaryKey\":\"fakeStorageAccountPrimaryKeyPlaceholder\",\"clusterSubnetType\":\"SingleSubnet\"}},\"location\":\"hl\",\"tags\":{\"kfrlhrxsbky\":\"bh\",\"afkuwb\":\"pycanuzbpz\",\"ehhseyvjusrts\":\"rnwb\"},\"id\":\"hspkdeemao\",\"name\":\"mx\",\"type\":\"gkvtmelmqkrhah\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sqlVirtualMachineGroups().listByResourceGroup("kphywpnvjto", Context.NONE); - - Assertions.assertEquals("hl", response.iterator().next().location()); - Assertions.assertEquals("bh", response.iterator().next().tags().get("kfrlhrxsbky")); - Assertions.assertEquals("rpabg", response.iterator().next().sqlImageOffer()); - Assertions.assertEquals(SqlVmGroupImageSku.DEVELOPER, response.iterator().next().sqlImageSku()); - Assertions.assertEquals("gxywpmue", response.iterator().next().wsfcDomainProfile().domainFqdn()); - Assertions.assertEquals("jzwf", response.iterator().next().wsfcDomainProfile().ouPath()); - Assertions.assertEquals("q", response.iterator().next().wsfcDomainProfile().clusterBootstrapAccount()); - Assertions.assertEquals("ids", response.iterator().next().wsfcDomainProfile().clusterOperatorAccount()); - Assertions.assertEquals("onobglaocqx", response.iterator().next().wsfcDomainProfile().sqlServiceAccount()); - Assertions.assertEquals("cmgyud", response.iterator().next().wsfcDomainProfile().fileShareWitnessPath()); - Assertions.assertEquals("tlmoyrx", response.iterator().next().wsfcDomainProfile().storageAccountUrl()); - Assertions.assertEquals("fakeStorageAccountPrimaryKeyPlaceholder", response.iterator().next().wsfcDomainProfile().storageAccountPrimaryKey()); - Assertions - .assertEquals( - ClusterSubnetType.SINGLE_SUBNET, response.iterator().next().wsfcDomainProfile().clusterSubnetType()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListTests.java deleted file mode 100644 index 645e69dc0ca6b..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineGroupsListTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterSubnetType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineGroup; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmGroupImageSku; -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 SqlVirtualMachineGroupsListTests { - @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\":[{\"properties\":{\"provisioningState\":\"uahaquhcdhmd\",\"sqlImageOffer\":\"laexqp\",\"sqlImageSku\":\"Developer\",\"scaleType\":\"HA\",\"clusterManagerType\":\"WSFC\",\"clusterConfiguration\":\"Domainful\",\"wsfcDomainProfile\":{\"domainFqdn\":\"vxpvgomz\",\"ouPath\":\"misgwbnb\",\"clusterBootstrapAccount\":\"ldawkzbaliourqha\",\"clusterOperatorAccount\":\"uhashsfwx\",\"sqlServiceAccount\":\"owzxcu\",\"fileShareWitnessPath\":\"cjooxdjebwpucwwf\",\"storageAccountUrl\":\"vbvmeu\",\"storageAccountPrimaryKey\":\"fakeStorageAccountPrimaryKeyPlaceholder\",\"clusterSubnetType\":\"SingleSubnet\"}},\"location\":\"wmcdytdxwi\",\"tags\":{\"qwgxhniskx\":\"rjaw\",\"klwndnhjdauwhv\":\"bkpyc\",\"zbtd\":\"l\"},\"id\":\"xujznbmpowu\",\"name\":\"przqlveu\",\"type\":\"lupj\"}]}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.sqlVirtualMachineGroups().list(Context.NONE); - - Assertions.assertEquals("wmcdytdxwi", response.iterator().next().location()); - Assertions.assertEquals("rjaw", response.iterator().next().tags().get("qwgxhniskx")); - Assertions.assertEquals("laexqp", response.iterator().next().sqlImageOffer()); - Assertions.assertEquals(SqlVmGroupImageSku.DEVELOPER, response.iterator().next().sqlImageSku()); - Assertions.assertEquals("vxpvgomz", response.iterator().next().wsfcDomainProfile().domainFqdn()); - Assertions.assertEquals("misgwbnb", response.iterator().next().wsfcDomainProfile().ouPath()); - Assertions - .assertEquals("ldawkzbaliourqha", response.iterator().next().wsfcDomainProfile().clusterBootstrapAccount()); - Assertions.assertEquals("uhashsfwx", response.iterator().next().wsfcDomainProfile().clusterOperatorAccount()); - Assertions.assertEquals("owzxcu", response.iterator().next().wsfcDomainProfile().sqlServiceAccount()); - Assertions - .assertEquals("cjooxdjebwpucwwf", response.iterator().next().wsfcDomainProfile().fileShareWitnessPath()); - Assertions.assertEquals("vbvmeu", response.iterator().next().wsfcDomainProfile().storageAccountUrl()); - Assertions - .assertEquals( - "fakeStorageAccountPrimaryKeyPlaceholder", response.iterator().next().wsfcDomainProfile().storageAccountPrimaryKey()); - Assertions - .assertEquals( - ClusterSubnetType.SINGLE_SUBNET, response.iterator().next().wsfcDomainProfile().clusterSubnetType()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineInnerTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineInnerTests.java deleted file mode 100644 index e5a9ee6419454..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineInnerTests.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVirtualMachineInner; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupDaysOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import com.azure.resourcemanager.sqlvirtualmachine.models.IdentityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.KeyVaultCredentialSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.LeastPrivilegeMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.ResourceIdentity; -import com.azure.resourcemanager.sqlvirtualmachine.models.ServerConfigurationsManagementSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachineInnerTests { - @Test - public void testDeserialize() { - SqlVirtualMachineInner model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"SystemAssigned\"},\"properties\":{\"virtualMachineResourceId\":\"scxaq\",\"provisioningState\":\"ochcbonqvpkvl\",\"sqlImageOffer\":\"njeaseipheofloke\",\"sqlServerLicenseType\":\"PAYG\",\"sqlManagement\":\"NoAgent\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Express\",\"sqlVirtualMachineGroupResourceId\":\"tgrhpdjpjumas\",\"wsfcDomainCredentials\":{\"clusterBootstrapAccountPassword\":\"fakeClusterBootstrapAccountPasswordPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeClusterOperatorAccountPasswordPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"},\"wsfcStaticIp\":\"dudgwdslfhot\",\"autoPatchingSettings\":{\"enable\":false,\"dayOfWeek\":\"Wednesday\",\"maintenanceWindowStartingHour\":1733107709,\"maintenanceWindowDuration\":991937495},\"autoBackupSettings\":{\"enable\":true,\"enableEncryption\":false,\"retentionPeriod\":1625524147,\"storageAccountUrl\":\"dehxnltyfsoppu\",\"storageContainerName\":\"esnzwde\",\"storageAccessKey\":\"fakeStorageAccessKeyPlaceholder\",\"password\":\"fakeAutoBackupPasswordPlaceholder\",\"backupSystemDbs\":false,\"backupScheduleType\":\"Manual\",\"fullBackupFrequency\":\"Weekly\",\"daysOfWeek\":[\"Sunday\",\"Saturday\",\"Friday\",\"Wednesday\"],\"fullBackupStartTime\":766815263,\"fullBackupWindowHours\":247911704,\"logBackupFrequency\":175400299},\"keyVaultCredentialSettings\":{\"enable\":true,\"credentialName\":\"slazjdyg\",\"azureKeyVaultUrl\":\"tjixhbkuofqweyk\",\"servicePrincipalName\":\"enevfyexfwhybci\",\"servicePrincipalSecret\":\"fakeSecretPlaceholder\"},\"serverConfigurationsManagementSettings\":{},\"storageConfigurationSettings\":{\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"NEW\",\"storageWorkloadType\":\"DW\"},\"assessmentSettings\":{\"enable\":true,\"runImmediately\":true},\"enableAutomaticUpgrade\":true},\"location\":\"jrefovgmkqsle\",\"tags\":{\"k\":\"xyqj\",\"jh\":\"attpngjcrcczsq\",\"ysou\":\"mdajv\",\"canoaeupf\":\"q\"},\"id\":\"yhltrpmopjmcm\",\"name\":\"tuo\",\"type\":\"thfuiuaodsfcpkvx\"}") - .toObject(SqlVirtualMachineInner.class); - Assertions.assertEquals("jrefovgmkqsle", model.location()); - Assertions.assertEquals("xyqj", model.tags().get("k")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("scxaq", model.virtualMachineResourceId()); - Assertions.assertEquals("njeaseipheofloke", model.sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.PAYG, model.sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.NO_AGENT, model.sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, model.leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.EXPRESS, model.sqlImageSku()); - Assertions.assertEquals("tgrhpdjpjumas", model.sqlVirtualMachineGroupResourceId()); - Assertions.assertEquals("fakeClusterBootstrapAccountPasswordPlaceholder", - model.wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeClusterOperatorAccountPasswordPlaceholder", - model.wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", - model.wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("dudgwdslfhot", model.wsfcStaticIp()); - Assertions.assertEquals(false, model.autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.autoPatchingSettings().dayOfWeek()); - Assertions.assertEquals(1733107709, model.autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions.assertEquals(991937495, model.autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(true, model.autoBackupSettings().enable()); - Assertions.assertEquals(false, model.autoBackupSettings().enableEncryption()); - Assertions.assertEquals(1625524147, model.autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("dehxnltyfsoppu", model.autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("esnzwde", model.autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", model.autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakeAutoBackupPasswordPlaceholder", model.autoBackupSettings().password()); - Assertions.assertEquals(false, model.autoBackupSettings().backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.MANUAL, model.autoBackupSettings().backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.WEEKLY, model.autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(AutoBackupDaysOfWeek.SUNDAY, model.autoBackupSettings().daysOfWeek().get(0)); - Assertions.assertEquals(766815263, model.autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(247911704, model.autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(175400299, model.autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(true, model.keyVaultCredentialSettings().enable()); - Assertions.assertEquals("slazjdyg", model.keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("tjixhbkuofqweyk", model.keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions.assertEquals("enevfyexfwhybci", model.keyVaultCredentialSettings().servicePrincipalName()); - Assertions.assertEquals("fakeSecretPlaceholder", model.keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions.assertEquals(false, model.storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals(DiskConfigurationType.NEW, model.storageConfigurationSettings().diskConfigurationType()); - Assertions.assertEquals(StorageWorkloadType.DW, model.storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(true, model.assessmentSettings().enable()); - Assertions.assertEquals(true, model.assessmentSettings().runImmediately()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } - - @Test - public void testSerialize() { - SqlVirtualMachineInner model = - new SqlVirtualMachineInner() - .withLocation("jrefovgmkqsle") - .withTags(mapOf("k", "xyqj", "jh", "attpngjcrcczsq", "ysou", "mdajv", "canoaeupf", "q")) - .withIdentity(new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED)) - .withVirtualMachineResourceId("scxaq") - .withSqlImageOffer("njeaseipheofloke") - .withSqlServerLicenseType(SqlServerLicenseType.PAYG) - .withSqlManagement(SqlManagementMode.NO_AGENT) - .withLeastPrivilegeMode(LeastPrivilegeMode.ENABLED) - .withSqlImageSku(SqlImageSku.EXPRESS) - .withSqlVirtualMachineGroupResourceId("tgrhpdjpjumas") - .withWsfcDomainCredentials( - new WsfcDomainCredentials() - .withClusterBootstrapAccountPassword("fakeClusterBootstrapAccountPasswordPlaceholder") - .withClusterOperatorAccountPassword("fakeClusterOperatorAccountPasswordPlaceholder") - .withSqlServiceAccountPassword("fakeSqlServiceAccountPasswordPlaceholder")) - .withWsfcStaticIp("dudgwdslfhot") - .withAutoPatchingSettings( - new AutoPatchingSettings() - .withEnable(false) - .withDayOfWeek(DayOfWeek.WEDNESDAY) - .withMaintenanceWindowStartingHour(1733107709) - .withMaintenanceWindowDuration(991937495)) - .withAutoBackupSettings( - new AutoBackupSettings() - .withEnable(true) - .withEnableEncryption(false) - .withRetentionPeriod(1625524147) - .withStorageAccountUrl("dehxnltyfsoppu") - .withStorageContainerName("esnzwde") - .withStorageAccessKey("fakeStorageAccessKeyPlaceholder") - .withPassword("fakeAutoBackupPasswordPlaceholder") - .withBackupSystemDbs(false) - .withBackupScheduleType(BackupScheduleType.MANUAL) - .withFullBackupFrequency(FullBackupFrequencyType.WEEKLY) - .withDaysOfWeek( - Arrays - .asList( - AutoBackupDaysOfWeek.SUNDAY, - AutoBackupDaysOfWeek.SATURDAY, - AutoBackupDaysOfWeek.FRIDAY, - AutoBackupDaysOfWeek.WEDNESDAY)) - .withFullBackupStartTime(766815263) - .withFullBackupWindowHours(247911704) - .withLogBackupFrequency(175400299)) - .withKeyVaultCredentialSettings( - new KeyVaultCredentialSettings() - .withEnable(true) - .withCredentialName("slazjdyg") - .withAzureKeyVaultUrl("tjixhbkuofqweyk") - .withServicePrincipalName("enevfyexfwhybci") - .withServicePrincipalSecret("fakeSecretPlaceholder")) - .withServerConfigurationsManagementSettings(new ServerConfigurationsManagementSettings()) - .withStorageConfigurationSettings( - new StorageConfigurationSettings() - .withSqlSystemDbOnDataDisk(false) - .withDiskConfigurationType(DiskConfigurationType.NEW) - .withStorageWorkloadType(StorageWorkloadType.DW)) - .withAssessmentSettings(new AssessmentSettings().withEnable(true).withRunImmediately(true)) - .withEnableAutomaticUpgrade(true); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineInner.class); - Assertions.assertEquals("jrefovgmkqsle", model.location()); - Assertions.assertEquals("xyqj", model.tags().get("k")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("scxaq", model.virtualMachineResourceId()); - Assertions.assertEquals("njeaseipheofloke", model.sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.PAYG, model.sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.NO_AGENT, model.sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, model.leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.EXPRESS, model.sqlImageSku()); - Assertions.assertEquals("tgrhpdjpjumas", model.sqlVirtualMachineGroupResourceId()); - Assertions.assertEquals("fakeClusterBootstrapAccountPasswordPlaceholder", - model.wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeClusterOperatorAccountPasswordPlaceholder", - model.wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", - model.wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("dudgwdslfhot", model.wsfcStaticIp()); - Assertions.assertEquals(false, model.autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.autoPatchingSettings().dayOfWeek()); - Assertions.assertEquals(1733107709, model.autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions.assertEquals(991937495, model.autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(true, model.autoBackupSettings().enable()); - Assertions.assertEquals(false, model.autoBackupSettings().enableEncryption()); - Assertions.assertEquals(1625524147, model.autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("dehxnltyfsoppu", model.autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("esnzwde", model.autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", model.autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakeAutoBackupPasswordPlaceholder", model.autoBackupSettings().password()); - Assertions.assertEquals(false, model.autoBackupSettings().backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.MANUAL, model.autoBackupSettings().backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.WEEKLY, model.autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(AutoBackupDaysOfWeek.SUNDAY, model.autoBackupSettings().daysOfWeek().get(0)); - Assertions.assertEquals(766815263, model.autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(247911704, model.autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(175400299, model.autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(true, model.keyVaultCredentialSettings().enable()); - Assertions.assertEquals("slazjdyg", model.keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("tjixhbkuofqweyk", model.keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions.assertEquals("enevfyexfwhybci", model.keyVaultCredentialSettings().servicePrincipalName()); - Assertions.assertEquals("fakeSecretPlaceholder", model.keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions.assertEquals(false, model.storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals(DiskConfigurationType.NEW, model.storageConfigurationSettings().diskConfigurationType()); - Assertions.assertEquals(StorageWorkloadType.DW, model.storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(true, model.assessmentSettings().enable()); - Assertions.assertEquals(true, model.assessmentSettings().runImmediately()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } - - @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/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineListResultTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineListResultTests.java deleted file mode 100644 index d8f9b1ed59e17..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineListResult; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachineListResultTests { - @Test - public void testDeserialize() { - SqlVirtualMachineListResult model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"type\":\"None\"},\"properties\":{\"virtualMachineResourceId\":\"gukdkexxppo\",\"provisioningState\":\"xaxcfjpgddtocjjx\",\"sqlImageOffer\":\"pmouexhdz\",\"sqlServerLicenseType\":\"PAYG\",\"sqlManagement\":\"LightWeight\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Developer\",\"sqlVirtualMachineGroupResourceId\":\"bzv\",\"wsfcStaticIp\":\"t\",\"enableAutomaticUpgrade\":false},\"location\":\"pzaoqvuhr\",\"tags\":{\"mjthjqkwp\":\"fcyddg\"},\"id\":\"eicxmqciwqvhkhi\",\"name\":\"uigdtopbobjog\",\"type\":\"m\"},{\"identity\":{\"type\":\"None\"},\"properties\":{\"virtualMachineResourceId\":\"rzayv\",\"provisioningState\":\"pgvdf\",\"sqlImageOffer\":\"otkftutqxlngx\",\"sqlServerLicenseType\":\"AHUB\",\"sqlManagement\":\"LightWeight\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Web\",\"sqlVirtualMachineGroupResourceId\":\"xdqmidtthzrvqdra\",\"wsfcStaticIp\":\"yb\",\"enableAutomaticUpgrade\":true},\"location\":\"skanyk\",\"tags\":{\"ndrvynhzg\":\"cuiywgqyw\",\"ecfvmm\":\"phrcgyncoc\",\"sxlzevgbmqj\":\"oo\",\"lzu\":\"abcypmivk\"},\"id\":\"ccfwnfnbacfion\",\"name\":\"ebxetqgtzxdp\",\"type\":\"qbqqwxr\"}],\"nextLink\":\"eallnwsubisnj\"}") - .toObject(SqlVirtualMachineListResult.class); - } - - @Test - public void testSerialize() { - SqlVirtualMachineListResult model = new SqlVirtualMachineListResult(); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineListResult.class); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinePropertiesTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinePropertiesTests.java deleted file mode 100644 index 8a49abe0cd08f..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinePropertiesTests.java +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.fluent.models.SqlVirtualMachineProperties; -import com.azure.resourcemanager.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentDayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupDaysOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.ConnectivityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import com.azure.resourcemanager.sqlvirtualmachine.models.KeyVaultCredentialSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.LeastPrivilegeMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.Schedule; -import com.azure.resourcemanager.sqlvirtualmachine.models.ServerConfigurationsManagementSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlConnectivityUpdateSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlInstanceSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlStorageSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlStorageUpdateSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlTempDbSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlWorkloadType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlWorkloadTypeUpdateSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachinePropertiesTests { - @Test - public void testDeserialize() { - SqlVirtualMachineProperties model = - BinaryData - .fromString( - "{\"virtualMachineResourceId\":\"myzydagfuaxbez\",\"provisioningState\":\"uokktwhrdxwz\",\"sqlImageOffer\":\"q\",\"sqlServerLicenseType\":\"DR\",\"sqlManagement\":\"LightWeight\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Web\",\"sqlVirtualMachineGroupResourceId\":\"o\",\"wsfcDomainCredentials\":{\"clusterBootstrapAccountPassword\":\"fakeBootstrapCredentialPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeOperatorCredentialPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"},\"wsfcStaticIp\":\"xhqyudxorrqnb\",\"autoPatchingSettings\":{\"enable\":true,\"dayOfWeek\":\"Sunday\",\"maintenanceWindowStartingHour\":2041227856,\"maintenanceWindowDuration\":688230720},\"autoBackupSettings\":{\"enable\":true,\"enableEncryption\":false,\"retentionPeriod\":711383541,\"storageAccountUrl\":\"rm\",\"storageContainerName\":\"d\",\"storageAccessKey\":\"fakeAutoBackupStorageCredentialPlaceholder\",\"password\":\"fakeAutoBackupCredentialPlaceholder\",\"backupSystemDbs\":false,\"backupScheduleType\":\"Manual\",\"fullBackupFrequency\":\"Weekly\",\"daysOfWeek\":[\"Monday\",\"Tuesday\",\"Sunday\"],\"fullBackupStartTime\":79438477,\"fullBackupWindowHours\":1785940860,\"logBackupFrequency\":1882721753},\"keyVaultCredentialSettings\":{\"enable\":false,\"credentialName\":\"lhzdobp\",\"azureKeyVaultUrl\":\"mflbv\",\"servicePrincipalName\":\"chrkcciwwzjuqk\",\"servicePrincipalSecret\":\"fakeServicePrincipleSecretPlaceholder\"},\"serverConfigurationsManagementSettings\":{\"sqlConnectivityUpdateSettings\":{\"connectivityType\":\"PUBLIC\",\"port\":1163138760,\"sqlAuthUpdateUserName\":\"fakeSqlAuthUpdateUserNamePlaceholder\",\"sqlAuthUpdatePassword\":\"fakeSqlAuthUpdatePasswordPlaceholder\"},\"sqlWorkloadTypeUpdateSettings\":{\"sqlWorkloadType\":\"DW\"},\"sqlStorageUpdateSettings\":{\"diskCount\":93185233,\"startingDeviceId\":499062312,\"diskConfigurationType\":\"NEW\"},\"additionalFeaturesServerConfigurations\":{\"isRServicesEnabled\":true},\"sqlInstanceSettings\":{\"collation\":\"hocohslkev\",\"maxDop\":1452843037,\"isOptimizeForAdHocWorkloadsEnabled\":false,\"minServerMemoryMB\":1915206631,\"maxServerMemoryMB\":635098272,\"isLpimEnabled\":true,\"isIfiEnabled\":true}},\"storageConfigurationSettings\":{\"sqlDataSettings\":{\"luns\":[750094319,441262471],\"defaultFilePath\":\"ithlvmezyvshxm\"},\"sqlLogSettings\":{\"luns\":[2042967034,820071175,681165656],\"defaultFilePath\":\"igrxwburvjxxjn\"},\"sqlTempDbSettings\":{\"dataFileSize\":655244901,\"dataGrowth\":796522407,\"logFileSize\":1581089013,\"logGrowth\":1482419493,\"dataFileCount\":368872056,\"persistFolder\":true,\"persistFolderPath\":\"vudwtiukbldng\",\"luns\":[2138211196,1997522468,655680628],\"defaultFilePath\":\"z\"},\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"ADD\",\"storageWorkloadType\":\"OLTP\"},\"assessmentSettings\":{\"enable\":true,\"runImmediately\":true,\"schedule\":{\"enable\":false,\"weeklyInterval\":2112033193,\"monthlyOccurrence\":2000492920,\"dayOfWeek\":\"Sunday\",\"startTime\":\"typmrbpizcdrqjsd\"}},\"enableAutomaticUpgrade\":true}") - .toObject(SqlVirtualMachineProperties.class); - Assertions.assertEquals("myzydagfuaxbez", model.virtualMachineResourceId()); - Assertions.assertEquals("q", model.sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.DR, model.sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.LIGHT_WEIGHT, model.sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, model.leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.WEB, model.sqlImageSku()); - Assertions.assertEquals("o", model.sqlVirtualMachineGroupResourceId()); - Assertions.assertEquals("fakeBootstrapCredentialPlaceholder", model.wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeOperatorCredentialPlaceholder", model.wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", model.wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("xhqyudxorrqnb", model.wsfcStaticIp()); - Assertions.assertEquals(true, model.autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.autoPatchingSettings().dayOfWeek()); - Assertions.assertEquals(2041227856, model.autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions.assertEquals(688230720, model.autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(true, model.autoBackupSettings().enable()); - Assertions.assertEquals(false, model.autoBackupSettings().enableEncryption()); - Assertions.assertEquals(711383541, model.autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("rm", model.autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("d", model.autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeAutoBackupStorageCredentialPlaceholder", model.autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakeAutoBackupCredentialPlaceholder", model.autoBackupSettings().password()); - Assertions.assertEquals(false, model.autoBackupSettings().backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.MANUAL, model.autoBackupSettings().backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.WEEKLY, model.autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(AutoBackupDaysOfWeek.MONDAY, model.autoBackupSettings().daysOfWeek().get(0)); - Assertions.assertEquals(79438477, model.autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(1785940860, model.autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(1882721753, model.autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(false, model.keyVaultCredentialSettings().enable()); - Assertions.assertEquals("lhzdobp", model.keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("mflbv", model.keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions.assertEquals("chrkcciwwzjuqk", model.keyVaultCredentialSettings().servicePrincipalName()); - Assertions.assertEquals("fakeServicePrincipleSecretPlaceholder", model.keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions - .assertEquals( - ConnectivityType.PUBLIC, - model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().connectivityType()); - Assertions - .assertEquals( - 1163138760, model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().port()); - Assertions - .assertEquals( - "fakeSqlAuthUpdateUserNamePlaceholder", - model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().sqlAuthUpdateUsername()); - Assertions - .assertEquals( - "fakeSqlAuthUpdatePasswordPlaceholder", - model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().sqlAuthUpdatePassword()); - Assertions - .assertEquals( - SqlWorkloadType.DW, - model.serverConfigurationsManagementSettings().sqlWorkloadTypeUpdateSettings().sqlWorkloadType()); - Assertions - .assertEquals( - 93185233, model.serverConfigurationsManagementSettings().sqlStorageUpdateSettings().diskCount()); - Assertions - .assertEquals( - 499062312, - model.serverConfigurationsManagementSettings().sqlStorageUpdateSettings().startingDeviceId()); - Assertions - .assertEquals( - DiskConfigurationType.NEW, - model.serverConfigurationsManagementSettings().sqlStorageUpdateSettings().diskConfigurationType()); - Assertions - .assertEquals( - true, - model - .serverConfigurationsManagementSettings() - .additionalFeaturesServerConfigurations() - .isRServicesEnabled()); - Assertions - .assertEquals( - "hocohslkev", model.serverConfigurationsManagementSettings().sqlInstanceSettings().collation()); - Assertions - .assertEquals(1452843037, model.serverConfigurationsManagementSettings().sqlInstanceSettings().maxDop()); - Assertions - .assertEquals( - false, - model - .serverConfigurationsManagementSettings() - .sqlInstanceSettings() - .isOptimizeForAdHocWorkloadsEnabled()); - Assertions - .assertEquals( - 1915206631, model.serverConfigurationsManagementSettings().sqlInstanceSettings().minServerMemoryMB()); - Assertions - .assertEquals( - 635098272, model.serverConfigurationsManagementSettings().sqlInstanceSettings().maxServerMemoryMB()); - Assertions - .assertEquals(true, model.serverConfigurationsManagementSettings().sqlInstanceSettings().isLpimEnabled()); - Assertions - .assertEquals(true, model.serverConfigurationsManagementSettings().sqlInstanceSettings().isIfiEnabled()); - Assertions.assertEquals(750094319, model.storageConfigurationSettings().sqlDataSettings().luns().get(0)); - Assertions - .assertEquals("ithlvmezyvshxm", model.storageConfigurationSettings().sqlDataSettings().defaultFilePath()); - Assertions.assertEquals(2042967034, model.storageConfigurationSettings().sqlLogSettings().luns().get(0)); - Assertions - .assertEquals("igrxwburvjxxjn", model.storageConfigurationSettings().sqlLogSettings().defaultFilePath()); - Assertions.assertEquals(655244901, model.storageConfigurationSettings().sqlTempDbSettings().dataFileSize()); - Assertions.assertEquals(796522407, model.storageConfigurationSettings().sqlTempDbSettings().dataGrowth()); - Assertions.assertEquals(1581089013, model.storageConfigurationSettings().sqlTempDbSettings().logFileSize()); - Assertions.assertEquals(1482419493, model.storageConfigurationSettings().sqlTempDbSettings().logGrowth()); - Assertions.assertEquals(368872056, model.storageConfigurationSettings().sqlTempDbSettings().dataFileCount()); - Assertions.assertEquals(true, model.storageConfigurationSettings().sqlTempDbSettings().persistFolder()); - Assertions - .assertEquals( - "vudwtiukbldng", model.storageConfigurationSettings().sqlTempDbSettings().persistFolderPath()); - Assertions.assertEquals(2138211196, model.storageConfigurationSettings().sqlTempDbSettings().luns().get(0)); - Assertions.assertEquals("z", model.storageConfigurationSettings().sqlTempDbSettings().defaultFilePath()); - Assertions.assertEquals(false, model.storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals(DiskConfigurationType.ADD, model.storageConfigurationSettings().diskConfigurationType()); - Assertions.assertEquals(StorageWorkloadType.OLTP, model.storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(true, model.assessmentSettings().enable()); - Assertions.assertEquals(true, model.assessmentSettings().runImmediately()); - Assertions.assertEquals(false, model.assessmentSettings().schedule().enable()); - Assertions.assertEquals(2112033193, model.assessmentSettings().schedule().weeklyInterval()); - Assertions.assertEquals(2000492920, model.assessmentSettings().schedule().monthlyOccurrence()); - Assertions.assertEquals(AssessmentDayOfWeek.SUNDAY, model.assessmentSettings().schedule().dayOfWeek()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.assessmentSettings().schedule().startTime()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } - - @Test - public void testSerialize() { - SqlVirtualMachineProperties model = - new SqlVirtualMachineProperties() - .withVirtualMachineResourceId("myzydagfuaxbez") - .withSqlImageOffer("q") - .withSqlServerLicenseType(SqlServerLicenseType.DR) - .withSqlManagement(SqlManagementMode.LIGHT_WEIGHT) - .withLeastPrivilegeMode(LeastPrivilegeMode.ENABLED) - .withSqlImageSku(SqlImageSku.WEB) - .withSqlVirtualMachineGroupResourceId("o") - .withWsfcDomainCredentials( - new WsfcDomainCredentials() - .withClusterBootstrapAccountPassword("fakeBootstrapCredentialPlaceholder") - .withClusterOperatorAccountPassword("fakeOperatorCredentialPlaceholder") - .withSqlServiceAccountPassword("fakeSqlServiceAccountPasswordPlaceholder")) - .withWsfcStaticIp("xhqyudxorrqnb") - .withAutoPatchingSettings( - new AutoPatchingSettings() - .withEnable(true) - .withDayOfWeek(DayOfWeek.SUNDAY) - .withMaintenanceWindowStartingHour(2041227856) - .withMaintenanceWindowDuration(688230720)) - .withAutoBackupSettings( - new AutoBackupSettings() - .withEnable(true) - .withEnableEncryption(false) - .withRetentionPeriod(711383541) - .withStorageAccountUrl("rm") - .withStorageContainerName("d") - .withStorageAccessKey("fakeAutoBackupStorageCredentialPlaceholder") - .withPassword("fakeAutoBackupCredentialPlaceholder") - .withBackupSystemDbs(false) - .withBackupScheduleType(BackupScheduleType.MANUAL) - .withFullBackupFrequency(FullBackupFrequencyType.WEEKLY) - .withDaysOfWeek( - Arrays - .asList( - AutoBackupDaysOfWeek.MONDAY, - AutoBackupDaysOfWeek.TUESDAY, - AutoBackupDaysOfWeek.SUNDAY)) - .withFullBackupStartTime(79438477) - .withFullBackupWindowHours(1785940860) - .withLogBackupFrequency(1882721753)) - .withKeyVaultCredentialSettings( - new KeyVaultCredentialSettings() - .withEnable(false) - .withCredentialName("lhzdobp") - .withAzureKeyVaultUrl("mflbv") - .withServicePrincipalName("chrkcciwwzjuqk") - .withServicePrincipalSecret("fakeServicePrincipleSecretPlaceholder")) - .withServerConfigurationsManagementSettings( - new ServerConfigurationsManagementSettings() - .withSqlConnectivityUpdateSettings( - new SqlConnectivityUpdateSettings() - .withConnectivityType(ConnectivityType.PUBLIC) - .withPort(1163138760) - .withSqlAuthUpdateUsername("fakeSqlAuthUpdateUserNamePlaceholder") - .withSqlAuthUpdatePassword("fakeSqlAuthUpdatePasswordPlaceholder")) - .withSqlWorkloadTypeUpdateSettings( - new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.DW)) - .withSqlStorageUpdateSettings( - new SqlStorageUpdateSettings() - .withDiskCount(93185233) - .withStartingDeviceId(499062312) - .withDiskConfigurationType(DiskConfigurationType.NEW)) - .withAdditionalFeaturesServerConfigurations( - new AdditionalFeaturesServerConfigurations().withIsRServicesEnabled(true)) - .withSqlInstanceSettings( - new SqlInstanceSettings() - .withCollation("hocohslkev") - .withMaxDop(1452843037) - .withIsOptimizeForAdHocWorkloadsEnabled(false) - .withMinServerMemoryMB(1915206631) - .withMaxServerMemoryMB(635098272) - .withIsLpimEnabled(true) - .withIsIfiEnabled(true))) - .withStorageConfigurationSettings( - new StorageConfigurationSettings() - .withSqlDataSettings( - new SqlStorageSettings() - .withLuns(Arrays.asList(750094319, 441262471)) - .withDefaultFilePath("ithlvmezyvshxm")) - .withSqlLogSettings( - new SqlStorageSettings() - .withLuns(Arrays.asList(2042967034, 820071175, 681165656)) - .withDefaultFilePath("igrxwburvjxxjn")) - .withSqlTempDbSettings( - new SqlTempDbSettings() - .withDataFileSize(655244901) - .withDataGrowth(796522407) - .withLogFileSize(1581089013) - .withLogGrowth(1482419493) - .withDataFileCount(368872056) - .withPersistFolder(true) - .withPersistFolderPath("vudwtiukbldng") - .withLuns(Arrays.asList(2138211196, 1997522468, 655680628)) - .withDefaultFilePath("z")) - .withSqlSystemDbOnDataDisk(false) - .withDiskConfigurationType(DiskConfigurationType.ADD) - .withStorageWorkloadType(StorageWorkloadType.OLTP)) - .withAssessmentSettings( - new AssessmentSettings() - .withEnable(true) - .withRunImmediately(true) - .withSchedule( - new Schedule() - .withEnable(false) - .withWeeklyInterval(2112033193) - .withMonthlyOccurrence(2000492920) - .withDayOfWeek(AssessmentDayOfWeek.SUNDAY) - .withStartTime("typmrbpizcdrqjsd"))) - .withEnableAutomaticUpgrade(true); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineProperties.class); - Assertions.assertEquals("myzydagfuaxbez", model.virtualMachineResourceId()); - Assertions.assertEquals("q", model.sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.DR, model.sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.LIGHT_WEIGHT, model.sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, model.leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.WEB, model.sqlImageSku()); - Assertions.assertEquals("o", model.sqlVirtualMachineGroupResourceId()); - Assertions.assertEquals("fakeBootstrapCredentialPlaceholder", model.wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeOperatorCredentialPlaceholder", model.wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", model.wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("xhqyudxorrqnb", model.wsfcStaticIp()); - Assertions.assertEquals(true, model.autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.autoPatchingSettings().dayOfWeek()); - Assertions.assertEquals(2041227856, model.autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions.assertEquals(688230720, model.autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(true, model.autoBackupSettings().enable()); - Assertions.assertEquals(false, model.autoBackupSettings().enableEncryption()); - Assertions.assertEquals(711383541, model.autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("rm", model.autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("d", model.autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeAutoBackupStorageCredentialPlaceholder", model.autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakeAutoBackupCredentialPlaceholder", model.autoBackupSettings().password()); - Assertions.assertEquals(false, model.autoBackupSettings().backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.MANUAL, model.autoBackupSettings().backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.WEEKLY, model.autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(AutoBackupDaysOfWeek.MONDAY, model.autoBackupSettings().daysOfWeek().get(0)); - Assertions.assertEquals(79438477, model.autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(1785940860, model.autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(1882721753, model.autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(false, model.keyVaultCredentialSettings().enable()); - Assertions.assertEquals("lhzdobp", model.keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("mflbv", model.keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions.assertEquals("chrkcciwwzjuqk", model.keyVaultCredentialSettings().servicePrincipalName()); - Assertions.assertEquals("fakeServicePrincipleSecretPlaceholder", model.keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions - .assertEquals( - ConnectivityType.PUBLIC, - model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().connectivityType()); - Assertions - .assertEquals( - 1163138760, model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().port()); - Assertions - .assertEquals( - "fakeSqlAuthUpdateUserNamePlaceholder", - model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().sqlAuthUpdateUsername()); - Assertions - .assertEquals( - "fakeSqlAuthUpdatePasswordPlaceholder", - model.serverConfigurationsManagementSettings().sqlConnectivityUpdateSettings().sqlAuthUpdatePassword()); - Assertions - .assertEquals( - SqlWorkloadType.DW, - model.serverConfigurationsManagementSettings().sqlWorkloadTypeUpdateSettings().sqlWorkloadType()); - Assertions - .assertEquals( - 93185233, model.serverConfigurationsManagementSettings().sqlStorageUpdateSettings().diskCount()); - Assertions - .assertEquals( - 499062312, - model.serverConfigurationsManagementSettings().sqlStorageUpdateSettings().startingDeviceId()); - Assertions - .assertEquals( - DiskConfigurationType.NEW, - model.serverConfigurationsManagementSettings().sqlStorageUpdateSettings().diskConfigurationType()); - Assertions - .assertEquals( - true, - model - .serverConfigurationsManagementSettings() - .additionalFeaturesServerConfigurations() - .isRServicesEnabled()); - Assertions - .assertEquals( - "hocohslkev", model.serverConfigurationsManagementSettings().sqlInstanceSettings().collation()); - Assertions - .assertEquals(1452843037, model.serverConfigurationsManagementSettings().sqlInstanceSettings().maxDop()); - Assertions - .assertEquals( - false, - model - .serverConfigurationsManagementSettings() - .sqlInstanceSettings() - .isOptimizeForAdHocWorkloadsEnabled()); - Assertions - .assertEquals( - 1915206631, model.serverConfigurationsManagementSettings().sqlInstanceSettings().minServerMemoryMB()); - Assertions - .assertEquals( - 635098272, model.serverConfigurationsManagementSettings().sqlInstanceSettings().maxServerMemoryMB()); - Assertions - .assertEquals(true, model.serverConfigurationsManagementSettings().sqlInstanceSettings().isLpimEnabled()); - Assertions - .assertEquals(true, model.serverConfigurationsManagementSettings().sqlInstanceSettings().isIfiEnabled()); - Assertions.assertEquals(750094319, model.storageConfigurationSettings().sqlDataSettings().luns().get(0)); - Assertions - .assertEquals("ithlvmezyvshxm", model.storageConfigurationSettings().sqlDataSettings().defaultFilePath()); - Assertions.assertEquals(2042967034, model.storageConfigurationSettings().sqlLogSettings().luns().get(0)); - Assertions - .assertEquals("igrxwburvjxxjn", model.storageConfigurationSettings().sqlLogSettings().defaultFilePath()); - Assertions.assertEquals(655244901, model.storageConfigurationSettings().sqlTempDbSettings().dataFileSize()); - Assertions.assertEquals(796522407, model.storageConfigurationSettings().sqlTempDbSettings().dataGrowth()); - Assertions.assertEquals(1581089013, model.storageConfigurationSettings().sqlTempDbSettings().logFileSize()); - Assertions.assertEquals(1482419493, model.storageConfigurationSettings().sqlTempDbSettings().logGrowth()); - Assertions.assertEquals(368872056, model.storageConfigurationSettings().sqlTempDbSettings().dataFileCount()); - Assertions.assertEquals(true, model.storageConfigurationSettings().sqlTempDbSettings().persistFolder()); - Assertions - .assertEquals( - "vudwtiukbldng", model.storageConfigurationSettings().sqlTempDbSettings().persistFolderPath()); - Assertions.assertEquals(2138211196, model.storageConfigurationSettings().sqlTempDbSettings().luns().get(0)); - Assertions.assertEquals("z", model.storageConfigurationSettings().sqlTempDbSettings().defaultFilePath()); - Assertions.assertEquals(false, model.storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals(DiskConfigurationType.ADD, model.storageConfigurationSettings().diskConfigurationType()); - Assertions.assertEquals(StorageWorkloadType.OLTP, model.storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(true, model.assessmentSettings().enable()); - Assertions.assertEquals(true, model.assessmentSettings().runImmediately()); - Assertions.assertEquals(false, model.assessmentSettings().schedule().enable()); - Assertions.assertEquals(2112033193, model.assessmentSettings().schedule().weeklyInterval()); - Assertions.assertEquals(2000492920, model.assessmentSettings().schedule().monthlyOccurrence()); - Assertions.assertEquals(AssessmentDayOfWeek.SUNDAY, model.assessmentSettings().schedule().dayOfWeek()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.assessmentSettings().schedule().startTime()); - Assertions.assertEquals(true, model.enableAutomaticUpgrade()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineUpdateTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineUpdateTests.java deleted file mode 100644 index 22c94cc37342d..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachineUpdateTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachineUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlVirtualMachineUpdateTests { - @Test - public void testDeserialize() { - SqlVirtualMachineUpdate model = - BinaryData - .fromString( - "{\"tags\":{\"unmpxttd\":\"hj\",\"nbtkcxywnytnr\":\"hrbnlankxmyskpbh\",\"qidybyx\":\"yn\",\"aaxdbabphlwrq\":\"zfcl\"}}") - .toObject(SqlVirtualMachineUpdate.class); - Assertions.assertEquals("hj", model.tags().get("unmpxttd")); - } - - @Test - public void testSerialize() { - SqlVirtualMachineUpdate model = - new SqlVirtualMachineUpdate() - .withTags( - mapOf( - "unmpxttd", - "hj", - "nbtkcxywnytnr", - "hrbnlankxmyskpbh", - "qidybyx", - "yn", - "aaxdbabphlwrq", - "zfcl")); - model = BinaryData.fromObject(model).toObject(SqlVirtualMachineUpdate.class); - Assertions.assertEquals("hj", model.tags().get("unmpxttd")); - } - - @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/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateTests.java deleted file mode 100644 index 9532bebb7600f..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesCreateOrUpdateTests.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import com.azure.resourcemanager.sqlvirtualmachine.models.IdentityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.KeyVaultCredentialSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.LeastPrivilegeMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.ResourceIdentity; -import com.azure.resourcemanager.sqlvirtualmachine.models.ServerConfigurationsManagementSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -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 SqlVirtualMachinesCreateOrUpdateTests { - @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 = - "{\"identity\":{\"type\":\"None\"},\"properties\":{\"virtualMachineResourceId\":\"y\",\"provisioningState\":\"Succeeded\",\"sqlImageOffer\":\"dvstkw\",\"sqlServerLicenseType\":\"PAYG\",\"sqlManagement\":\"LightWeight\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Web\",\"sqlVirtualMachineGroupResourceId\":\"mtdaa\",\"wsfcDomainCredentials\":{\"clusterBootstrapAccountPassword\":\"fakeClusterBootstrapAccountPasswordPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeOperatorAccountPasswordPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"},\"wsfcStaticIp\":\"i\",\"autoPatchingSettings\":{\"enable\":true,\"dayOfWeek\":\"Tuesday\",\"maintenanceWindowStartingHour\":261614569,\"maintenanceWindowDuration\":1772217773},\"autoBackupSettings\":{\"enable\":false,\"enableEncryption\":false,\"retentionPeriod\":1453079674,\"storageAccountUrl\":\"szkkfoqre\",\"storageContainerName\":\"kzikfjawneaivxwc\",\"storageAccessKey\":\"fakeAutoBackupStorageAccessKeyPlaceholder\",\"password\":\"fakeAutoBackupPasswordPlaceholder\",\"backupSystemDbs\":true,\"backupScheduleType\":\"Manual\",\"fullBackupFrequency\":\"Weekly\",\"daysOfWeek\":[],\"fullBackupStartTime\":1879278925,\"fullBackupWindowHours\":883019177,\"logBackupFrequency\":1246118617},\"keyVaultCredentialSettings\":{\"enable\":true,\"credentialName\":\"hyoulpjr\",\"azureKeyVaultUrl\":\"ag\",\"servicePrincipalName\":\"vimjwos\",\"servicePrincipalSecret\":\"fakeSecretPlaceholder\"},\"serverConfigurationsManagementSettings\":{},\"storageConfigurationSettings\":{\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"EXTEND\",\"storageWorkloadType\":\"GENERAL\"},\"assessmentSettings\":{\"enable\":false,\"runImmediately\":false},\"enableAutomaticUpgrade\":true},\"location\":\"qgge\",\"tags\":{\"qidbqfatpxllrxcy\":\"nyga\",\"dmjsjqb\":\"moadsuvarmy\",\"yc\":\"hhyxxrw\"},\"id\":\"duhpk\",\"name\":\"kgymareqnajxqug\",\"type\":\"hky\"}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SqlVirtualMachine response = - manager - .sqlVirtualMachines() - .define("reqnovvqfov") - .withRegion("oocrkvcikhnv") - .withExistingResourceGroup("pkkpw") - .withTags(mapOf("gxk", "qgxqquezikyw")) - .withIdentity(new ResourceIdentity().withType(IdentityType.NONE)) - .withVirtualMachineResourceId("syrsndsytgadgvra") - .withSqlImageOffer("nzar") - .withSqlServerLicenseType(SqlServerLicenseType.PAYG) - .withSqlManagement(SqlManagementMode.NO_AGENT) - .withLeastPrivilegeMode(LeastPrivilegeMode.ENABLED) - .withSqlImageSku(SqlImageSku.ENTERPRISE) - .withWsfcDomainCredentials( - new WsfcDomainCredentials() - .withClusterBootstrapAccountPassword("fakeClusterBootstrapAccountPasswordPlaceholder") - .withClusterOperatorAccountPassword("fakeClusterOperatorAccountPasswordPlaceholder") - .withSqlServiceAccountPassword("fakeSqlServiceAccountPasswordPlaceholder")) - .withWsfcStaticIp("torzih") - .withAutoPatchingSettings( - new AutoPatchingSettings() - .withEnable(false) - .withDayOfWeek(DayOfWeek.TUESDAY) - .withMaintenanceWindowStartingHour(2033015184) - .withMaintenanceWindowDuration(1899163147)) - .withAutoBackupSettings( - new AutoBackupSettings() - .withEnable(true) - .withEnableEncryption(true) - .withRetentionPeriod(1849555195) - .withStorageAccountUrl("c") - .withStorageContainerName("kqqzqioxiysu") - .withStorageAccessKey("fakeStorageCredentialPlaceholder") - .withPassword("fakePasswordPlaceholder") - .withBackupSystemDbs(false) - .withBackupScheduleType(BackupScheduleType.AUTOMATED) - .withFullBackupFrequency(FullBackupFrequencyType.DAILY) - .withDaysOfWeek(Arrays.asList()) - .withFullBackupStartTime(1150716691) - .withFullBackupWindowHours(846796617) - .withLogBackupFrequency(1107344942)) - .withKeyVaultCredentialSettings( - new KeyVaultCredentialSettings() - .withEnable(false) - .withCredentialName("nmabik") - .withAzureKeyVaultUrl("orgjhxbldt") - .withServicePrincipalName("wrlkdmtn") - .withServicePrincipalSecret("ok")) - .withServerConfigurationsManagementSettings(new ServerConfigurationsManagementSettings()) - .withStorageConfigurationSettings( - new StorageConfigurationSettings() - .withSqlSystemDbOnDataDisk(true) - .withDiskConfigurationType(DiskConfigurationType.EXTEND) - .withStorageWorkloadType(StorageWorkloadType.GENERAL)) - .withAssessmentSettings(new AssessmentSettings().withEnable(false).withRunImmediately(false)) - .withEnableAutomaticUpgrade(true) - .create(); - - Assertions.assertEquals("qgge", response.location()); - Assertions.assertEquals("nyga", response.tags().get("qidbqfatpxllrxcy")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("y", response.virtualMachineResourceId()); - Assertions.assertEquals("dvstkw", response.sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.PAYG, response.sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.LIGHT_WEIGHT, response.sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, response.leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.WEB, response.sqlImageSku()); - Assertions.assertEquals("mtdaa", response.sqlVirtualMachineGroupResourceId()); - Assertions.assertEquals("fakeClusterBootstrapAccountPasswordPlaceholder", - response.wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeOperatorAccountPasswordPlaceholder", - response.wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", - response.wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("i", response.wsfcStaticIp()); - Assertions.assertEquals(true, response.autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.TUESDAY, response.autoPatchingSettings().dayOfWeek()); - Assertions.assertEquals(261614569, response.autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions.assertEquals(1772217773, response.autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(false, response.autoBackupSettings().enable()); - Assertions.assertEquals(false, response.autoBackupSettings().enableEncryption()); - Assertions.assertEquals(1453079674, response.autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("szkkfoqre", response.autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("kzikfjawneaivxwc", response.autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeAutoBackupStorageAccessKeyPlaceholder", - response.autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakeAutoBackupPasswordPlaceholder", response.autoBackupSettings().password()); - Assertions.assertEquals(true, response.autoBackupSettings().backupSystemDbs()); - Assertions.assertEquals(BackupScheduleType.MANUAL, response.autoBackupSettings().backupScheduleType()); - Assertions.assertEquals(FullBackupFrequencyType.WEEKLY, response.autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(1879278925, response.autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(883019177, response.autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(1246118617, response.autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(true, response.keyVaultCredentialSettings().enable()); - Assertions.assertEquals("hyoulpjr", response.keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("ag", response.keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions.assertEquals("vimjwos", response.keyVaultCredentialSettings().servicePrincipalName()); - Assertions.assertEquals("fakeSecretPlaceholder", response.keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions.assertEquals(false, response.storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals( - DiskConfigurationType.EXTEND, response.storageConfigurationSettings().diskConfigurationType()); - Assertions - .assertEquals(StorageWorkloadType.GENERAL, response.storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(false, response.assessmentSettings().enable()); - Assertions.assertEquals(false, response.assessmentSettings().runImmediately()); - Assertions.assertEquals(true, response.enableAutomaticUpgrade()); - } - - @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/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteTests.java deleted file mode 100644 index 4e07de90a6a94..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesDeleteTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -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 SqlVirtualMachinesDeleteTests { - @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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sqlVirtualMachines().delete("wdmhdlxyjrxs", "gafcnihgwqapnedg", Context.NONE); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupTests.java deleted file mode 100644 index 0931ce2d638aa..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListByResourceGroupTests.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import com.azure.resourcemanager.sqlvirtualmachine.models.IdentityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.LeastPrivilegeMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -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 SqlVirtualMachinesListByResourceGroupTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"None\"},\"properties\":{\"virtualMachineResourceId\":\"odsotbobzdop\",\"provisioningState\":\"wvnhdldwmgx\",\"sqlImageOffer\":\"rslpmutwuoeg\",\"sqlServerLicenseType\":\"AHUB\",\"sqlManagement\":\"LightWeight\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Developer\",\"sqlVirtualMachineGroupResourceId\":\"sluicpdggkzz\",\"wsfcDomainCredentials\":{\"clusterBootstrapAccountPassword\":\"fakeClusterBootstrapAccountPasswordPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeClusterOperatorAccountPasswordPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"},\"wsfcStaticIp\":\"taakc\",\"autoPatchingSettings\":{\"enable\":false,\"dayOfWeek\":\"Wednesday\",\"maintenanceWindowStartingHour\":1814420357,\"maintenanceWindowDuration\":1349275484},\"autoBackupSettings\":{\"enable\":true,\"enableEncryption\":true,\"retentionPeriod\":1989438546,\"storageAccountUrl\":\"smond\",\"storageContainerName\":\"quxvypomgkop\",\"storageAccessKey\":\"fakeStorageAccessKeyPlaceholder\",\"password\":\"fakePasswordPlaceholder\",\"backupSystemDbs\":false,\"backupScheduleType\":\"Manual\",\"fullBackupFrequency\":\"Weekly\",\"daysOfWeek\":[],\"fullBackupStartTime\":1382848835,\"fullBackupWindowHours\":760338850,\"logBackupFrequency\":1009044014},\"keyVaultCredentialSettings\":{\"enable\":false,\"credentialName\":\"tddckcb\",\"azureKeyVaultUrl\":\"ejrjxgciqibrho\",\"servicePrincipalName\":\"sdqrhzoymibmrq\",\"servicePrincipalSecret\":\"fakeSecretPlaceholder\"},\"serverConfigurationsManagementSettings\":{},\"storageConfigurationSettings\":{\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"NEW\",\"storageWorkloadType\":\"OLTP\"},\"assessmentSettings\":{\"enable\":true,\"runImmediately\":false},\"enableAutomaticUpgrade\":true},\"location\":\"giwbwoenwa\",\"tags\":{\"xwbpokulpiuj\":\"tdtkcn\",\"obyu\":\"aasipqi\",\"dbutauvfbtkuwhh\":\"erpqlpqwcciuqg\"},\"id\":\"hykojoxafnndlpic\",\"name\":\"koymkcd\",\"type\":\"h\"}]}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sqlVirtualMachines().listByResourceGroup("bcvkcvqvpkeq", Context.NONE); - - Assertions.assertEquals("giwbwoenwa", response.iterator().next().location()); - Assertions.assertEquals("tdtkcn", response.iterator().next().tags().get("xwbpokulpiuj")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("odsotbobzdop", response.iterator().next().virtualMachineResourceId()); - Assertions.assertEquals("rslpmutwuoeg", response.iterator().next().sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.AHUB, response.iterator().next().sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.LIGHT_WEIGHT, response.iterator().next().sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, response.iterator().next().leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.DEVELOPER, response.iterator().next().sqlImageSku()); - Assertions.assertEquals("sluicpdggkzz", response.iterator().next().sqlVirtualMachineGroupResourceId()); - Assertions - .assertEquals("fakeClusterBootstrapAccountPasswordPlaceholder", - response.iterator().next().wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions - .assertEquals("fakeClusterOperatorAccountPasswordPlaceholder", - response.iterator().next().wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions - .assertEquals( - "fakeSqlServiceAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("taakc", response.iterator().next().wsfcStaticIp()); - Assertions.assertEquals(false, response.iterator().next().autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, response.iterator().next().autoPatchingSettings().dayOfWeek()); - Assertions - .assertEquals( - 1814420357, response.iterator().next().autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions - .assertEquals(1349275484, response.iterator().next().autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().enable()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().enableEncryption()); - Assertions.assertEquals(1989438546, response.iterator().next().autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("smond", response.iterator().next().autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("quxvypomgkop", response.iterator().next().autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", response.iterator().next().autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakePasswordPlaceholder", response.iterator().next().autoBackupSettings().password()); - Assertions.assertEquals(false, response.iterator().next().autoBackupSettings().backupSystemDbs()); - Assertions - .assertEquals( - BackupScheduleType.MANUAL, response.iterator().next().autoBackupSettings().backupScheduleType()); - Assertions - .assertEquals( - FullBackupFrequencyType.WEEKLY, response.iterator().next().autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(1382848835, response.iterator().next().autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(760338850, response.iterator().next().autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(1009044014, response.iterator().next().autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(false, response.iterator().next().keyVaultCredentialSettings().enable()); - Assertions.assertEquals("tddckcb", response.iterator().next().keyVaultCredentialSettings().credentialName()); - Assertions - .assertEquals("ejrjxgciqibrho", response.iterator().next().keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions - .assertEquals( - "sdqrhzoymibmrq", response.iterator().next().keyVaultCredentialSettings().servicePrincipalName()); - Assertions - .assertEquals("fakeSecretPlaceholder", response.iterator().next().keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions - .assertEquals(false, response.iterator().next().storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals( - DiskConfigurationType.NEW, - response.iterator().next().storageConfigurationSettings().diskConfigurationType()); - Assertions - .assertEquals( - StorageWorkloadType.OLTP, - response.iterator().next().storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(true, response.iterator().next().assessmentSettings().enable()); - Assertions.assertEquals(false, response.iterator().next().assessmentSettings().runImmediately()); - Assertions.assertEquals(true, response.iterator().next().enableAutomaticUpgrade()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupTests.java deleted file mode 100644 index a3a2457bb598f..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListBySqlVmGroupTests.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import com.azure.resourcemanager.sqlvirtualmachine.models.IdentityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.LeastPrivilegeMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -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 SqlVirtualMachinesListBySqlVmGroupTests { - @Test - public void testListBySqlVmGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"SystemAssigned\"},\"properties\":{\"virtualMachineResourceId\":\"vkr\",\"provisioningState\":\"wbxqzvszjfau\",\"sqlImageOffer\":\"fdxxivetvtcqaqtd\",\"sqlServerLicenseType\":\"DR\",\"sqlManagement\":\"LightWeight\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Developer\",\"sqlVirtualMachineGroupResourceId\":\"yslqbhsfx\",\"wsfcDomainCredentials\":{\"clusterBootstrapAccountPassword\":\"fakeClusterBootstrapAccountPasswordPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeClusterOperatorAccountPasswordPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"},\"wsfcStaticIp\":\"vasrruvwb\",\"autoPatchingSettings\":{\"enable\":true,\"dayOfWeek\":\"Thursday\",\"maintenanceWindowStartingHour\":213257698,\"maintenanceWindowDuration\":540005244},\"autoBackupSettings\":{\"enable\":false,\"enableEncryption\":true,\"retentionPeriod\":1282258802,\"storageAccountUrl\":\"srfbjfdtwss\",\"storageContainerName\":\"ftpvjzbexil\",\"storageAccessKey\":\"fakeStorageAccessKeyPlaceholder\",\"password\":\"fakePasswordPlaceholder\",\"backupSystemDbs\":true,\"backupScheduleType\":\"Automated\",\"fullBackupFrequency\":\"Daily\",\"daysOfWeek\":[],\"fullBackupStartTime\":151199466,\"fullBackupWindowHours\":395045632,\"logBackupFrequency\":1463995661},\"keyVaultCredentialSettings\":{\"enable\":false,\"credentialName\":\"ervnaenqpehi\",\"azureKeyVaultUrl\":\"oygmift\",\"servicePrincipalName\":\"zdnds\",\"servicePrincipalSecret\":\"fakeSecretPlaceholder\"},\"serverConfigurationsManagementSettings\":{},\"storageConfigurationSettings\":{\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"EXTEND\",\"storageWorkloadType\":\"DW\"},\"assessmentSettings\":{\"enable\":false,\"runImmediately\":false},\"enableAutomaticUpgrade\":true},\"location\":\"iertgccymvaolp\",\"tags\":{\"lzpswiydm\":\"qlfmmdnbb\",\"sadbz\":\"wyhzdx\"},\"id\":\"nvdfznuda\",\"name\":\"dvxzbncblylpst\",\"type\":\"bhhxsrzdzuc\"}]}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sqlVirtualMachines().listBySqlVmGroup("nrmfqjhhk", "bpvjymjhx", Context.NONE); - - Assertions.assertEquals("iertgccymvaolp", response.iterator().next().location()); - Assertions.assertEquals("qlfmmdnbb", response.iterator().next().tags().get("lzpswiydm")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("vkr", response.iterator().next().virtualMachineResourceId()); - Assertions.assertEquals("fdxxivetvtcqaqtd", response.iterator().next().sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.DR, response.iterator().next().sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.LIGHT_WEIGHT, response.iterator().next().sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, response.iterator().next().leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.DEVELOPER, response.iterator().next().sqlImageSku()); - Assertions.assertEquals("yslqbhsfx", response.iterator().next().sqlVirtualMachineGroupResourceId()); - Assertions - .assertEquals( - "fakeClusterBootstrapAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions - .assertEquals( - "fakeClusterOperatorAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions - .assertEquals("fakeSqlServiceAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("vasrruvwb", response.iterator().next().wsfcStaticIp()); - Assertions.assertEquals(true, response.iterator().next().autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.THURSDAY, response.iterator().next().autoPatchingSettings().dayOfWeek()); - Assertions - .assertEquals(213257698, response.iterator().next().autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions - .assertEquals(540005244, response.iterator().next().autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(false, response.iterator().next().autoBackupSettings().enable()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().enableEncryption()); - Assertions.assertEquals(1282258802, response.iterator().next().autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("srfbjfdtwss", response.iterator().next().autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("ftpvjzbexil", response.iterator().next().autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", response.iterator().next().autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakePasswordPlaceholder", response.iterator().next().autoBackupSettings().password()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().backupSystemDbs()); - Assertions - .assertEquals( - BackupScheduleType.AUTOMATED, response.iterator().next().autoBackupSettings().backupScheduleType()); - Assertions - .assertEquals( - FullBackupFrequencyType.DAILY, response.iterator().next().autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(151199466, response.iterator().next().autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(395045632, response.iterator().next().autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(1463995661, response.iterator().next().autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(false, response.iterator().next().keyVaultCredentialSettings().enable()); - Assertions - .assertEquals("ervnaenqpehi", response.iterator().next().keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("oygmift", response.iterator().next().keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions - .assertEquals("zdnds", response.iterator().next().keyVaultCredentialSettings().servicePrincipalName()); - Assertions - .assertEquals("fakeSecretPlaceholder", response.iterator().next().keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions - .assertEquals(false, response.iterator().next().storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals( - DiskConfigurationType.EXTEND, - response.iterator().next().storageConfigurationSettings().diskConfigurationType()); - Assertions - .assertEquals( - StorageWorkloadType.DW, - response.iterator().next().storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(false, response.iterator().next().assessmentSettings().enable()); - Assertions.assertEquals(false, response.iterator().next().assessmentSettings().runImmediately()); - Assertions.assertEquals(true, response.iterator().next().enableAutomaticUpgrade()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListTests.java deleted file mode 100644 index ab45750d2c3f3..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesListTests.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType; -import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType; -import com.azure.resourcemanager.sqlvirtualmachine.models.IdentityType; -import com.azure.resourcemanager.sqlvirtualmachine.models.LeastPrivilegeMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlImageSku; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlManagementMode; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVirtualMachine; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -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 SqlVirtualMachinesListTests { - @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\":[{\"identity\":{\"type\":\"None\"},\"properties\":{\"virtualMachineResourceId\":\"evfiwjmygt\",\"provisioningState\":\"slswtm\",\"sqlImageOffer\":\"riofzpyqse\",\"sqlServerLicenseType\":\"PAYG\",\"sqlManagement\":\"Full\",\"leastPrivilegeMode\":\"Enabled\",\"sqlImageSku\":\"Enterprise\",\"sqlVirtualMachineGroupResourceId\":\"szhedplvw\",\"wsfcDomainCredentials\":{\"clusterBootstrapAccountPassword\":\"fakeClusterBootstrapAccountPasswordPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeClusterOperatorAccountPasswordPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"},\"wsfcStaticIp\":\"konzmnsik\",\"autoPatchingSettings\":{\"enable\":true,\"dayOfWeek\":\"Friday\",\"maintenanceWindowStartingHour\":1625673068,\"maintenanceWindowDuration\":1175665004},\"autoBackupSettings\":{\"enable\":true,\"enableEncryption\":true,\"retentionPeriod\":992785532,\"storageAccountUrl\":\"v\",\"storageContainerName\":\"ur\",\"storageAccessKey\":\"fakeStorageAccessKeyPlaceholder\",\"password\":\"fakePasswordPlaceholder\",\"backupSystemDbs\":true,\"backupScheduleType\":\"Automated\",\"fullBackupFrequency\":\"Daily\",\"daysOfWeek\":[],\"fullBackupStartTime\":442330150,\"fullBackupWindowHours\":90744470,\"logBackupFrequency\":299284831},\"keyVaultCredentialSettings\":{\"enable\":true,\"credentialName\":\"iplbpodxunkbebxm\",\"azureKeyVaultUrl\":\"yyntwl\",\"servicePrincipalName\":\"qtkoievs\",\"servicePrincipalSecret\":\"fakeSecretPlaceholder\"},\"serverConfigurationsManagementSettings\":{},\"storageConfigurationSettings\":{\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"ADD\",\"storageWorkloadType\":\"GENERAL\"},\"assessmentSettings\":{\"enable\":true,\"runImmediately\":true},\"enableAutomaticUpgrade\":false},\"location\":\"vpbttd\",\"tags\":{\"xe\":\"rp\",\"bhjpglkfgohdne\":\"mnzb\",\"phsdyhto\":\"el\",\"v\":\"fikdowwqu\"},\"id\":\"zx\",\"name\":\"lvithhqzonosgg\",\"type\":\"hcohfwdsjnk\"}]}"; - - 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.sqlVirtualMachines().list(Context.NONE); - - Assertions.assertEquals("vpbttd", response.iterator().next().location()); - Assertions.assertEquals("rp", response.iterator().next().tags().get("xe")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("evfiwjmygt", response.iterator().next().virtualMachineResourceId()); - Assertions.assertEquals("riofzpyqse", response.iterator().next().sqlImageOffer()); - Assertions.assertEquals(SqlServerLicenseType.PAYG, response.iterator().next().sqlServerLicenseType()); - Assertions.assertEquals(SqlManagementMode.FULL, response.iterator().next().sqlManagement()); - Assertions.assertEquals(LeastPrivilegeMode.ENABLED, response.iterator().next().leastPrivilegeMode()); - Assertions.assertEquals(SqlImageSku.ENTERPRISE, response.iterator().next().sqlImageSku()); - Assertions.assertEquals("szhedplvw", response.iterator().next().sqlVirtualMachineGroupResourceId()); - Assertions - .assertEquals( - "fakeClusterBootstrapAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().clusterBootstrapAccountPassword()); - Assertions - .assertEquals("fakeClusterOperatorAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().clusterOperatorAccountPassword()); - Assertions - .assertEquals("fakeSqlServiceAccountPasswordPlaceholder", response.iterator().next().wsfcDomainCredentials().sqlServiceAccountPassword()); - Assertions.assertEquals("konzmnsik", response.iterator().next().wsfcStaticIp()); - Assertions.assertEquals(true, response.iterator().next().autoPatchingSettings().enable()); - Assertions.assertEquals(DayOfWeek.FRIDAY, response.iterator().next().autoPatchingSettings().dayOfWeek()); - Assertions - .assertEquals( - 1625673068, response.iterator().next().autoPatchingSettings().maintenanceWindowStartingHour()); - Assertions - .assertEquals(1175665004, response.iterator().next().autoPatchingSettings().maintenanceWindowDuration()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().enable()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().enableEncryption()); - Assertions.assertEquals(992785532, response.iterator().next().autoBackupSettings().retentionPeriod()); - Assertions.assertEquals("v", response.iterator().next().autoBackupSettings().storageAccountUrl()); - Assertions.assertEquals("ur", response.iterator().next().autoBackupSettings().storageContainerName()); - Assertions.assertEquals("fakeStorageAccessKeyPlaceholder", response.iterator().next().autoBackupSettings().storageAccessKey()); - Assertions.assertEquals("fakePasswordPlaceholder", response.iterator().next().autoBackupSettings().password()); - Assertions.assertEquals(true, response.iterator().next().autoBackupSettings().backupSystemDbs()); - Assertions - .assertEquals( - BackupScheduleType.AUTOMATED, response.iterator().next().autoBackupSettings().backupScheduleType()); - Assertions - .assertEquals( - FullBackupFrequencyType.DAILY, response.iterator().next().autoBackupSettings().fullBackupFrequency()); - Assertions.assertEquals(442330150, response.iterator().next().autoBackupSettings().fullBackupStartTime()); - Assertions.assertEquals(90744470, response.iterator().next().autoBackupSettings().fullBackupWindowHours()); - Assertions.assertEquals(299284831, response.iterator().next().autoBackupSettings().logBackupFrequency()); - Assertions.assertEquals(true, response.iterator().next().keyVaultCredentialSettings().enable()); - Assertions - .assertEquals("iplbpodxunkbebxm", response.iterator().next().keyVaultCredentialSettings().credentialName()); - Assertions.assertEquals("yyntwl", response.iterator().next().keyVaultCredentialSettings().azureKeyVaultUrl()); - Assertions - .assertEquals("qtkoievs", response.iterator().next().keyVaultCredentialSettings().servicePrincipalName()); - Assertions - .assertEquals("fakeSecretPlaceholder", response.iterator().next().keyVaultCredentialSettings().servicePrincipalSecret()); - Assertions - .assertEquals(false, response.iterator().next().storageConfigurationSettings().sqlSystemDbOnDataDisk()); - Assertions - .assertEquals( - DiskConfigurationType.ADD, - response.iterator().next().storageConfigurationSettings().diskConfigurationType()); - Assertions - .assertEquals( - StorageWorkloadType.GENERAL, - response.iterator().next().storageConfigurationSettings().storageWorkloadType()); - Assertions.assertEquals(true, response.iterator().next().assessmentSettings().enable()); - Assertions.assertEquals(true, response.iterator().next().assessmentSettings().runImmediately()); - Assertions.assertEquals(false, response.iterator().next().enableAutomaticUpgrade()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeployTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeployTests.java deleted file mode 100644 index b4004c04e44ee..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesRedeployTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -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 SqlVirtualMachinesRedeployTests { - @Test - public void testRedeploy() 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sqlVirtualMachines().redeploy("wkfvhqcrailvp", "ppfufl", Context.NONE); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentTests.java deleted file mode 100644 index 9bf550d153b90..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlVirtualMachinesStartAssessmentTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.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.core.util.Context; -import com.azure.resourcemanager.sqlvirtualmachine.SqlVirtualMachineManager; -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 SqlVirtualMachinesStartAssessmentTests { - @Test - public void testStartAssessment() 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); - })); - - SqlVirtualMachineManager manager = - SqlVirtualMachineManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sqlVirtualMachines().startAssessment("ljuti", "swacffgdkzz", Context.NONE); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlWorkloadTypeUpdateSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlWorkloadTypeUpdateSettingsTests.java deleted file mode 100644 index 4711290e58d38..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/SqlWorkloadTypeUpdateSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlWorkloadType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlWorkloadTypeUpdateSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SqlWorkloadTypeUpdateSettingsTests { - @Test - public void testDeserialize() { - SqlWorkloadTypeUpdateSettings model = - BinaryData.fromString("{\"sqlWorkloadType\":\"DW\"}").toObject(SqlWorkloadTypeUpdateSettings.class); - Assertions.assertEquals(SqlWorkloadType.DW, model.sqlWorkloadType()); - } - - @Test - public void testSerialize() { - SqlWorkloadTypeUpdateSettings model = - new SqlWorkloadTypeUpdateSettings().withSqlWorkloadType(SqlWorkloadType.DW); - model = BinaryData.fromObject(model).toObject(SqlWorkloadTypeUpdateSettings.class); - Assertions.assertEquals(SqlWorkloadType.DW, model.sqlWorkloadType()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/StorageConfigurationSettingsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/StorageConfigurationSettingsTests.java deleted file mode 100644 index f79acbf9d26f2..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/StorageConfigurationSettingsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlStorageSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.SqlTempDbSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings; -import com.azure.resourcemanager.sqlvirtualmachine.models.StorageWorkloadType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class StorageConfigurationSettingsTests { - @Test - public void testDeserialize() { - StorageConfigurationSettings model = - BinaryData - .fromString( - "{\"sqlDataSettings\":{\"luns\":[10143119,1108075171,1769769453],\"defaultFilePath\":\"gvcl\"},\"sqlLogSettings\":{\"luns\":[1745548413,142984166,750018132],\"defaultFilePath\":\"kjeszz\"},\"sqlTempDbSettings\":{\"dataFileSize\":1755265349,\"dataGrowth\":1508297714,\"logFileSize\":836032675,\"logGrowth\":502156658,\"dataFileCount\":667929438,\"persistFolder\":false,\"persistFolderPath\":\"xnehmpvec\",\"luns\":[1976417253,68854326,1592452117,1209438571],\"defaultFilePath\":\"kk\"},\"sqlSystemDbOnDataDisk\":false,\"diskConfigurationType\":\"NEW\",\"storageWorkloadType\":\"DW\"}") - .toObject(StorageConfigurationSettings.class); - Assertions.assertEquals(10143119, model.sqlDataSettings().luns().get(0)); - Assertions.assertEquals("gvcl", model.sqlDataSettings().defaultFilePath()); - Assertions.assertEquals(1745548413, model.sqlLogSettings().luns().get(0)); - Assertions.assertEquals("kjeszz", model.sqlLogSettings().defaultFilePath()); - Assertions.assertEquals(1755265349, model.sqlTempDbSettings().dataFileSize()); - Assertions.assertEquals(1508297714, model.sqlTempDbSettings().dataGrowth()); - Assertions.assertEquals(836032675, model.sqlTempDbSettings().logFileSize()); - Assertions.assertEquals(502156658, model.sqlTempDbSettings().logGrowth()); - Assertions.assertEquals(667929438, model.sqlTempDbSettings().dataFileCount()); - Assertions.assertEquals(false, model.sqlTempDbSettings().persistFolder()); - Assertions.assertEquals("xnehmpvec", model.sqlTempDbSettings().persistFolderPath()); - Assertions.assertEquals(1976417253, model.sqlTempDbSettings().luns().get(0)); - Assertions.assertEquals("kk", model.sqlTempDbSettings().defaultFilePath()); - Assertions.assertEquals(false, model.sqlSystemDbOnDataDisk()); - Assertions.assertEquals(DiskConfigurationType.NEW, model.diskConfigurationType()); - Assertions.assertEquals(StorageWorkloadType.DW, model.storageWorkloadType()); - } - - @Test - public void testSerialize() { - StorageConfigurationSettings model = - new StorageConfigurationSettings() - .withSqlDataSettings( - new SqlStorageSettings() - .withLuns(Arrays.asList(10143119, 1108075171, 1769769453)) - .withDefaultFilePath("gvcl")) - .withSqlLogSettings( - new SqlStorageSettings() - .withLuns(Arrays.asList(1745548413, 142984166, 750018132)) - .withDefaultFilePath("kjeszz")) - .withSqlTempDbSettings( - new SqlTempDbSettings() - .withDataFileSize(1755265349) - .withDataGrowth(1508297714) - .withLogFileSize(836032675) - .withLogGrowth(502156658) - .withDataFileCount(667929438) - .withPersistFolder(false) - .withPersistFolderPath("xnehmpvec") - .withLuns(Arrays.asList(1976417253, 68854326, 1592452117, 1209438571)) - .withDefaultFilePath("kk")) - .withSqlSystemDbOnDataDisk(false) - .withDiskConfigurationType(DiskConfigurationType.NEW) - .withStorageWorkloadType(StorageWorkloadType.DW); - model = BinaryData.fromObject(model).toObject(StorageConfigurationSettings.class); - Assertions.assertEquals(10143119, model.sqlDataSettings().luns().get(0)); - Assertions.assertEquals("gvcl", model.sqlDataSettings().defaultFilePath()); - Assertions.assertEquals(1745548413, model.sqlLogSettings().luns().get(0)); - Assertions.assertEquals("kjeszz", model.sqlLogSettings().defaultFilePath()); - Assertions.assertEquals(1755265349, model.sqlTempDbSettings().dataFileSize()); - Assertions.assertEquals(1508297714, model.sqlTempDbSettings().dataGrowth()); - Assertions.assertEquals(836032675, model.sqlTempDbSettings().logFileSize()); - Assertions.assertEquals(502156658, model.sqlTempDbSettings().logGrowth()); - Assertions.assertEquals(667929438, model.sqlTempDbSettings().dataFileCount()); - Assertions.assertEquals(false, model.sqlTempDbSettings().persistFolder()); - Assertions.assertEquals("xnehmpvec", model.sqlTempDbSettings().persistFolderPath()); - Assertions.assertEquals(1976417253, model.sqlTempDbSettings().luns().get(0)); - Assertions.assertEquals("kk", model.sqlTempDbSettings().defaultFilePath()); - Assertions.assertEquals(false, model.sqlSystemDbOnDataDisk()); - Assertions.assertEquals(DiskConfigurationType.NEW, model.diskConfigurationType()); - Assertions.assertEquals(StorageWorkloadType.DW, model.storageWorkloadType()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainCredentialsTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainCredentialsTests.java deleted file mode 100644 index 3d9c0d553b454..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainCredentialsTests.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.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WsfcDomainCredentialsTests { - @Test - public void testDeserialize() { - WsfcDomainCredentials model = - BinaryData - .fromString( - "{\"clusterBootstrapAccountPassword\":\"fakeClusterBootstrapAccountPasswordPlaceholder\",\"clusterOperatorAccountPassword\":\"fakeClusterOperatorAccountPasswordPlaceholder\",\"sqlServiceAccountPassword\":\"fakeSqlServiceAccountPasswordPlaceholder\"}") - .toObject(WsfcDomainCredentials.class); - Assertions.assertEquals("fakeClusterBootstrapAccountPasswordPlaceholder", - model.clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeClusterOperatorAccountPasswordPlaceholder", - model.clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", model.sqlServiceAccountPassword()); - } - - @Test - public void testSerialize() { - WsfcDomainCredentials model = - new WsfcDomainCredentials() - .withClusterBootstrapAccountPassword("fakeClusterBootstrapAccountPasswordPlaceholder") - .withClusterOperatorAccountPassword("fakeClusterOperatorAccountPasswordPlaceholder") - .withSqlServiceAccountPassword("fakeSqlServiceAccountPasswordPlaceholder"); - model = BinaryData.fromObject(model).toObject(WsfcDomainCredentials.class); - Assertions.assertEquals("fakeClusterBootstrapAccountPasswordPlaceholder", - model.clusterBootstrapAccountPassword()); - Assertions.assertEquals("fakeClusterOperatorAccountPasswordPlaceholder", - model.clusterOperatorAccountPassword()); - Assertions.assertEquals("fakeSqlServiceAccountPasswordPlaceholder", model.sqlServiceAccountPassword()); - } -} diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainProfileTests.java b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainProfileTests.java deleted file mode 100644 index aff8194db34af..0000000000000 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/test/java/com/azure/resourcemanager/sqlvirtualmachine/generated/WsfcDomainProfileTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sqlvirtualmachine.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterSubnetType; -import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WsfcDomainProfileTests { - @Test - public void testDeserialize() { - WsfcDomainProfile model = - BinaryData - .fromString( - "{\"domainFqdn\":\"z\",\"ouPath\":\"iachbo\",\"clusterBootstrapAccount\":\"fakeClusterBootstrapAccountPlaceholder\",\"clusterOperatorAccount\":\"pyqr\",\"sqlServiceAccount\":\"z\",\"fileShareWitnessPath\":\"pvswjdkirso\",\"storageAccountUrl\":\"qxhcrmn\",\"storageAccountPrimaryKey\":\"fakeStorageAccountPrimaryKeyPlaceholder\",\"clusterSubnetType\":\"SingleSubnet\"}") - .toObject(WsfcDomainProfile.class); - Assertions.assertEquals("z", model.domainFqdn()); - Assertions.assertEquals("iachbo", model.ouPath()); - Assertions.assertEquals("fakeClusterBootstrapAccountPlaceholder", model.clusterBootstrapAccount()); - Assertions.assertEquals("pyqr", model.clusterOperatorAccount()); - Assertions.assertEquals("z", model.sqlServiceAccount()); - Assertions.assertEquals("pvswjdkirso", model.fileShareWitnessPath()); - Assertions.assertEquals("qxhcrmn", model.storageAccountUrl()); - Assertions.assertEquals("fakeStorageAccountPrimaryKeyPlaceholder", model.storageAccountPrimaryKey()); - Assertions.assertEquals(ClusterSubnetType.SINGLE_SUBNET, model.clusterSubnetType()); - } - - @Test - public void testSerialize() { - WsfcDomainProfile model = - new WsfcDomainProfile() - .withDomainFqdn("z") - .withOuPath("iachbo") - .withClusterBootstrapAccount("fakeClusterBootstrapAccountPlaceholder") - .withClusterOperatorAccount("pyqr") - .withSqlServiceAccount("z") - .withFileShareWitnessPath("pvswjdkirso") - .withStorageAccountUrl("qxhcrmn") - .withStorageAccountPrimaryKey("fakeStorageAccountPrimaryKeyPlaceholder") - .withClusterSubnetType(ClusterSubnetType.SINGLE_SUBNET); - model = BinaryData.fromObject(model).toObject(WsfcDomainProfile.class); - Assertions.assertEquals("z", model.domainFqdn()); - Assertions.assertEquals("iachbo", model.ouPath()); - Assertions.assertEquals("fakeClusterBootstrapAccountPlaceholder", model.clusterBootstrapAccount()); - Assertions.assertEquals("pyqr", model.clusterOperatorAccount()); - Assertions.assertEquals("z", model.sqlServiceAccount()); - Assertions.assertEquals("pvswjdkirso", model.fileShareWitnessPath()); - Assertions.assertEquals("qxhcrmn", model.storageAccountUrl()); - Assertions.assertEquals("fakeStorageAccountPrimaryKeyPlaceholder", model.storageAccountPrimaryKey()); - Assertions.assertEquals(ClusterSubnetType.SINGLE_SUBNET, model.clusterSubnetType()); - } -}